gondor
unread,Aug 22, 2010, 8:27:54 AM8/22/10Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Django users
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