Commit Graph

176 Commits

Author SHA1 Message Date
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
Adrian Holovaty 401b15d853 Fixed #2632 -- Made django.db.backends.util._dict_helper more efficient. Thanks for the patch, Andy Dustman
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3684 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-08-31 03:45:08 +00:00
Jacob Kaplan-Moss 0e577430e9 Made psycopg2 backend behave the same as the other backends when it comes to unicode and datetime time zone info. See [http://groups.google.com/group/django-developers/browse_frm/thread/4575a3fe0d78e2e4/d607d96f7b422620#d607d96f7b422620 the django-dev thread] for details.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3675 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-08-28 20:00:47 +00:00
Adrian Holovaty 54ea309a1d Fixed #2513 -- Changed LazyDate.__get_value__() to return date objects, not datetime objects
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3566 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-08-12 05:18:25 +00:00
Adrian Holovaty 9cd0c333d6 Fixed #2514 -- Improved psycopg2 backend to save/load Unicode strings correctly. Thanks, crankycoder@gmail.com
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3565 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-08-12 05:15:25 +00:00
Adrian Holovaty 23964a7b9a Fixed #2458 -- DB API now properly escapes backslashes, so you don't have to 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-11 05:20:31 +00:00
Malcolm Tredinnick a6a402a7db Fixed #2512 -- Fixed SQL error when saving existing empty models.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3548 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-08-10 03:55:03 +00:00
Malcolm Tredinnick ffb6ecc335 Fixed #2484 -- Handle num_in_admin and num_extra_on_change being 0 for the
admin interface. Thanks, Joseph Kocherhans.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@3546 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-08-10 03:44:11 +00:00
Adrian Holovaty 2c370e1a08 Fixed #2502 -- Fixed typo in db.models.permalink function. Thanks, adurdin@gmail.com
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3544 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-08-09 14:40:29 +00:00
Adrian Holovaty d9d44d718b Negligible style change in django.db.models.loading
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3539 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-08-08 21:17:59 +00:00
Malcolm Tredinnick d03bc77716 Refs #1796 -- Fixed a problem when creating models with relations to
themselves: more than one instance was being created.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@3510 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-08-01 21:15:41 +00:00
Adrian Holovaty ad39bb1620 Fixed #2463 -- Fixed temporarily broken many-to-many fields in admin interface due to [3507]. Thanks, Nesh
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3508 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-08-01 14:20:01 +00:00
Adrian Holovaty 97e820ab3a Fixed #2269 -- limit_choices_to now works properly with a custom ForeignKey.to_field. Thanks for reporting, mir@noris.de
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3507 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-08-01 04:05:25 +00:00
Malcolm Tredinnick 9e957485bd Seed the global app cache in a call to db.models.get_model() except when we are
constructing a model class. Refs #2348.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@3490 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-29 21:04:41 +00:00
Adrian Holovaty 1707f79b74 Added django.db.models.permalink decorator, which decorates a function that returns a viewname, viewargs and viewkwargs. The decorator returns the result of a reverse URL lookup on those parameters. Documentation is forthcoming.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3472 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-28 02:09:38 +00:00
Jacob Kaplan-Moss a55fa029f7 Fixed #1767 -- boolean fields may now have validators! Thanks, Joseph.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3467 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-28 00:13:10 +00:00
Jacob Kaplan-Moss a926046ba6 Second half of little cleanup tweaks suggested by pyflakes.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3414 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-21 20:39:17 +00:00
Jacob Kaplan-Moss 17d0bd1512 Fixed a bunch of spurious imports, typos, and other small errors turned up by a pass through PyFlakes. This covers about the first third of the errors.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3411 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-21 17:11:13 +00:00
Adrian Holovaty be2524182b Fixed #2379 -- Fixed 'search' DB lookup parameter, which was broken by [3248]. Thanks, Tim Keating
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3400 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-20 20:13:35 +00:00
Russell Keith-Magee ab4ffe5d78 Modified BooleanField's to_python method to play nice with encode()ed strings.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3372 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-19 05:50:33 +00:00
Russell Keith-Magee 59bf8dd310 Modified to_python method for BooleanField so that the to_python(str(bool_val)) round trip works. This was causing problems with the serializers.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3371 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-19 04:17:24 +00:00
Adrian Holovaty 0a2e8daaaf Fixed bug in manipulator_valid_rel_key -- it assumed the related object was related by the primary-key field, whereas this didn't work with ForeignKeys to non-primary-key fields
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3338 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-13 21:31:53 +00:00
Adrian Holovaty 33f47ae30a Added local 'qn' variable for backend.quote_name in django.db.models.query.delete_objects
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3327 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-11 04:11:40 +00:00
Adrian Holovaty cfcd4a5875 Added local 'qn' variable for backend.quote_name in django.db.models.query.fill_table_cache
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3326 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-11 03:35:17 +00:00
Adrian Holovaty 98597be786 Removed references to LOOKUP_SEPARATOR in django.db.models.query.lookup_inner
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3325 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-11 03:29:12 +00:00
Adrian Holovaty 9a0e56dbb5 Removed unnecessary 'except: raise' in django.db.models.query.lookup_inner
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3324 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-11 03:27:29 +00:00
Adrian Holovaty a17a9d1474 Added local 'qn' variable for backend.quote_name in django.db.models.query.lookup_inner
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3323 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-11 03:27:10 +00:00
Adrian Holovaty c262e19670 Renamed 'clause' variable to 'lookup_type' in django.db.models.query.lookup_inner
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3322 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-11 03:21:59 +00:00
Adrian Holovaty b4b9edc5e5 Fixed #1614 -- get_sql(), lookup_inner() and parse_lookup() no longer return a 'tables' parameter, because 'tables' was never getting assigned, anywhere.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3317 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-11 02:32:53 +00:00
Adrian Holovaty c1847294b8 Fixed #2301 -- Added list_display_links option to 'class Admin', which regulates which fields in the change list have links. Thanks, kilian
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3307 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-10 04:16:26 +00:00
Adrian Holovaty 78c91dd7df Made two small changes to comments in django.db.models.query
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3300 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-08 14:17:45 +00:00
Adrian Holovaty 49e5f5450d Fixed #2272 -- Improved SQLite database introspection. Thanks, dne@mayonnaise.net
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3285 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-07 04:06:00 +00:00
Malcolm Tredinnick c63dcdda37 Fixed another problem where we were creating a class twice via two import
paths. Self-referential relations (e.g. ForeignKey('self')) were still slipping
through the net. Refs #1796.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@3279 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-06 13:25:12 +00:00
Malcolm Tredinnick e8ef80c130 Fixed #2278 -- Fixed some argument parsing problems with the PostgreSQL
dbshell. Also added in the process name to the arg list so that the output of
'ps' looks sensible.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@3278 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-05 10:12:58 +00:00
Russell Keith-Magee 4a30eff1ff Trivial indentation fix.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3274 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-04 06:44:01 +00:00
Russell Keith-Magee 08cac47ba0 Removed stray references to (now deprecated) !__ne query type.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3254 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-01 05:41:48 +00:00
Adrian Holovaty cc26eb49a8 Removed unneeded import of ngettext from django.db.models.fields.__init__
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3253 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-01 03:51:03 +00:00
Adrian Holovaty ec23edfc7f Formatting fix for [3248]
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3250 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-01 03:21:32 +00:00
Russell Keith-Magee cd7b54aab0 Fixes #2271 -- Added code to imply !__exact on any query argument that 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-01 03:14:33 +00:00
Russell Keith-Magee c81d69354a Fixed #2217 -- Allowed raw objects to be used in __exact and __in query 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-07-01 01:14:41 +00:00
Adrian Holovaty 127a3f002d Negligible spacing change to django/db/models/loading.py
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3243 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-30 19:13:00 +00:00
Adrian Holovaty 0d14498ee0 Improved DateField.to_python() to catch invalid dates like Feb. 31
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3242 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-30 18:57:23 +00:00
Malcolm Tredinnick 414bc24e81 Fixed #1754, #2211, #2192 -- allow date filtering comparisons to use strings as
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-28 11:37:17 +00:00
Malcolm Tredinnick d6c95e93a7 Fixed #1812 -- permit apps without models (without disguising other errors).
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3221 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-28 01:53:30 +00:00
Adrian Holovaty 54e5b9aa21 Fixed #2196 -- Fixed AttributeError in method_set_order. Thanks, fonso
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3220 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-28 01:16:32 +00:00
Jacob Kaplan-Moss 48562965b9 Added {{{Manager.create()}}} method to create and save an object in a single step.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3217 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-27 20:36:25 +00:00
Malcolm Tredinnick 919df8b8c7 Fixed another path where imports were creating two instances of a model's
class. Refs #1796, #2232.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@3212 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-26 16:20:58 +00:00
Malcolm Tredinnick db366b4a78 Fixed #1796 -- implemented more robust normalisation for module filenames
before comparing them. Ivan Saglaev found a case where r3202 did not work
properly.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@3206 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-26 09:01:07 +00:00
Malcolm Tredinnick fd702fe034 Fixed #1796 -- only load a single copy of each model, even when it is
referenced via different import paths. Solves a problem with many-to-many
relations being set up incorrectly. Thanks to Curtis Thompson, Luke Plant and
Simon Willison for some excellent debugging of the problem. Refs #2232 (may
also have fixed that).


