How do I call django objects from a query for example
-- licenses = Licenses.objects.all() how I get my licenses,
then im trying to loop through licenses for every object from licenses that exist in a post save something to vc.
if insert == 'yes':
insert_data = request.POST.copy()
license_tag=''
for lis in licenses:
license_tag += insert_data[lis('Licenses')] + ','
the data returns like
I get the error
'Licenses' object is not callable
I've tried
insert_data[lis('Licenses')]
insert_data[lis['Licenses']]
insert_data[lis.Licenses]
any ideas?
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/09cf61fb-584f-4a8f-b932-09d084f0fbe8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment