Multipart form handling should be performant, straightforward, and leave full control of the parsing process to the user, i.e. no surprising magic such as automatic creation of large files and saving anything there by default (although tools/helpers may exist to assist in that too).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def update_with_last_modified_time(qs, **kwargs): | |
# This function adds any auto_now field to the update call because QuerySet.update() doesn't do it :X | |
model_fields = qs.model._meta.get_fields() | |
fields_and_value_map = {} | |
for field in model_fields: | |
try: | |
auto_now = field.__getattribute__('auto_now') | |
except AttributeError: | |
auto_now = False |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
# If you need to test a REST client, this is a Python 2 recipe that runs a | |
# simple WSGI app for your tests. Any improvement suggestion is welcome. | |
# Run this with "python -m unittest testingwsgi" | |
# Put this in a testing resources module, say tests/resources.py | |
import os |