Tango with Django Chapter 7 (Add_page)

2013-11-13 Thread Amimo Benja
Hey all,

Am currently practicing using this tutorial 
http://www.tangowithdjango.com/book/chapters/forms.html, but I'm constantly 
getting this error "The current URL, rango/category//add_page/, didn't 
match any of these." every time I click on the Add a 
Page link 
in the Category.html. I don't know how to solve it. Any help? Thanks.

Here are my 
1. Views.py http://pastebin.mozilla.org/3595121
2. rango/urls.py http://pastebin.mozilla.org/3595145
3. add_page.html http://pastebin.mozilla.org/3595156
4. category.html http://pastebin.mozilla.org/3595158

-- 
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/4731ffd8-f500-40a2-af7b-9587195bc092%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Tango with Django tutorial, problem getting category function to pass a variable

2013-11-13 Thread Amimo Benja
Hi Jimmy am currently facing an error that "The current URL, 
rango/category//add_page/, didn't match any of these." How did you resolve 
it?

On Sunday, October 27, 2013 12:01:06 PM UTC+3, James Yeo wrote:
>
> Hey yall
>
> Here is my current views.py:
>
> http://pastebin.mozilla.org/3361332
>
> PROBLEM:
>
> I'm trying to add an "Add Page" form to the project, per the tutorial at 
> this step:
>
>
> http://www.tangowithdjango.com/book/chapters/forms.html#creating-an-add-pages-view-template-and-url-mapping
>
> When I click on "Add Page" in a category view, I get
>
> TypeError at /rango/add_page/ 
>
> add_page() takes exactly 2 arguments (1 given)
>
>
> THOUGHTS:
>
> So far as I can tell, line 60 adds category_name_url to context_dict, 
> which means that category_name_url should go into the context that gets 
> passed on.. or else I am seriously failing to grasp this, which is the more 
> likely idea. I'm pretty sure I can't just add another argument to the 
> render_to_response, so the only other option I can think of is to put a 
> dictionary in the render_to_response, which includes category_name_url... 
> BUT I don't know what all else is in the context_dict at that point. 
>
> been fiddling with this for a couple hours now, seemingly getting nowhere. 
> I based my current code on the stuff 
> here
> .
>

-- 
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/16e7b037-bccb-4577-9458-de534b242a3b%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Tango with Django tutorial, problem getting category function to pass a variable

2013-11-13 Thread Sergiy Khohlov
check your template. or html
Many thanks,

Serge


+380 636150445
skype: skhohlov


On Wed, Nov 13, 2013 at 2:18 PM, Amimo Benja  wrote:
> Hi Jimmy am currently facing an error that "The current URL,
> rango/category//add_page/, didn't match any of these." How did you resolve
> it?
>
>
> On Sunday, October 27, 2013 12:01:06 PM UTC+3, James Yeo wrote:
>>
>> Hey yall
>>
>> Here is my current views.py:
>>
>> http://pastebin.mozilla.org/3361332
>>
>> PROBLEM:
>>
>> I'm trying to add an "Add Page" form to the project, per the tutorial at
>> this step:
>>
>>
>> http://www.tangowithdjango.com/book/chapters/forms.html#creating-an-add-pages-view-template-and-url-mapping
>>
>> When I click on "Add Page" in a category view, I get
>>
>> TypeError at /rango/add_page/
>>
>> add_page() takes exactly 2 arguments (1 given)
>>
>>
>> THOUGHTS:
>>
>> So far as I can tell, line 60 adds category_name_url to context_dict,
>> which means that category_name_url should go into the context that gets
>> passed on.. or else I am seriously failing to grasp this, which is the more
>> likely idea. I'm pretty sure I can't just add another argument to the
>> render_to_response, so the only other option I can think of is to put a
>> dictionary in the render_to_response, which includes category_name_url...
>> BUT I don't know what all else is in the context_dict at that point.
>>
>> been fiddling with this for a couple hours now, seemingly getting nowhere.
>> I based my current code on the stuff here.
>
> --
> 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/16e7b037-bccb-4577-9458-de534b242a3b%40googlegroups.com.
>
> For more options, visit https://groups.google.com/groups/opt_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/CADTRxJOq4J5WzywGeO_1SX6tSacOkWBQqpd5eram7%3Dz6O9kJ2Q%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Tango with Django tutorial, problem getting category function to pass a variable

2013-11-13 Thread Amimo Benja
More details please.


On Wed, Nov 13, 2013 at 3:22 PM, Sergiy Khohlov  wrote:

> check your template. or html
> Many thanks,
>
> Serge
>
>
> +380 636150445
> skype: skhohlov
>
>
> On Wed, Nov 13, 2013 at 2:18 PM, Amimo Benja 
> wrote:
> > Hi Jimmy am currently facing an error that "The current URL,
> > rango/category//add_page/, didn't match any of these." How did you
> resolve
> > it?
> >
> >
> > On Sunday, October 27, 2013 12:01:06 PM UTC+3, James Yeo wrote:
> >>
> >> Hey yall
> >>
> >> Here is my current views.py:
> >>
> >> http://pastebin.mozilla.org/3361332
> >>
> >> PROBLEM:
> >>
> >> I'm trying to add an "Add Page" form to the project, per the tutorial at
> >> this step:
> >>
> >>
> >>
> http://www.tangowithdjango.com/book/chapters/forms.html#creating-an-add-pages-view-template-and-url-mapping
> >>
> >> When I click on "Add Page" in a category view, I get
> >>
> >> TypeError at /rango/add_page/
> >>
> >> add_page() takes exactly 2 arguments (1 given)
> >>
> >>
> >> THOUGHTS:
> >>
> >> So far as I can tell, line 60 adds category_name_url to context_dict,
> >> which means that category_name_url should go into the context that gets
> >> passed on.. or else I am seriously failing to grasp this, which is the
> more
> >> likely idea. I'm pretty sure I can't just add another argument to the
> >> render_to_response, so the only other option I can think of is to put a
> >> dictionary in the render_to_response, which includes
> category_name_url...
> >> BUT I don't know what all else is in the context_dict at that point.
> >>
> >> been fiddling with this for a couple hours now, seemingly getting
> nowhere.
> >> I based my current code on the stuff here.
> >
> > --
> > 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/16e7b037-bccb-4577-9458-de534b242a3b%40googlegroups.com
> .
> >
> > For more options, visit https://groups.google.com/groups/opt_out.
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Django users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/django-users/27JudVqDgD8/unsubscribe.
> To unsubscribe from this group and all its topics, 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/CADTRxJOq4J5WzywGeO_1SX6tSacOkWBQqpd5eram7%3Dz6O9kJ2Q%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/groups/opt_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/CA%2B5znFG1p3WXtT1%3DMwjoBw_g%3Du15YZxP%3DArwhX8ijD6z_OVChA%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Tango with Django Chapter 7 (Add_page)

2013-11-13 Thread Sergiy Khohlov
try to change
Add a Page
 to
Add a Page
Many thanks,

Serge


+380 636150445
skype: skhohlov


On Wed, Nov 13, 2013 at 2:14 PM, Amimo Benja  wrote:
> Hey all,
>
> Am currently practicing using this tutorial
> http://www.tangowithdjango.com/book/chapters/forms.html, but I'm constantly
> getting this error "The current URL, rango/category//add_page/, didn't match
> any of these." every time I click on the Add a Page link in the
> Category.html. I don't know how to solve it. Any help? Thanks.
>
> Here are my
> 1. Views.py http://pastebin.mozilla.org/3595121
> 2. rango/urls.py http://pastebin.mozilla.org/3595145
> 3. add_page.html http://pastebin.mozilla.org/3595156
> 4. category.html http://pastebin.mozilla.org/3595158
>
> --
> 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/4731ffd8-f500-40a2-af7b-9587195bc092%40googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_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/CADTRxJP5TBZB3GzaBxh2rr3w36p35GGMu4eXAk5LB4RwJPkchQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Is this what you would expect from this Q query?

2013-11-13 Thread tim
Hi Phoebe,

I cannot reproduce this on Django's master branch. What version of Django 
are you using? It's possible it was fixed since then. Could you provide a 
minimal set of models to reproduce?

If upgrading to a more recent version of Djanago doesn't fix the problem, 
you might try .exclude(user__in= rather than .filter(~Q if that works for 
your query.

Tim

On Monday, November 11, 2013 6:36:12 AM UTC-5, Phoebe Bright wrote:
>
> I have this line in my code where the functions return an ID and what I 
> wanted was to select all records that did not belong to one of these users.
>
> Carbon.objects.filter(~Q(user__in = [limbo_user(), system_user(), 
> retire_user()]))
>
> What I expected to get was 
>
> *SELECT* •••  *FROM* "web_carbon" *WHERE* 
> *NOT*(("web_carbon"."user_id" *IN* (5, 2, 4))
>
> but what I actually got was
>
> *SELECT* •••  *FROM* "web_carbon" *WHERE* 
> *NOT*(("web_carbon"."user_id" *IN* (5, 2, 4) *AND* "web_carbon"."user_id" 
> *IS**NOT NULL*)) 
>
> So it always returns a null set.  Is this correct behaviour and if so, 
> does anyone know what the correct syntax is?
>

-- 
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/be576720-2ccd-4123-bfc4-1a2e45acb8eb%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: ImportError: No module named filestorage

2013-11-13 Thread tim
I did a Google search for "from filestorage import DatabaseStorage" and 
came up with this link:

https://bitbucket.org/david/django-storages/issue/132/name-databasestorage-is-not-defined

On Tuesday, November 12, 2013 1:15:13 AM UTC-5, ckg...@gmail.com wrote:
>
> i was doing this on the python interactive
>
> from filestorage import DatabaseStorage
>
>
> what do i need to install so i dont get this error:
>
>
> ImportError: No module named filestorage
>

-- 
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/0191b2f0-5bc2-4c11-b9c9-8f572bcccb7c%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: How can I use {% for ROW in LIST %} within

2013-11-13 Thread tim
Seems like it should work -- what issue or error are you facing?

On Tuesday, November 12, 2013 7:46:55 PM UTC-5, Pepsodent Cola wrote:
>
> How can I use *{% for ROW in LIST %}* within * type="text/javascript">* tag?  The code I refer to are lines 21 to 25.
>
> http://dpaste.com/1458997/
>
>
>  1
>  2
>  3
>  4 5
>  6
>  7
>  8
>  910
> 11
> 12
> 13
> 1415
> 16
> 17
> 18
> 1920*21*
> 22
> 23
> 2425
> 26
> 27
> 28
> 2930
> 31
> 32
> 33
> 3435
> 36
> 37
> 38
> 3940
> 41
> 42
> 43
> 44
>
> 
> Navi page
> 
> 
> {% load staticfiles %}
> 
> 
>