git-svn-id: http://code.djangoproject.com/svn/django/trunk@3202 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-25 14:49:34 +00:00
Russell Keith-Magee 23c24fc08b Fixes #1812 -- Added model validity checks to ensure that models.py exists, and has been successfully imported for all INSTALLED_APPS. Previous behaviour was to silently ignore empty/problem models, which resulted in the display of an admin page that doesn't display a supposedly installed model. Thanks to Ian Holsman for the original report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3201 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-25 04:24:15 +00:00
Russell Keith-Magee dc473309ef Fixed #1661 -- Added logic for string-form model references in the 'to' argument of OneToOneFields. Includes regression test.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3197 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-23 08:16:36 +00:00
Russell Keith-Magee 6cbdbffc80 Added comments to clarify the string->field name resolution logic.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3196 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-23 07:43:33 +00:00
Russell Keith-Magee 0d4b5b9b4a Fixed #1662 -- Added resolver for string-form model references for models that have already been loaded, with tests to validate both forward and backward referenced model names. Light refactoring of model loading to make regression tests behave more like normal model loading. Also clarifies the text of some validation errors.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3195 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-23 04:37:00 +00:00
Malcolm Tredinnick b70a687777 Fixed #2031 -- Don't try to remove microseconds on date objects (only datetime)
for MySQL. Refs #316.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@3183 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-21 04:13:48 +00:00
Adrian Holovaty f2aab5b913 Fixed #1964 -- Fixed bug in fetching the dimensions of an ImageField. Thanks, Armin Ronacher
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3168 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-20 04:12:27 +00:00
Malcolm Tredinnick a8a133cc6c Fixed #1857 -- Fixed get_previous_by_FIELD and get_next_by_FIELD to work
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-20 02:17:14 +00:00
Malcolm Tredinnick 1fc3b3229a Fixed #1683 -- Permit initialising models using settable properties as well as
field names.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@3145 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-19 02:34:32 +00:00
Adrian Holovaty 72307a6eee Fixed typo in docstring in db/transaction.py
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3135 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-16 19:35:57 +00:00
Jacob Kaplan-Moss bca5327b21 Added generic foreign key support to Django. Much thanks to Ian Holsman and
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-16 19:18:30 +00:00
Malcolm Tredinnick 062bae3bb3 Fixed the detection of when a custom manager is required because an 'objects'
field already exists.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@3131 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-15 14:05:33 +00:00
Malcolm Tredinnick 28e643743f Fixed #2164 -- Create correct SQL when pk column name is not the same as the
attribute name. Thanks, Russell Cloran.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@3130 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-15 11:28:28 +00:00
Malcolm Tredinnick 686c5a2f88 Fixed the empty model saving case so that it retrieves the primary key id. Also
updated the tests to test this case.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@3118 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-12 12:49:14 +00:00
Malcolm Tredinnick 7e2b888a2d Fixed #2108 -- allow saving of empty models, rather than just dropping them.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3115 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-08 15:14:06 +00:00
Adrian Holovaty 2abfd5dd58 Fixed #2109 -- Convert old-style classes to new-style classes throughout Django. Thanks, Nicola Larosa
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3113 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-08 05:00:13 +00:00
Malcolm Tredinnick 89920e058f Fixed #2108 -- do not try to save an empty model.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3104 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-08 00:13:52 +00:00
Adrian Holovaty b3a6348bc2 Added Manager.get_or_create()
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3092 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-07 00:09:29 +00:00
Jacob Kaplan-Moss 86d585a0a1 Backed out [3088] which was a premature commit with a message meant for another term window :)
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3089 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-06 12:30:26 +00:00
Jacob Kaplan-Moss 0909c97e60 BNW: Added modpython handler to autosettings
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3088 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-06 12:20:45 +00:00
Adrian Holovaty a5b7c29816 Changed all model unit tests to use __str__() instead of __repr__(). Also slightly changed related-object DoesNotExist exception message to use repr instead of str
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3075 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-04 00:23:51 +00:00
Adrian Holovaty 168429d597 Fixed #593 -- Added 'search' DB-API lookup type, which does full-text index searches in MySQL
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3073 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-03 23:28:24 +00:00
Luke Plant 9b86db9bf2 Eliminated lots of mutable default arguments (since they are bugs
waiting to happen and are memory leaks too).


