views:

129

answers:

2

I'm trying to extend the basic user registration form and profile included in satchmo store, but I'm in problems with that.

This what I've done:

Create a new app "extendedprofile"

Wrote a models.py that extends the satchmo_store.contact.models class and add the custom name fields.

wrote an admin.py that unregister the Contact class and register my newapp but this still showing me the default user profile form.

Maybe some one can show me the correct way to do this?

+1  A: 

It sounds like you are doing it right, but it would help if you post your source. When I take this route, I treat the extended profile as an inline to the user model:

class UserProfileInline(admin.StackedInline):
    model = UserProfile
    fk_name = 'user'
    max_num = 1
    fieldsets = [
        ('User Information', {'fields': ['street', 'street2', 'city', 'state', 'country', 'latitude', 'longitude']}),
        ('Site Information', {'fields': ['sites']}),
        ('User Account', {'fields': ['account_balance']}),
    ]

class NewUserAdmin(admin.ModelAdmin):
    inlines = [UserProfileInline, ]

admin.site.unregister(User)
admin.site.register(User, NewUserAdmin)

Hopefully that helps you.

Luke