Hi.
Why don't you use save() method in model definition? See
http://docs.djangoproject.com/en/1.2/ref/contrib/admin/#modeladmin-methods
Maybe this will help you.
Cheers.

On 22 Sie, 14:27, gondor <condor.c...@gmail.com> wrote:
> i'm trying to override the save function so I can add set some values
> that were hidden before saving.  The problem is it doesn't seem to be
> using the save_model?  Does anyone know how this is done
>
> models.py
>
> class Contact(models.Model):
>   user = model.ForeignKey(User, editable=False)
>   notes = TextField('Notes', blank=True)
>
> admin.py
>
> class ContactAdmin(admin.ModelAdmin)
>   def save_model(self, request, obj, form, change):
>     obj.user = request.user
>     obj.save()
>
> Does anyone know how to do this or an alternative?
>
> thanx

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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