Wednesday, February 22, 2017

Re: Issues saving hex format data to binaryfield

The database is pre-existing and I'm creating a Django web interface for it. This object holds the 8-digit hex output of the unique mfr identifier of the MiFare rfids. There are remote terminals that interact with database through psycopg2 and have no issue with that field. 

I could change the format in the database and recode those devices but I'd rather just write the correct format to the database than go through the trouble of changing multiple aspects of the system. I'm approaching on that threshold of time spent trying to find this solution to time it would take to update the entire system but I would much rather prefer to know how to write the binaryfield in general anyways. 

On Wednesday, February 22, 2017 at 2:10:33 PM UTC-5, Shawn Milochik wrote:
Why not base64 encode it and just store it in a charfield? There doesn't seem to be any compelling reason to store it in binary.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/5d7b7d99-5416-4c9a-947a-10acd5fb37d0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment