hi thanks for your reply.

may  i know if the code you wrote exists in urls.py?
or can i seperate them as per normal? For example:

# models.py
class MyFormClass(ModelForm):
  class Meta:
  model = MyModelClass

#urls.py
urlpatterns = = patterns('',
    ‘django.views.generic.create_update.update_object’, dict
(form_class=MyFormClass)
)


Or, how do i create a customized wrapper for the genric view in my
views.py?


Thanks!

On Jul 27, 12:15 pm, Vasil Vangelovski <vvangelov...@gmail.com> wrote:
> First you create a ModelForm:
>
> from django.forms import ModelForm
> from myproject.myapp.models import MyModelClass
>
> class MyFormClass(ModelForm):
> class Meta:
> model = MyModelClass
>
> there you have your form_class that you need to pass to the view you want:
>
> ‘django.views.generic.create_update.update_object’,
> dict(form_class=MyFormClass)
>
> see:
>
> http://docs.djangoproject.com/en/dev/topics/forms/modelforms/#topics-...
>
> > Hi all,
> > I am wondering how can i use form_class with generic views?
>
> > FOr example, according to the online 
> > doc,http://docs.djangoproject.com/en/dev/ref/generic-views/
> > we can use form_class as a required argument for create_object ,
> > update_object, delete_object
>
> > But the online doc stopped short on how to use the form_class.
>
> > Is there anyone woh has a simple example on how to use form_class as a
> > required argument for generic views?
>
> > Thanks alot!
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to