Hi all,
Regarding ticket #7220 <https://code.djangoproject.com/ticket/7220>, this
is bugging me at the moment. I share a database with a non-django app, and
need to insert test data, and having to set last_login to something is
annoying.
I understand @SmileyChris' point that there are no migrations (yet) in
core, so this is a bit difficult to fix. However I have a proposal:
I tried to fix this myself by overriding last_login in our custom user
class, and got this error:
FieldError: Local field 'last_login' in class 'IschoolUser' clashes
with field of similar name from base class 'AbstractUser'
I propose that we allow overriding fields, with a safety mechanism:
it's required to add an "override=True" attribute to the field. Users who
want to change an existing field must add this attribute to the new
field in their subclass, and manage any migrations or database
changes themselves. That removes the responsibility from Django to manage
it, which currently it can't.
What do you say? If this sounds like a good idea I can work up a patch.
That would enable a sensible workaround for ticket #7220 (override the
field and add south to your project) which isn't currently possible.
Cheers, Chris.
--
Aptivate | http://www.aptivate.org | Phone: +44 1223 967 838
Future Business, Cam City FC, Milton Rd, Cambridge, CB4 1UY, UK
Aptivate is a not-for-profit company registered in England and Wales
with company number 04980791.
--
You received this message because you are subscribed to the Google Groups "Django
developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-developers?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.