summaryrefslogtreecommitdiff
path: root/django/db/models
AgeCommit message (Collapse)Author
2007-02-28Added a "depth" argument to select_related() to control how many "levels" of ↵Jacob Kaplan-Moss
relations select_related() is willing to follow (refs #3275). Also added unit tests for select_related(). git-svn-id: http://code.djangoproject.com/svn/django/trunk@4645 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-02-26Fixed #3581, a small typo in OneToOneField.formfield(). Thanks, Andrew ↵Jacob Kaplan-Moss
Sutherland. git-svn-id: http://code.djangoproject.com/svn/django/trunk@4611 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-02-26Objects with FileFields no longer get save() called multiple times from the ↵Jacob Kaplan-Moss
AutomaticManipulator! This fixes #639, #572, and likely others I don't know of. This may be slightly backwards-incompatible: if you've been relying on the multiple-save behavior (why?), then you'll no longer see that happen. git-svn-id: http://code.djangoproject.com/svn/django/trunk@4609 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-02-26Fixed #2363 -- Fixed subclass checking in ModelBase to allow for mixinMalcolm Tredinnick
superclasses. Thanks phil.h.smith@gmail.com. git-svn-id: http://code.djangoproject.com/svn/django/trunk@4607 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-02-26Cleaned up comments from [4597] to be a bit more clear.Jacob Kaplan-Moss
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4598 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-02-26Fixed #3438: improved the speed of Model.__init__ (about 1/3 faster, it ↵Jacob Kaplan-Moss
appears). Thanks (a lot!) to Brian Harring. git-svn-id: http://code.djangoproject.com/svn/django/trunk@4597 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-02-26Fixed #3172: Model.validate() no longer raises TypeErrors on empty ↵Jacob Kaplan-Moss
Date*Fields. Thanks, floguy@gmail.com. git-svn-id: http://code.djangoproject.com/svn/django/trunk@4592 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-02-23Fixed silly typo in [4651].Jacob Kaplan-Moss
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4563 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-02-23Fixed #3541: queryset.count() now respects the queryset cache.Jacob Kaplan-Moss
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4561 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-02-21Changed database PhoneNumberField to use USPhoneNumberField as its newforms ↵Adrian Holovaty
form field (instead of IntegerField) git-svn-id: http://code.djangoproject.com/svn/django/trunk@4556 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-02-20Fixed #3257 -- Added newforms ModelChoiceField and ModelMultipleChoiceField, ↵Adrian Holovaty
which are now used by form_for_model() and form_for_instance(). Thanks for the patch, Honza Kral, floguy@gmail.com and kilian.cavalotti git-svn-id: http://code.djangoproject.com/svn/django/trunk@4547 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-02-19Fixed behaviour of admin interface (and AddManipulator) whenMalcolm Tredinnick
min/max_num_in_admin is specified without num_in_admin. A consequence of changes in [4500]. git-svn-id: http://code.djangoproject.com/svn/django/trunk@4542 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-02-14Changed __year lookup to use a BETWEEN SQL statement instead of comparing ↵Adrian Holovaty
the result of EXTRACT(year). This should be more efficient. git-svn-id: http://code.djangoproject.com/svn/django/trunk@4505 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-02-13Fixed #3394 -- Made min_num_in_admin be respected on new object creation. PatchMalcolm Tredinnick
from torne-django@wolfpuppy.org.uk. git-svn-id: http://code.djangoproject.com/svn/django/trunk@4500 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-02-13Updated [4497] to use something closer to the English language in the comment.Malcolm Tredinnick
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4498 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-02-13Fixed #3377 -- Fixed subtle infinite recursion bug in LazyDate objects. ThanksMalcolm Tredinnick
to brut.alll@gmail.com. git-svn-id: http://code.djangoproject.com/svn/django/trunk@4497 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-02-12#fixed #2256 -- Made count() interact with slicing on QuerySets. Patch fromMalcolm Tredinnick
SmileyChris. git-svn-id: http://code.djangoproject.com/svn/django/trunk@4488 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-02-11Revert [4485] in order to fix accidental mod_python breakage. Refs #2920.Malcolm Tredinnick
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4486 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-02-11Refs #2920 -- Replaced implicit uses of _() with explicit imports or calls ↵Russell Keith-Magee
to gettext(). At some point post 0.96, we need to remove the calls that put _ into the builtins. git-svn-id: http://code.djangoproject.com/svn/django/trunk@4485 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-02-10Fixed #3463 -- EmptyQuerySet's iterator() now returns a generator. Thanks, ↵Adrian Holovaty
Gary Wilson git-svn-id: http://code.djangoproject.com/svn/django/trunk@4475 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-02-10Fixed #2348 -- Improved error reporting when query filter arguments areMalcolm Tredinnick
misspelt. Variation on a patch from Karen Tracey. git-svn-id: http://code.djangoproject.com/svn/django/trunk@4470 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-02-07Fixes #3447, Refs #2160 -- Reverting change [4459] because it breaks admin. ↵Russell Keith-Magee
Apologies for the inconvenience, guys. git-svn-id: http://code.djangoproject.com/svn/django/trunk@4463 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-02-04Fixed #2160 -- Modified object save logic to check for ``pk is None``, ↵Russell Keith-Magee
rather than ``bool(pk) == False``. This allows primary keys to take a value of 0. Thanks for the report, fgutierrez@aureal.com.pe. git-svn-id: http://code.djangoproject.com/svn/django/trunk@4459 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-01-29Fixed #3389 -- Many-to-many sets can now be assigned with primary key valuesAdrian Holovaty
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4448 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-01-28newforms: Changed database Field formfield() methods to pass help_text to ↵Adrian Holovaty
the formfield help_text git-svn-id: http://code.djangoproject.com/svn/django/trunk@4442 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-01-25Fixed #3098 -- Added db_table parameter to m2m fields, allowing the ↵Russell Keith-Magee
specification of a custom table name for the m2m table. Thanks, Wolfram Kriesing. git-svn-id: http://code.djangoproject.com/svn/django/trunk@4429 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-01-25Fixed #3215, #3081, #2749 -- Fixed problem with mistaken deletion of objects ↵Russell Keith-Magee
when a GenericRelation is involved. Thanks to Thomas Steinacher for helping to narrow down the problem (#3215), and Alex Dedul (#3081) for the starting point of a working patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@4428 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-01-23Fixed #3283 -- Added support for empty QuerySets via none() method. Thanks ↵Adrian Holovaty
for the patch, medhat git-svn-id: http://code.djangoproject.com/svn/django/trunk@4394 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-01-22Changed database Field formfield() methods to take arbitrary kwargs, which ↵Adrian Holovaty
are passed directly into the given Field constructor git-svn-id: http://code.djangoproject.com/svn/django/trunk@4389 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-01-10Fixed #3267 -- newforms: Changed database TextField to render as Textarea in ↵Adrian Holovaty
form_for_model() forms. Thanks for the patch, Philipp Keller git-svn-id: http://code.djangoproject.com/svn/django/trunk@4305 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-01-08Fixed #1477: URLFields now accept a maxlength parameter. Thanks, Matt Croydon.Jacob Kaplan-Moss
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4295 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-01-04Fixed #2473 -- Added special case for '__in=[]' (empty set) queries, because ↵Russell Keith-Magee
'WHERE attr IN ()' is invalid SQL on many backends. Thanks, Gary Wilson. git-svn-id: http://code.djangoproject.com/svn/django/trunk@4283 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-12-30newforms: Got form_for_instance() to select initial ManyToManyField values ↵Adrian Holovaty
properly git-svn-id: http://code.djangoproject.com/svn/django/trunk@4261 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-12-28Added value_from_object method to db Field classAdrian Holovaty
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4252 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-12-28Negligible style fix to db/models/fields/__init__.pyAdrian Holovaty
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4251 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-12-28newforms: Implemented form_for_instance(). The resulting Form class does not ↵Adrian Holovaty
yet have a method that saves the changes git-svn-id: http://code.djangoproject.com/svn/django/trunk@4250 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-12-27newforms: Implemented formfield() for database OneToOneField class. Not sure ↵Adrian Holovaty
about this one, but one-to-one fields are eventually going to be refactored so it's not a big deal if it doesn't work git-svn-id: http://code.djangoproject.com/svn/django/trunk@4248 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-12-27newforms: Implemented formfield() for database ForeignKey class and added ↵Adrian Holovaty
unit tests git-svn-id: http://code.djangoproject.com/svn/django/trunk@4247 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-12-27newforms: Implemented formfield() for database ManyToManyField class and ↵Adrian Holovaty
added unit tests git-svn-id: http://code.djangoproject.com/svn/django/trunk@4246 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-12-20Refactored workhorse methods on m2m descriptors. Modified _add to check for ↵Russell Keith-Magee
the type of incoming objects (to match existing _remove implementation), and modified _remove to use a single query rather than 1 per object (to match existing _add implementation). git-svn-id: http://code.djangoproject.com/svn/django/trunk@4233 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-12-20Fixed problem with assiging an empty list to m2m related descriptors, ↵Russell Keith-Magee
introduced in [4231]. git-svn-id: http://code.djangoproject.com/svn/django/trunk@4232 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-12-20Fixed #3142 -- Optimized the assignment of m2m and m2o relation sets. ↵Russell Keith-Magee
Thanks, (and well spotted!) mitakummaa@gmail.com. git-svn-id: http://code.djangoproject.com/svn/django/trunk@4231 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-12-15newforms: Changed form_for_model() to ignore a field if its formfield() ↵Adrian Holovaty
returns None, and changed AutoField.formfield() to return None git-svn-id: http://code.djangoproject.com/svn/django/trunk@4214 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-12-15Implemented formfield() for a bunch of database Field classesAdrian Holovaty
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4211 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-12-15Moved newforms import out of Field.formfield()Adrian Holovaty
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4210 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-12-15Copied django.forms to django.oldforms and changed all code to reference ↵Adrian Holovaty
django.oldforms instead of django.forms. Updated docs/forms.txt to add 'Forwards-compatibility' section that says you should not be using django.oldforms for any new projects. git-svn-id: http://code.djangoproject.com/svn/django/trunk@4208 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-12-15newforms: Added initial implementation of form_for_model and form_for_fieldsAdrian Holovaty
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4205 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-11-26Fixes #2993, Refs #2918 -- Reverted [3960]; [3960] fixed a potential data ↵Russell Keith-Magee
validation problem for SQLite, but broke usage of LazyDate. The proper fix is to complete the model validators to catch _all_ invalid inputs. git-svn-id: http://code.djangoproject.com/svn/django/trunk@4105 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-11-07Fixed #2923: FileFields can now be modified on windows. Thanks, radek.Jacob Kaplan-Moss
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4036 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-11-06Fixed #1021: unique_together should now get validated correctly. Thanks, ↵Jacob Kaplan-Moss
wam@cisco.com git-svn-id: http://code.djangoproject.com/svn/django/trunk@4028 bcc190cf-cafb-0310-a4f2-bffc1f526a37