I think this can help:
http://code.djangoproject.com/wiki/CookBookManipulatorWithPostpopulatedFields

also look at Django Forms documentation

On 5/30/06, Marcin Kaszynski <[EMAIL PROTECTED]> wrote:
>
>
> Hello,
>
> is there a way to make update_object preserve values of some fields
> without putting them in the update form?
>
> I have a model with a 'creator' field:
>
> class Company(models.Model):
>    creator = models.ForeignKey(auth.User, ....)
>    [...]
>
> I want to set this field automatically when a Company gets created (I
> got this part working using the threadlocals trick), but the value
> should not change after that.
>
> I tried several ways to make this work (including a custom save()
> method in the model and a custom CreatorField with a pre_save method
> that set the value if add=True) and so far had no luck: update_object
> simply takes data from POST and if something is not set there then the
> field will be set to None.
>
> Is there some way around it without patching update_object, or do I
> have to write custom views for such models?
>
> -mk
>
> PS. My first post on this group.  Welcome everyone!
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to