1๐
โ
-
Yes, this is appropriate way.
-
You need to set value for select/choices field in the dict similar to approach 1.
For example:
COUNTRY_CHOICES = (
('IN', 'India'),
('US', 'USA'),
)
....
#model field
country = models.CharField(choices=COUNTRY_CHOICES)
# then set it in dict as
u = {}
u['country'] = 'IN'
u['profile_email'] = 'monkey'
u['company_name'] = 'tiger'
u['coc_number'] = 'some number'
u['gender'] = 'M'
...
๐คRohan
Source:stackexchange.com