Thursday, February 23, 2017

Re: Issues saving hex format data to binaryfield

On Wednesday 22 February 2017 14:47:55 Brian O'Connell wrote:

 

> def set_rfid(self,rfid_new):

> print self.rfid # print the existing object data

> try:

> self.rfid = bytearray(rfid_new)

> print self.rfid

> except Exception as ex:

> template = "An exception of type {0} occured.

> Arguments:\n{1!r}" message = template.format(type(ex).__name__,

> ex.args) print message

>

> It doesn't raise an exception but it also doesn't save it into the

> field.

 

Because this is set_rfid not save(). If you call save() after calling set_rfid, the value isn't saved?

--

Melvyn Sopacua

No comments:

Post a Comment