Also, it looks like the request.method is always 'GET', not 'POST', which 
means the form is never saved.  How is this happening?

On Monday, August 24, 2015 at 12:56:39 PM UTC-7, Hugo Kitano wrote:
>
> More specifically, what does the action="/stats/" field do and require?
>
> On Monday, August 24, 2015 at 12:41:16 PM UTC-7, Hugo Kitano wrote:
>>
>> I'm actually now pretty certain that my html file is what's causing it to 
>> not work
>>
>>
>>
>> On Monday, August 24, 2015 at 11:34:41 AM UTC-7, Hugo Kitano wrote:
>>>
>>> It always redirects to the stats page, though the model instance isn't 
>>> saved.
>>> I suspect it has to do with the .save() function, but I can't tell why, 
>>> since I even create the modelform in the views.py file.
>>>
>>>
>>>
>>>
>>> Thanks,
>>>
>>> Hugo
>>>
>>> On Saturday, August 22, 2015 at 3:19:07 AM UTC-7, James Schneider wrote:
>>>>
>>>> On Aug 22, 2015 3:10 AM, "James Schneider" <jrschn...@gmail.com> wrote:
>>>> >
>>>> > >>>> Hi, I'm a beginner using Django, and I'm having trouble using 
>>>> model forms to create instances of my model.
>>>> > >>>> When a user submits a form, the database saves nothing.  Here's 
>>>> my code for the view
>>>> > >>>>  
>>>> >
>>>> > So what exactly does happen? Based on the code you provided, you 
>>>> would either end up on the same page with a blank form (in the event of 
>>>> errors), or you would be redirected back to another page.
>>>> >
>>>>
>>>> Sorry, it's late, it probably redirects to the same page, assuming that 
>>>> this view serves the /stats/ URL. Also, the spacing for your code blocks 
>>>> didn't come through so it's hard to tell whether or not you are handling 
>>>> things correctly, or at least on my phone it doesn't.
>>>>
>>>> -James
>>>>
>>>

-- 
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/ac986da4-2700-4297-a041-b03462e46aad%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to