Tuesday, December 30, 2014

Re: Can't save input to database

On 12/30/14 11:42 AM, Ronis wrote:
Hi guys, I can't save the input from a custom form to database. I don't know what I am missing.
I'm not sure either. But the html form you posted looks a *lot* like any template you might find in a django deployment. If it were me I'd look harder at just tying that in to the "usual places" and be done with it. That will give you form validation etc nearly for free and save the next person who is looking at your code from having to figure out what you did. Patterns and idioms save a lot of thinking best used elsewhere...


- Tom

Because it's using a downloaded template from the web, I'm not using the django forms. Instead, I'm trying to simply save the input from the html form to the database. Im using the standard database when you create a django project. When I checked the admin the inputs are not saved. 

Here is my code: 

I'm a newbie programmer btw, this may be simple solution but I've spent some time and couldn't figure it out =/ 
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/ca13d351-0075-4000-902d-3f8755cb775e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment