Tuesday, July 1, 2014

Re: how to saven models dynamically inputted by user in form



On Tuesday, July 1, 2014 5:58:59 PM UTC+5:30, Lachlan Musicman wrote:
Hi Aashita,

There's a couple of things happening here. I'm no expert and this is a
rushed end of evening email.

For getting the obj.save() to work, here:

            cd = form.cleaned_data
            newPI = PurchasedItem()
            newPI.name = cd['quote_item']
            newPI.qty = cd['quote_qty']
            newPI.save()

You now have a new PurchaseItem with a name and a qty.
Now error is coming ,
EOL while scanning string literal (views.py, line 31)
 


--
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/72276496-1d32-4c8e-a9ea-dc809fe9d454%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment