summaryrefslogtreecommitdiff
path: root/tests/modeltests
AgeCommit message (Collapse)Author
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-28Fixed #3263 -- newforms form_for_model() and form_for_instance() now handle ↵Adrian Holovaty
foreign-key and many-to-many data properly. Thanks for the patch, Jeff Hilyard git-svn-id: http://code.djangoproject.com/svn/django/trunk@4439 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-01-27Fixed a flaw in the serializers that prevented OneToOneFields being ↵Russell Keith-Magee
serialized as JSON objects. git-svn-id: http://code.djangoproject.com/svn/django/trunk@4433 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-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-09Fixed #3232 -- newforms: Added save_instance(), which saves a given bound ↵Adrian Holovaty
form's clean_data into a given model instance with the same field names git-svn-id: http://code.djangoproject.com/svn/django/trunk@4300 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-01-09newforms: Changed model auto-Form generation so that create() and ↵Adrian Holovaty
apply_changes() are now both called save() -- for the purposes of simplicity git-svn-id: http://code.djangoproject.com/svn/django/trunk@4299 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-01-08Fixed #3252 -- Fixed bugs in model_forms unit tests, related to recent ↵Adrian Holovaty
newforms clean_data change. Thanks for the patch, mir@noris.de git-svn-id: http://code.djangoproject.com/svn/django/trunk@4294 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
2007-01-03Fixed #2756 -- Modified the get_object_or_404/get_list_or_404 shortcuts to ↵Russell Keith-Magee
accept model managers as well as model classes. Thanks, Gary Wilson. git-svn-id: http://code.djangoproject.com/svn/django/trunk@4275 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-12-30Updated docstring in model_forms unit testAdrian Holovaty
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4263 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-28newforms: Implemented apply_changes() method for form_for_instance FormsAdrian Holovaty
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4253 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 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-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-19Fixed #3164 -- Added explicit ordering to basic model test, and revised ↵Russell Keith-Magee
results to suit the explicit order. Thanks to Matt Boersma for the report. git-svn-id: http://code.djangoproject.com/svn/django/trunk@4228 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-12-17newforms: Added optional 'form' parameter to form_for_modelAdrian Holovaty
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4220 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-12-15newforms: The Form classes created by form_for_model() now have a create() ↵Adrian Holovaty
method, which creates a model instance from the clean_data git-svn-id: http://code.djangoproject.com/svn/django/trunk@4216 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-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-07Fixed #2575: ObjectPaginator now accepts a "orphans" option to prevent pages ↵Jacob Kaplan-Moss
with only a few items. Thanks, SmileyChris. git-svn-id: http://code.djangoproject.com/svn/django/trunk@4041 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-09-26Fixed #2783 -- Fixed one-to-one fields to work with any primary key data typeMalcolm Tredinnick
in the related model. Thanks, Joel Heenan. git-svn-id: http://code.djangoproject.com/svn/django/trunk@3846 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-09-25Made ``pk`` a generic expansion for the primary key, rather than just an ↵Russell Keith-Magee
expansion for __id__exact. git-svn-id: http://code.djangoproject.com/svn/django/trunk@3826 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-09-07Fixes #2653 -- Modified related field utility methods to return None as the ↵Russell Keith-Magee
related name for symmetrical m2m fields on self. Updated validators and unit tests to account for the new behavior. git-svn-id: http://code.djangoproject.com/svn/django/trunk@3734 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-09-02Refs #2333 - Added model test for the test Client. Russell Keith-Magee
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3708 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-08-31Fixed typo in docstring of get_latest model unit testAdrian Holovaty
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3683 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-08-27Refs #2333 - Modified runtests script to use new testing framework. Migrated ↵Russell Keith-Magee
existing tests to use Django testing framework. All the 'othertests' have been migrated into 'regressiontests', and converted into doctests/unittests, as appropriate. git-svn-id: http://code.djangoproject.com/svn/django/trunk@3661 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-08-11Fixed #2458 -- DB API now properly escapes backslashes, so you don't have to ↵Adrian Holovaty
double-escape them. Thanks, tom@eggdrop.ch git-svn-id: http://code.djangoproject.com/svn/django/trunk@3552 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-08-10Fixed #2512 -- Fixed SQL error when saving existing empty models.Malcolm Tredinnick
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3548 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-11Small formatting change to m2m_and_m2o model unit testAdrian Holovaty
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3321 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-01Fixes #2271 -- Added code to imply !__exact on any query argument that ↵Russell Keith-Magee
doesn't finish with a known query term. git-svn-id: http://code.djangoproject.com/svn/django/trunk@3248 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-01Fixed #2217 -- Allowed raw objects to be used in __exact and __in query ↵Russell Keith-Magee
terms. Existing use of primary keys in query terms is preserved. git-svn-id: http://code.djangoproject.com/svn/django/trunk@3246 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-29Added a JSON serializer, a few more tests, and a couple more lines of docs.Jacob Kaplan-Moss
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3237 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-28Added initial cut at serialization framework, along with some basic tests ↵Jacob Kaplan-Moss
and a stab at some docs. This is all a bit rough right now, so expect some bumps. git-svn-id: http://code.djangoproject.com/svn/django/trunk@3225 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-28Fixed #1754, #2211, #2192 -- allow date filtering comparisons to use strings asMalcolm Tredinnick
well as date objects. Fixed a couple of admin crashes as well. git-svn-id: http://code.djangoproject.com/svn/django/trunk@3223 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-27Added {{{Manager.create()}}} method to create and save an object in a single ↵Jacob Kaplan-Moss
step. git-svn-id: http://code.djangoproject.com/svn/django/trunk@3217 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-27Fixes #2216 -- Added extra tests for model validity, and cleaned up warning ↵Russell Keith-Magee
messages for existing tests. Models are now invalid if the query string required to access a field (or related object) would clash with the name of another field (or related object). Previous tests only checked the accessor names, not the query string. git-svn-id: http://code.djangoproject.com/svn/django/trunk@3215 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-20Fixed bad formatting in 'lookup' model tests from [3157]Adrian Holovaty
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3170 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-20Fixed #2195 -- Fixed spelling error in generic_relations model test. Other ↵Adrian Holovaty
errors were fixed earlier today. Thanks, Tom Tobin git-svn-id: http://code.djangoproject.com/svn/django/trunk@3160 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-20Fixed #1857 -- Fixed get_previous_by_FIELD and get_next_by_FIELD to workMalcolm Tredinnick
properly with keyword arguments. Patch from tom@jerakeen.org. git-svn-id: http://code.djangoproject.com/svn/django/trunk@3157 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-19Fixed some small typos in generic_relations model testsAdrian Holovaty
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3156 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-19Fixed #1683 -- Permit initialising models using settable properties as well asMalcolm Tredinnick
field names. git-svn-id: http://code.djangoproject.com/svn/django/trunk@3145 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-16Added generic foreign key support to Django. Much thanks to Ian Holsman and Jacob Kaplan-Moss
Luke Plant -- most of this code is theirs. Documentation is to follow; for now see the example/unit test. Fixes #529. git-svn-id: http://code.djangoproject.com/svn/django/trunk@3134 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-15Fixed #2164 -- Create correct SQL when pk column name is not the same as theMalcolm Tredinnick
attribute name. Thanks, Russell Cloran. git-svn-id: http://code.djangoproject.com/svn/django/trunk@3130 bcc190cf-cafb-0310-a4f2-bffc1f526a37