Amazing!
Thank you so much.
Kurczak
On 2 Paź, 20:24, Michael <[EMAIL PROTECTED]> wrote:
> > Thank you for your input.
> > I'd rather use forms and clean_<name> method, but I need to get
> > object's pk (it object exists in db),
> > is there any proper way to get it?
> > I know I can override form's __init__ and pass the model, but I can't
> > figure out which method creates the form and if I can pass model from
> > there.
> > Thanks,
> > Kurczak
>
> You can actually get to the instance of an object from the modelform's clean
> methods through self.instance without hacking init. So with that you can
> check for self.instance.pk and see what it is. I hope that helps, Mn
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---