Wednesday, June 27, 2018

Re: better way to create a dictionary in Django model?


You might find it helpful to look at the Wagtail CMS (wagtail.io).  It may not solve your problem, but Wagtail stores page-layout information in JSON format in a database column.  The JSON can be revised without modifying the database schema.

On Wednesday, June 27, 2018 at 8:18:09 AM UTC-4, prateek gupta wrote:
Hi All,

I am using Django 2.0.6 with Python 3.6 and MySql and created a model which maps the db tables to django.
In my database, I have a column 'config' of type json.
This column stores the data in a dictionary format like below- 
{"user_id": "a...@example.com", "password": "xyz"}
I need to make it editable via the Django like below screen shot-


I need your suggestion - what is the best way to achieve this?
I found a useful link for this purpose -how-to-store-a-dictionary-on-a-django-model but want to take your valuable guidance before proceeding so that I can implement with best practices.

--
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/95fcc428-ce8b-4de2-82f5-ff081f7099a0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment