On Mon, Feb 8, 2010 at 1:10 AM, br...@instantdirectmarketing.com <bryan.wheel...@gmail.com> wrote: > I'm completely confused about why _meta.local_fields returns more > fields than the database table contains. The User model inherits from > contrib.auth.models.User. ... > I wonder if the User.add_to_class would be interpreted twice. This is > an open source project, CNPROG @ Github. I did not create it.
It's certainly possible. It depends on how the models.py file is imported. If you have two independent import paths (e.g., from forum import models and from cnprog.forum import models) the add_to_class methods could be called twice. > It does seem it would have been better to use UserProfile or to > subclass User. I'll have to refactor this now. The project has no > tests, so I might have to create those first. I did hear there was an > issue with MySQLdb and MySQL interface a while back, but I don't know > the version. The approach used by cnprog may work under certain circumstances, but it certainly isn't documented best practice. If you want to attach data to a User, UserProfile is the recommended approach. Yours, Russ Magee %-) -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.