Commit Graph

154 Commits

Author SHA1 Message Date
Adrian Holovaty 71ce11f617 newforms: Implemented form_for_instance(). The resulting Form class does not 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-28 01:16:29 +00:00
Adrian Holovaty 016d75cc7f newforms: Implemented formfield() for database OneToOneField class. Not sure 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-27 05:27:47 +00:00
Adrian Holovaty 6a75c8a52e newforms: Implemented formfield() for database ForeignKey class and added unit tests
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4247 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-12-27 05:23:21 +00:00
Adrian Holovaty d853278253 newforms: Implemented formfield() for database ManyToManyField class and added unit tests
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4246 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-12-27 05:15:22 +00:00
Adrian Holovaty 252606c711 Fixed #3115 -- Changed postgresql backend to convert all Unicode strings to bytestrings according to DEFAULT_CHARSET. This is necessary because psycopg1 does not apply database quoting to Unicode strings
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4244 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-12-27 05:14:02 +00:00
Russell Keith-Magee 64a2718f6c Refactored workhorse methods on m2m descriptors. Modified _add to check for 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-20 14:06:27 +00:00
Russell Keith-Magee e859f108f1 Fixed problem with assiging an empty list to m2m related descriptors, introduced in [4231].
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4232 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-12-20 13:57:17 +00:00
Russell Keith-Magee 2d6095ea5e Fixed #3142 -- Optimized the assignment of m2m and m2o relation sets. 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-20 09:59:03 +00:00
Adrian Holovaty a23e67bf4b Improved error message in postgresql backend
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4215 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-12-15 22:32:16 +00:00
Adrian Holovaty 5cb093b033 newforms: Changed form_for_model() to ignore a field if its formfield() 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-15 21:22:13 +00:00
Adrian Holovaty 35f7e33b4a Implemented formfield() for a bunch of database Field classes
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4211 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-12-15 18:32:42 +00:00
Adrian Holovaty 1c4ed6126b Moved newforms import out of Field.formfield()
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4210 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-12-15 18:15:55 +00:00
Adrian Holovaty 706fcec164 Copied django.forms to django.oldforms and changed all code to reference 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-15 18:00:50 +00:00
Adrian Holovaty 6001974e45 newforms: Added initial implementation of form_for_model and form_for_fields
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4205 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-12-15 05:46:11 +00:00
Russell Keith-Magee 95d19384c0 Fixes #2993, Refs #2918 -- Reverted [3960]; [3960] fixed a potential data 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-26 02:38:04 +00:00
Adrian Holovaty ab6fd7328f Fixed typo in 'incorrect backend' database error message
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4067 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-11-13 05:02:45 +00:00
Adrian Holovaty a84404c190 Formatting fixes from the past round of checkins
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4052 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-11-07 19:07:27 +00:00
Jacob Kaplan-Moss fef89a01c5 Fixed #2866: Added DATABASE_OPTIONS setting which gets passed as extra kwargs to the backend's connect method. Thanks, ymasuda.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4048 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-11-07 05:17:38 +00:00
Jacob Kaplan-Moss 86143f7599 Fixed #2913: CursorDebugWrapper no longer double-tuple-izes parameters. Thanks, artdent@freeshell.org
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4045 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-11-07 05:00:19 +00:00
Jacob Kaplan-Moss a4d86a7fb0 Fixed #2923: FileFields can now be modified on windows. Thanks, radek.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4036 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-11-07 02:25:49 +00:00
Jacob Kaplan-Moss b6a1789330 Fixed #1021: unique_together should now get validated correctly. Thanks, wam@cisco.com
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4028 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-11-06 22:51:00 +00:00
Russell Keith-Magee 77bdaa76df Removed fossilized remnant of pre-magic removal m2m code. Thanks for the report, Baurzhan Ismagulov.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3963 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-11-03 02:14:46 +00:00
Russell Keith-Magee 7f71ae1b8d Fixes #2918 -- Clarified the db_prep_save logic for DateField and DateTimeField to prevent accidental conversion of non-datetime objects into strings, because SQLite doesn't appear to check for valid date format in a string used on an UPDATE of a datetime column.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3960 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-11-02 14:24:31 +00:00
Adrian Holovaty 41d11a685f Fixed #2968 -- Changed arguments to __import__ to use empty dictionary instead of empty string, for stricter compliance with Python library reference. Thanks for the patch, Yasushi Masuda
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3951 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-10-30 20:50:27 +00:00
Russell Keith-Magee 5ec32a1c2d Fixes #2965 -- Added i18n for joiner used in validation error messages. Thanks, ramiro.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3949 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-10-30 13:54:28 +00:00
Adrian Holovaty 185a5f6614 Fixed #2898 -- Added missing ngettext import to django.db.models.fields.related
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3926 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-10-24 16:49:19 +00:00
Russell Keith-Magee fbbbf8b9a1 Fixes #2737 -- Added code to allow None as a query value for __exact queries, raising an error otherwise. __exact=None is interpreted as the SQL 'value = NULL'. This fixes some minor problems with queries on unsaved objects with related object sets, and stops queries with a value of None being outright ignored (even if they reference an unknown attribute).
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3902 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-10-14 02:48:05 +00:00
Malcolm Tredinnick a834f213bd Fixed omission in [3872].
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3873 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-09-27 02:47:19 +00:00
Malcolm Tredinnick 6068f3e4cb Reintroduced the changes from [3855] with more flexible handling of version
strings. Refs #2188, #2827.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@3872 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-09-27 02:42:31 +00:00
Adrian Holovaty a07aafe007 Removed one more legacy bit from [3855]. Refs #2827.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3868 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-09-26 16:14:06 +00:00
Adrian Holovaty 38d80f8894 Fixed #2827 -- Reverted [3855]
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3867 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-09-26 16:11:13 +00:00
Russell Keith-Magee cb829267b8 Corrected line that was somehow merged out prior to committing changeset [3858].
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3859 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-09-26 12:55:44 +00:00
Russell Keith-Magee 0d19b2eaae Refs #2243 -- Fixed manipulator handling of raw_id_admin m2m edit_inline fields.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3858 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-09-26 12:53:15 +00:00
Malcolm Tredinnick ae0bea8d50 Fixed a problem with editing inline objects.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3857 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-09-26 12:49:49 +00:00
Malcolm Tredinnick 4e76727fec Fixed #2188 -- Raise an error when using long CharFields in combination with
older MySQL versions. Thanks, Fraser Nevett <mail@nevett.org> .


