I need to pass a model to Form class as an attribute, I want to write
a generic view. How to do it?

class Frm(forms.ModelForm):
    def __init__(self,model,instance):
        self.model = model
        forms.ModelForm.__init__(self,instance=instance)
    class Meta:
        model = model # <- how to get an attribute here?

form = Frm(instance=obj, model=model)

I.e. how can I pass an attribute to a class declared inside another
class? I know this is Python not Django question but hopefully
somebody can help me.

Thanks
Radim
--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to