Re: named url patterns - invalid syntax

2012-08-06 Thread Blaxton
o-users@googlegroups.com Sent: Sunday, August 5, 2012 4:51:46 PM Subject: Re: named url patterns - invalid syntax Al 05/08/12 13:43, En/na Blaxton ha escrit: > > Hi > > Why following line cause an invalid syntax : > (r'^myform/$', 'mysite.views.myform', nam

Re: named url patterns - invalid syntax

2012-08-05 Thread Adriano Teixeira
Hi, You are probably not using the url() function, but just the tuple format. You should have something like: urlpatterns = patterns('', url(r'^myform/$', 'mysite.views.myform', name="myform") ) instead of urlpatterns = patterns('', (r'^myform/$', 'mysite.views.myform', name="myform") ) The

Re: named url patterns - invalid syntax

2012-08-05 Thread Alexis Roda
Al 05/08/12 13:43, En/na Blaxton ha escrit: Hi Why following line cause an invalid syntax : (r'^myform/$', 'mysite.views.myform', name="myform"), Because it's syntax is invalid: the 'name=value' is allowed in function calls but not in tuples. Try with: urlpatterns = patterns('', url(r

Re: named url patterns - invalid syntax

2012-08-05 Thread Daniel Roseman
On Sunday, 5 August 2012 12:43:48 UTC+1, Blaxxton wrote: > > > Hi > > Why following line cause an invalid syntax : > (r'^myform/$', 'mysite.views.myform', name="myform"), > > it seems named url pattern has changed from name="myform" to just 'myform' > because when I change it to: > (r'^myform/$',

named url patterns - invalid syntax

2012-08-05 Thread Blaxton
Hi Why following line cause an invalid syntax : (r'^myform/$',  'mysite.views.myform', name="myform"), it seems named url pattern has changed from name="myform" to just 'myform' because when I change it to: (r'^myform/$',  'mysite.views.myform', 'myform'), it pass the syntax error and throw

Re: Named URL Patterns -- Syntax Error

2009-09-25 Thread W3
Thanks, that was it. Bit of a simple one I probably should have spotted. Andrew On 25 Sep, 19:42, Tim Chase wrote: > > Can somebody tell me why i get a syntax error with this named URL > > pattern? > > > urlpatterns = patterns('', > >     url(r'^feed/(?P.*)/$', > >     'django.contrib.syndicati

Re: Named URL Patterns -- Syntax Error

2009-09-25 Thread Tim Chase
> Can somebody tell me why i get a syntax error with this named URL > pattern? > > urlpatterns = patterns('', > url(r'^feed/(?P.*)/$', > 'django.contrib.syndication.views.feed', > {'feed_dict': feeds} looks like a missing comma here... > name="feed"), > ) -tim --~--~---

Named URL Patterns -- Syntax Error

2009-09-25 Thread When ideas fail
Can somebody tell me why i get a syntax error with this named URL pattern? urlpatterns = patterns('', url(r'^feed/(?P.*)/$', 'django.contrib.syndication.views.feed', {'feed_dict': feeds} name="feed"), ) This is the traceback: Traceback: File

Re: Named URL Patterns

2008-10-18 Thread Keith Eberle
i think you may need to "name" the argument. For example: url(r'^$', list_detail.object_list, {'queryset': Project.objects.all()}, name='project-home'), keith On Fri, Oct 17, 2008 at 4:59 PM, Karen Tracey <[EMAIL PROTECTED]> wrote: > On Fri, Oct 17, 2008 at 3:30 PM, dkadish <[EMAIL PROTECTED]

Re: Named URL Patterns

2008-10-17 Thread Karen Tracey
On Fri, Oct 17, 2008 at 3:30 PM, dkadish <[EMAIL PROTECTED]> wrote: > > Okay. I think the issue is that I am trying to use reverse( ) in the > URLConf file. According to the django docs, "the reverse() function > has to import all of your URLConf files and examine the name of each > view". My thin

Re: Named URL Patterns

2008-10-17 Thread dkadish
Okay. I think the issue is that I am trying to use reverse( ) in the URLConf file. According to the django docs, "the reverse() function has to import all of your URLConf files and examine the name of each view". My thinking is that this is leading to to attempt to import itself as it evaluates th

Re: Named URL Patterns

2008-10-17 Thread dkadish
Do you know if there's an easy way to try and figure out where reverse( ) is looking for the pages? On Oct 17, 11:24 am, dkadish <[EMAIL PROTECTED]> wrote: > Nope. Tried that. > > This shouldn't (I don't think) make any difference but I am running > Django 1.0, Python 2.5, Apache 2.210 on Windows

Re: Named URL Patterns

2008-10-17 Thread dkadish
Nope. Tried that. This shouldn't (I don't think) make any difference but I am running Django 1.0, Python 2.5, Apache 2.210 on Windows Server 2003 with SQL Server 2005 as the db (I know, I know...out of my hands) David On Oct 17, 11:19 am, Steve Holden <[EMAIL PROTECTED]> wrote: > dkadish wrote:

Re: Named URL Patterns

2008-10-17 Thread Steve Holden
dkadish wrote: > I'm having issues with a named URL pattern in my code. Django does not > seem to be finding the correct URL when the {% url %} and reverse( ) > tag/functions are used. > > the urls.py file at app_root/project/urls.py contains: > > from django.views.generic import list_detail, crea

Named URL Patterns

2008-10-17 Thread dkadish
I'm having issues with a named URL pattern in my code. Django does not seem to be finding the correct URL when the {% url %} and reverse( ) tag/functions are used. the urls.py file at app_root/project/urls.py contains: from django.views.generic import list_detail, create_update from maverick.pro

Re: How to get named url patterns from inside a view function

2007-12-19 Thread Arkadiusz Oleksy
On 19 Gru, 18:02, shabda <[EMAIL PROTECTED]> wrote: > I can get access to a named url from within a template by using {% url > %} tag. What can I do to get access to named url from a view function? use reverse() method: http://www.djangoproject.com/documentation/url_dispatch/#reverse --~--~

How to get named url patterns from inside a view function

2007-12-19 Thread shabda
I can get access to a named url from within a template by using {% url %} tag. What can I do to get access to named url from a view function? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To po

Re: Named URL patterns with included urlconfs

2007-11-18 Thread Justin Fagnani
Solved. The url names were apparently being cached, so it appeared that naming a included url didn't work. Lesson: always restart django when changing url names -Justin On 11/18/07, Justin Fagnani <[EMAIL PROTECTED]> wrote: > > I've noticed that if you're trying to

Named URL patterns with included urlconfs

2007-11-18 Thread Justin Fagnani
I've noticed that if you're trying to use named url patterns with an included urlconf that you need to label the pattern that includes the urlconf as well as the pattern being included with the same name. This seems to prevent having more than one named url in an included urlconf.

Re: Urlresolvers issue ... side effect of named URL patterns ?

2007-07-10 Thread Malcolm Tredinnick
to decalre my URL linked to the same view in number of > arguments descending ... so if one arg was given the first (r'member/ > status(?P\d+)/(?P\d+)/$', 'app.views_admin.member_list') > didn't match then the (r'member/status(?P\d+)/$', > 'ap

Urlresolvers issue ... side effect of named URL patterns ?

2007-07-09 Thread xgdlm
mber_list') didn't match then the (r'member/status(?P\d+)/$', 'app.views_admin.member_list') mached. If no argument was given the first two URL pattern didn't match so the last one matched. This is not the case with the latest SVN version I guess this is a side ef

Re: reverse() is quite slow for named url patterns

2007-06-14 Thread Malcolm Tredinnick
On Fri, 2007-06-15 at 07:40 +1000, Malcolm Tredinnick wrote: > On Thu, 2007-06-14 at 14:17 -0700, Smoo.Master wrote: > > I have using django to make a sort of library website. > > > > Since I am mostly using generic views, I use the {% url %} tag (which > > calls rever

Re: reverse() is quite slow for named url patterns

2007-06-14 Thread Malcolm Tredinnick
On Thu, 2007-06-14 at 14:17 -0700, Smoo.Master wrote: > I have using django to make a sort of library website. > > Since I am mostly using generic views, I use the {% url %} tag (which > calls reverse) with named url patterns in my templates. However this > became quite slow (as

reverse() is quite slow for named url patterns

2007-06-14 Thread Smoo.Master
I have using django to make a sort of library website. Since I am mostly using generic views, I use the {% url %} tag (which calls reverse) with named url patterns in my templates. However this became quite slow (as I verified with the hotshot profiler). On a page with several hundred links, it

Re: Named URL patterns to use prefix?

2007-04-26 Thread Malcolm Tredinnick
Hey Ryan, On Wed, 2007-04-25 at 16:23 +, Ryan Kanno wrote: > Already a ticket? Shoot, I swore I searched, but I couldn't find > one. Sorry about that - my apologies. > > (http://code.djangoproject.net/ticket/4129) No problems -- I forgot to point you to the ticket number, too. Anyway, th

Re: Named URL patterns to use prefix?

2007-04-25 Thread Ryan Kanno
gt; I'm just curious if named URL patterns will be able to use the prefix > > given (or if there's any reason not to) ie, > > > urlpatterns += patterns('my_pattern', > > url(r'^(?P[\d]+)/$', 'details', &

Re: Named URL patterns to use prefix?

2007-04-24 Thread Malcolm Tredinnick
On Tue, 2007-04-24 at 15:21 +, Ryan Kanno wrote: > I'm just curious if named URL patterns will be able to use the prefix > given (or if there's any reason not to) ie, > > urlpatterns += patterns('my_pattern', > url(r&#

Named URL patterns to use prefix?

2007-04-24 Thread Ryan Kanno
I'm just curious if named URL patterns will be able to use the prefix given (or if there's any reason not to) ie, urlpatterns += patterns('my_pattern', url(r'^(?P[\d]+)/$', 'details', name="my-details"),

Re: Accessing named URL patterns from views

2007-04-22 Thread Chris Lee-Messer
On Apr 21, 1:53 am, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > [snip] > We haven't documentedreverse() anywhere, as far as I know. So worth > filing a ticket. > I realize that urlresolvers.reverse() was not documented earlier, but does the addition of named urls mean that the old behavior is

Re: Accessing named URL patterns from views

2007-04-21 Thread Malcolm Tredinnick
urn HttpResponseRedirect( reverse( 'your-url-name' ) ) > > Have I missed something and this was documented else where? Otherwise > I'll raise a ticket to update the above documentation for named url > patterns... We haven't documented

Accessing named URL patterns from views

2007-04-21 Thread Michael
Otherwise I'll raise a ticket to update the above documentation for named url patterns... Cheers, Michael --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to thi