On Thursday, October 11, 2012 12:51:07 AM UTC-7, Max wrote: > > Hi there, > this is my first post here; hope I'm posting to the right group. > I'm currently working on getting to run an 1.4-application (using a > profile model) on 1.5dev, using the the new (eagerly awaited by me) > custom user model. > I used django.contrib.gis.db.GeoManager with my former profile-Model and > so I wanted to use it with my new custom user model, too. > The following exception was thrown: > > " 'GeoManager' object has no attribute 'get_by_natural_key' " > > Hacking contrib/gis/db/models/manager.py and making GeoManager subclass > 'django.contrib.auth.models.UserManager' > > instead of 'Manager' solved it for the moment. > > Maybe this is something that hasn't been thought of yet. > > I felt like I should post this. > > Custom user objects require a custom manager that inherits from at least django.contrib.auth.models.BaseUserManager, which defines the get_by_natural_key method
Because the GeoManager defines a completely non-conflicting set of methods - you should be able to define your manager as: class MyCustomGeoUserManager(BaseUserManager, GeoManager): and then defining create_user and create_superuser per the docs -Preston -- You received this message because you are subscribed to the Google Groups "Django developers" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-developers/-/4MpY9sSn164J. To post to this group, send email to django-developers@googlegroups.com. To unsubscribe from this group, send email to django-developers+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.