When saving in admin it will call model save() twice.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
class MyModel(models):
  myfield = modesl.CharField(max_length=100)

  def save(self, *args, **kwargs)
      super(MyModel, self).save(*args, **wargs)
      print 'save!!'


When I save this in admin, it will call model save() twice

Django version 1.2.3, using settings 'admin.development'
Development server is running at http://127.0.0.1:8080/
Quit the server with CONTROL-C.
[18/May/2011 10:08:22] "GET /admin/onixcodes/bookbatch/ HTTP/1.1" 200 38211
[18/May/2011 10:08:22] "GET /admin/jsi18n/ HTTP/1.1" 200 4256
[18/May/2011 10:08:29] "GET /admin/onixcodes/bookbatch/55/ HTTP/1.1" 200 9811
[18/May/2011 10:08:29] "GET /admin/jsi18n/ HTTP/1.1" 200 4256
save!!
save!!
[18/May/2011 10:08:33] "POST /admin/onixcodes/bookbatch/55/ HTTP/1.1" 302 0
[18/May/2011 10:08:33] "GET /admin/onixcodes/bookbatch/ HTTP/1.1" 200 38364
[18/May/2011 10:08:33] "GET /admin/jsi18n/ HTTP/1.1" 200 4256

More like this

  1. Django using admin horizontal filter in forms by crodjer 1 year, 12 months ago
  2. Advanced Search in django admin by visik7 2 years, 5 months ago
  3. Updated version of StripWhitespaceMiddleware (v1.1) by sleepycal 2 years ago
  4. datemate by catellar 1 year, 9 months ago
  5. caching parsed templates by forgems 5 years, 6 months ago

Comments

danielroseman (on May 23, 2011):

This is not a Q&A site. Please delete this and repost it on Django-users or Stackoverflow.

#

(Forgotten your password?)