Satchmo user profile extension

I am trying to expand the main user registration form and the profile included in the satchmo store, but I have problems with this.

This is what I did:

Create a new "extendedprofile" application

Wrote model.py, which extends the satchmo_store.contact.models class and adds custom name fields.

wrote admin.py who unregistered the Contact class and registered my newapp, but that still shows me the default user profile form.

Can someone show me the correct way to do this?

+5
source share
2 answers

, , , . , :

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)

, .

+3

model.py, satchmo_store.contact.models .

admin.py, newapp .

django registration; satchmo User ( 0.9.2). .

, , , :

  • , Contact ( )
  • , ( satchmo_store.contact.views, Contact)
  • urlpatterns satchmo_store.contact,
  • satchmo_store.contact.forms.ExtendedContactInfoForm .
  • contact/view_profile.html, .

Contact, , admin.site.unregister(Contact) .

+1

All Articles