Hi,
I'm trying to use admin save_model method. I have a model called 'Project' and in admin.py 'Project' has a method save_model. I added a project to my admin panel then I try to save again without changing. But the parameter 'change' of save_model method is always 'true'. Why? Can you help me about this bug? Here is my save_model function's beginning.
def save_model(self, request, obj, form,change):
super(ProjectAdmin, self).save_model(request, obj, form, change)
if not change:
std_pckg = Package(project=obj, type=0, start_date=obj.create_date.date())
std_pckg.save()
..........
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/xpyMNrBPsHIJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment