Sunday, April 1, 2012

form.Forms + POST + forms.ChoiceField

Full Disclosure: I've been using Python for 5-6 months. Django for maybe 3

I have this: https://gist.github.com/a934fe08643e0c3ee017

In an effort to teach myself, I'm simply building a Django app. For teaching purposes only. It's an aggregator of favorites across multiple sites. Right now, I'm simply dealing with saved items from Reddit. 

The problem I'm having is the drop-down selector POST'ing and creating a the new URL. 

http://imgur.com/a/FL32I << Screen shots

1) root or /feeds/
2) Select Reddit from drop-down
3) Displays Reddit items only /feeds/Reddit/
4) Select 'Python' from drop-down, displays items from r/Python with URL /feeds/Reddit/Python

This works (manually entering URL's), the drop down does not. 

I currently get "Error 1" from the gist. 

On views.py, if I uncomment lines 16 - 19, and comment the lines 21 - 23, I get a different error: "Error2" from the gist.  What I don't understand regarding the 2nd error, is that it is in fact returning: source: u'Reddit' and that exists in the Model, so it makes me think it's expecting something other than u'Reddit'.  

I'm at a loss, so this is me asking for help.  Sorry for the long post and crazy amounts of information. 

Any help is GREATLY APPRECIATED! 

Thanks! 

POST

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/zXNmsoqAfdMJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment