On Tue, 2009-01-27 at 19:36 -0800, vierda wrote: > Dear all, > > Today I'm learning to use generic views for create and update objects. > It required form_class or model for the argument. My model is User > from django.contrib.auth.models.User and my form as per below : > > from django.contrib.auth.models import User > from django.forms import ModelForm > > class RegistrationForm(ModelForm): > class Meta: > model = User > fields = ('username', 'email', 'password') > > > class UserProfileForm(ModelForm): > class Meta : > model = User > fields = ('email',) > > I call the generic views in urls.py as per below : > > from django.conf.urls.defaults import * > > urlpatterns = patterns('django.views.generic.create_update', > (r'^register/ > $','create_object'{'form_class':'fintoo.apps.authorization.forms.RegistrationForm'}), > (r'^update/ > $','update_object'{'form_class':'fintoo.apps.authorization.forms.UserProfileForm'}), > ) >
If that's a cut-and-paste, you have a couple of typos. There should be a comma between the view name and the extra dictionary. > but it always raise error 'str' object has no attribute '_meta' Django also gives you a full traceback that tells you (and us) where the error occurs. That's important information. If you're viewing the error through the debug page in a web browser, switch to the cut-and-paste view before pasting the traceback. It will be much more readable. Regards, Malcolm --~--~---------~--~----~------------~-------~--~----~ 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 django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---