Re: Can't save input to database

2015-01-02 Thread Ronis
Sorry I didn't the snippets are only available for 24 hours or little more. 
They should extend that. 

So finally I got it right! Uffa! 


So basically I did one little change to the html code actually, and it 
worked. 

Here was the code:


  


  Vem aĆ­ a 99 FITNESS
  Em breve o maior aplicativo de fitness do Brasil
  
{% csrf_token %} 
  
  Quero 
ser avisado e virar vip!


I changed the action="/signup/" to action="{% url 'home'%}" and it start 
saving the input to database. 

Now my question is... because it wasn't a django code it wasn't working or 
because I was passing the wrong html page? Because actually signup is the 
page right after the form action, after the user submits the input. Do I 
always have to specify the actions form forms in django code like that? 

I tried using "/home/" instead and gave me an error. 


Anyway I'm happy finally this simple thing is done! Thanks for the help btw


On Tuesday, December 30, 2014 8:43:41 PM UTC-2, Vijay Khemlani wrote:
>
> the code sample links are broken :(
>
> On Tue, Dec 30, 2014 at 4:59 PM, Thomas Lockhart <tlockh...@gmail.com 
> > wrote:
>
>>  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...
>>
>> hth
>>
>> - 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: 
>>
>>  
>>  Views.py -> https://dpaste.de/SCBi
>>
>>  Models.py -> https://dpaste.de/3NX3
>>
>>  Admin.py -> https://dpaste.de/OWLS
>>
>>  htmlform -> https://dpaste.de/11DP
>>
>>  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...@googlegroups.com .
>> To post to this group, send email to django...@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
>>  
>> <https://groups.google.com/d/msgid/django-users/ca13d351-0075-4000-902d-3f8755cb775e%40googlegroups.com?utm_medium=email_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>>
>>  -- 
>> 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...@googlegroups.com .
>> To post to this group, send email to django...@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/54A3043E.10401%40gmail.com 
>> <https://groups.google.com/d/msgid/django-users/54A3043E.10401%40gmail.com?utm_medium=email_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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+unsubscr...@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/7f6765a4-4221-4f4b-88a1-c147ceaf8aec%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Can't save input to database

2014-12-30 Thread Ronis
Hi guys, I can't save the input from a custom form to database. I don't 
know what I am missing. 

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: 


Views.py -> https://dpaste.de/SCBi

Models.py -> https://dpaste.de/3NX3

Admin.py -> https://dpaste.de/OWLS

htmlform -> https://dpaste.de/11DP

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+unsubscr...@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.