git-svn-id: http://code.djangoproject.com/svn/django/trunk@3070 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-03 13:37:34 +00:00
Adrian Holovaty fa9722489b Fixed #2061 -- Fixed PostgreSQL index introspection in tables that have dropped columns. Thanks, Chris Chamberlin
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3047 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-01 16:27:41 +00:00
Adrian Holovaty 8cd32bddab Fixed bug in Model._get_next_or_previous_in_order()
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3046 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-01 15:01:22 +00:00
Adrian Holovaty 56131d0fb9 Fixed #2052 -- Fixed some threading issues for FreeBSD. Thanks, scott@clued-in.co.uk
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3045 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-01 04:57:10 +00:00
Adrian Holovaty b4be0d2487 Fixed #1454 -- Improved DB API quote_only_if_word() so that it doesn't quote 'select' parameters that are not all word characters. Thanks, dja@cdc.msbx.net
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3044 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-01 04:47:56 +00:00
Adrian Holovaty 5c5d60aa63 Fixed #411 -- CursorDebugWrapper now supports pyformat paramstyle
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3038 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-01 03:57:07 +00:00
Adrian Holovaty 45518a052b Fixed #2038 -- QuerySet._combine now combines where clause. Thanks, graham@darkcoding.net
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3019 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-05-31 14:52:33 +00:00
Luke Plant 037f8d5804 Fixed #1584 - auto_now_add fields now work when saving multiple times.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3002 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-05-29 17:08:58 +00:00
Luke Plant 60c3e55b1f Fixed bug with QuerySet.exclude() failing to do negations on Q objects, and
at the same time generalised exclude/QNot so that they work for 'external'
Q objects i.e. ones that simply have 'get_sql' defined.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@2997 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-05-26 23:41:43 +00:00