On Friday 09 June 2006 18:02, Marcin Kaszynski wrote: > I just spent some time looking for a way to extend the User model in > a way that would allow me to: > > 1. add fields to the model itself, > 2. use the standard admin interface to edit them, > 3. keep changes to Django minimal and generic. > > I came up with something that actually works well and is generic > enough to extend any other model: I changed ModelBase.__new__ to call > a function that modifies attributes of the new class before it gets > created. The function is defined in project settings file, so it is > easy to have different User models in different projects without > further changes to Django code.
This is actually quite interesting. You would need to alter your patch a bit so that it works for models with 'app_label' defined -- the "model_module.__name__.split('.')[-2]" logic should exist in only one place. Other than that it seems quite good -- maybe you should create a ticket. Luke -- The probability of someone watching you is proportional to the stupidity of your action. Luke Plant || L.Plant.98 (at) cantab.net || http://lukeplant.me.uk/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~----------~----~----~----~------~----~------~--~---