git-svn-id: http://code.djangoproject.com/svn/django/trunk@3855 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-09-26 10:46:34 +00:00
Malcolm Tredinnick 5371ee1743 Fixed #2194 -- Tweaked error message for unique_together validator to display
all verbose field names. Patch from dackze+django@gmail.com.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@3854 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-09-26 10:19:40 +00:00
Malcolm Tredinnick a27f12f388 Fixed #2265 -- Fixed problem with using iterators for "choices" attribute.
Thanks, Alex Dedul.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@3851 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-09-26 06:33:32 +00:00
Malcolm Tredinnick 789f30258a Fixed #2817 -- Fixed formatting problem in admin help string. Thanks,
Maximillian Dornseif.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@3848 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-09-26 03:46:33 +00:00
Russell Keith-Magee 83501405c2 Added '1' and '0' as allowed text input for BooleanFields. This was required to acommodate XML serializers when using MySQL.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3844 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-09-26 00:36:04 +00:00
Russell Keith-Magee 205cb040d4 Removed some stray debug that was accidentally left in r3830.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3831 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-09-25 14:17:51 +00:00
Russell Keith-Magee 175337605d Fixes #1816, #2243 -- Removed a stale remnant of pre-magic removal code in manipulators that modify m2m object that are edited inline. Thanks to dolemite@wuli.nu and coconutstudio@yahoo.com for the original reports, Tyson Tate for a clean test case, and Jay Parlar for helping out with a solution.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3830 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-09-25 14:06:14 +00:00
Russell Keith-Magee 0c41869e6c Made ``pk`` a generic expansion for the primary key, rather than just an expansion for __id__exact.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3826 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-09-25 13:49:01 +00:00
Malcolm Tredinnick b4e5a96ccc Fixed #2772 -- Made SQLite support work correctly with Python 2.5 standard
module (as well as pysqlite2 for earlier Python versions). Patch from
ymasuda[at]ethercube.com.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@3818 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-09-25 01:53:34 +00:00
Malcolm Tredinnick 084d618519 Fixed #2749 -- Get the correct m2m_reverse_name() in generic relations. Thanks
to Jay Parlar and Chris Long for some good debugging here.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@3787 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-09-22 03:26:13 +00:00
Malcolm Tredinnick 4f63ce5b4a Fixed #2662 -- Changed dictfetchmany and dictfetchall to return iterators,
rather than a list, in order to save memory. Patch from Simon Willison.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@3783 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-09-22 02:36:50 +00:00
Adrian Holovaty ecf6a35112 Fixed #2700 -- Improved introspection for MySQL. Thanks for the patch, serbaut@gmail.com
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3750 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-09-11 18:41:05 +00:00
Adrian Holovaty 521c6a2652 Fixed #2699 -- Added quote_name() call to MySQL introspection.py. Thanks for the patch, serbaut@gmail.com
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3746 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-09-11 18:31:46 +00:00
Russell Keith-Magee 5a9839c547 Fixes #2653 -- Modified related field utility methods to return None as the 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-07 13:29:56 +00:00
Jacob Kaplan-Moss 6152b325aa Made psycopg2 backend actually support dictfetch* methods.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3727 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-09-05 16:12:36 +00:00
Russell Keith-Magee 6f87b17a0d Fixes #2658 -- Modified SQLite cursor close() method for in-memory databases, making the lifespan of an in-memory database equal to the life of the process, rather than the life of the cursor. Thanks, Ned Batchelder.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3723 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-09-05 13:32:08 +00:00