summaryrefslogtreecommitdiff
path: root/tests/modeltests/model_forms
AgeCommit message (Collapse)Author
2008-01-17Fixed #6302. FileField no longer requires a value if one already exists. ↵Joseph Kocherhans
Thanks Brian Rosner and Øyvind Saltvik. git-svn-id: http://code.djangoproject.com/svn/django/trunk@7021 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-12-13Changed ModelForms to allow inheritance as long as their model attributes ↵Joseph Kocherhans
are the same. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6917 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-12-13Fixed #6162. ModelForm's __init__ signature now matches Form's. This is a ↵Joseph Kocherhans
backwards incompatbile change. Based largely on a patch by ubernostrum. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6915 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-12-02Fixed #6042 -- ModelForms implementation from Joseph Kocherhans. Still mightMalcolm Tredinnick
need a little tweaking as people start to use it, but this is mostly complete. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6844 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-11-29Fixed #4653 -- Improved the logic to decide when to include (and select asMalcolm Tredinnick
initial value) the blank choice for a model field with choices. Thanks to Ilya Semenov for persisting with this. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6733 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-11-13Fixed #4787, #5913 -- Updating the queryset on a `ModelChoiceField` or ↵Gary Wilson Jr
`ModelMultipleChoiceField` now updates its widget's choices. The clean methods for `ModelChoiceField` and `ModelMultipleChoiceField` were changed to only allow choices in the specified queryset (instead of allowing all choices returned by the queryset model's default manager). git-svn-id: http://code.djangoproject.com/svn/django/trunk@6670 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-11-09Corrected a couple comments in `model_forms` tests.Gary Wilson Jr
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6660 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-15Added explicit order_by filters to some model_forms tests that were failing ↵Ian Kelly
in Oracle due to returning results in the wrong order. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6250 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-14Fixed test case that failed on Oracle because it assumed an ordering for Matt Boersma
objects.all(). git-svn-id: http://code.djangoproject.com/svn/django/trunk@6246 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-08Fixed #3557 -- Made `SlugField` inherit from `CharField` so that its ↵Gary Wilson Jr
`max_length` is properly set. Removed `get_manipulator_field_objs` method since it's already provided by `CharField`. Thanks, Russell Cloran. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6065 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-05Fixed #4001 -- Added dynamic save_m2m method() to forms created with ↵Russell Keith-Magee
form_for_model and form_for_instance on save(commit=False). git-svn-id: http://code.djangoproject.com/svn/django/trunk@5804 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-05Fixed #2101 -- Renamed `maxlength` argument to `max_length` for oldforms ↵Gary Wilson Jr
`FormField`s and db model `Field`s. This is fully backwards compatible at the moment since the legacy `maxlength` argument is still supported. Using `maxlength` will, however, issue a `PendingDeprecationWarning` when used. git-svn-id: http://code.djangoproject.com/svn/django/trunk@5803 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-07-04Merged Unicode branch into trunk (r4952:5608). This should be fullyMalcolm Tredinnick
backwards compatible for all practical purposes. Fixed #2391, #2489, #2996, #3322, #3344, #3370, #3406, #3432, #3454, #3492, #3582, #3690, #3878, #3891, #3937, #4039, #4141, #4227, #4286, #4291, #4300, #4452, #4702 git-svn-id: http://code.djangoproject.com/svn/django/trunk@5609 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-05-14Changed the fix from [5231] so that the backwards-incompatibility is made moreMalcolm Tredinnick
obvious and everything still has nice names. git-svn-id: http://code.djangoproject.com/svn/django/trunk@5237 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-05-12Added docs for form_for_model and form_for_instance, and added a fields ↵Russell Keith-Magee
argument so it is easy to create forms from a subset of model fields. git-svn-id: http://code.djangoproject.com/svn/django/trunk@5202 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-04-28Fixed #3268 -- Changed default model formfields to use a select widget when theMalcolm Tredinnick
field has a choices attribute. Based on a patch from mrmachine. git-svn-id: http://code.djangoproject.com/svn/django/trunk@5119 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-04-09Fixed #3929 -- Newforms Textarea widget now always includes 'rows' and ↵Adrian Holovaty
'cols' attributes, even if you don't pass them in, for HTML correctness. Thanks, and welcome back, Luke Plant git-svn-id: http://code.djangoproject.com/svn/django/trunk@4961 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-03-23Renumbered all the doctest examples so that they are ordered correctly on ↵Jacob Kaplan-Moss
the doc pages. git-svn-id: http://code.djangoproject.com/svn/django/trunk@4796 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-21Fixed #3534 -- newforms ModelChoiceField and ModelMultipleChoiceField no ↵Adrian Holovaty
longer cache choices. Instead, they calculate choices via a fresh database query each time the widget is rendered and clean() is called git-svn-id: http://code.djangoproject.com/svn/django/trunk@4552 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-02-20Fixed #3247 -- newforms form_for_model() and form_for_instance() no longer ↵Adrian Holovaty
create form fields for database fields with editable=False. Thanks for the patch, mssnlayam@yahoo.com and Philipp Keller git-svn-id: http://code.djangoproject.com/svn/django/trunk@4548 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-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-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
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-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