How to generate HASH for Django model

后端 未结 2 1956
萌比男神i
萌比男神i 2021-01-04 20:59

I am trying to generate unique HASH values for my Django models of 10 digit i have tried these methods but i am getting this error

return Database.Cursor.ex         


        
2条回答
  •  抹茶落季
    2021-01-04 21:26

    _createHash() is called when you define the model, so you have the same default every time you create a new object.

    You can look at creating the hash in the save() method of the model, that's probably the easiest.

提交回复
热议问题