开发者

django save override question

I have a field in models that has primary_key=True. Now I want to override the save method and check if the object is created. How can I check it if I can't check self.id?开发者_Python百科


check self.pk instead of self.id

http://docs.djangoproject.com/en/dev/topics/db/queries/#the-pk-lookup-shortcut

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