Re: direct_to_template, extra_context

2007-02-28 Thread patrick k.

thanks a lot. that´s working.

patrick


Am 27.02.2007 um 18:24 schrieb Joseph Kocherhans:

>
> On 2/27/07, va:patrick.kranzlmueller <[EMAIL PROTECTED]>  
> wrote:
>>
>> from django.conf.urls.defaults import *
>>
>> urlpatterns = patterns('',
>>   (r'^stars/', 'django.views.generic.simple.direct_to_template',
>> {'template': 'site/stars/stars_overview.html'}, extra_context=
>> {'category': 'stars', 'subcategory': 'none'}),
>> )
>>
>> isn´t that supposed to work? did I miss something?
>
> Yeah. You're trying to treat extra_context like it's a keyword
> argument to a function call, but you're not calling a function. You
> probably mean something like this:
>
> urlpatterns = patterns('',
> (r'^stars/', 'django.views.generic.simple.direct_to_template', {
> 'template': 'site/stars/stars_overview.html',
> 'extra_context': {
> 'category': 'stars',
> 'subcategory': 'none'
> }
> })
> )
>
> If you want to delve deeper into "why", check this out. Especially  
> section 4.7.3
> http://docs.python.org/tut/node6.html#SECTION00670
>
> Joseph
>
> >


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: direct_to_template, extra_context

2007-02-27 Thread Joseph Kocherhans

On 2/27/07, va:patrick.kranzlmueller <[EMAIL PROTECTED]> wrote:
>
> from django.conf.urls.defaults import *
>
> urlpatterns = patterns('',
>   (r'^stars/', 'django.views.generic.simple.direct_to_template',
> {'template': 'site/stars/stars_overview.html'}, extra_context=
> {'category': 'stars', 'subcategory': 'none'}),
> )
>
> isn´t that supposed to work? did I miss something?

Yeah. You're trying to treat extra_context like it's a keyword
argument to a function call, but you're not calling a function. You
probably mean something like this:

urlpatterns = patterns('',
(r'^stars/', 'django.views.generic.simple.direct_to_template', {
'template': 'site/stars/stars_overview.html',
'extra_context': {
'category': 'stars',
'subcategory': 'none'
}
})
)

If you want to delve deeper into "why", check this out. Especially section 4.7.3
http://docs.python.org/tut/node6.html#SECTION00670

Joseph

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: direct_to_template, extra_context

2007-02-27 Thread Mike

It looks like multiple dictionaries are being passed to the view.

Should 'extra_context' be included in the first one (just like the
'template' argument)?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: direct_to_template, extra_context

2007-02-27 Thread va:patrick.kranzlmueller

from django.conf.urls.defaults import *

urlpatterns = patterns('',
  (r'^stars/', 'django.views.generic.simple.direct_to_template',  
{'template': 'site/stars/stars_overview.html'}, extra_context=  
{'category': 'stars', 'subcategory': 'none'}),
)

isn´t that supposed to work? did I miss something?

thanks,
patrick


Am 27.02.2007 um 17:36 schrieb Joseph Kocherhans:

>
> On 2/27/07, va:patrick.kranzlmueller <[EMAIL PROTECTED]>  
> wrote:
>>
>> why doesn´t this work?
>>   (r'^stars/', 'django.views.generic.simple.direct_to_template',
>> {'template': 'site/stars/stars_overview.html'}, extra_context=
>> {'category': 'stars', 'subcategory': 'none'}),
>>
>> the error is "invalid syntax".
>
> You'll need to show more of your surrounding code for us to be able to
> help you with this one. The problem in that particular snippet is the
> "extra_context=".
>
> Jospeh
>
> >


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: direct_to_template, extra_context

2007-02-27 Thread Joseph Kocherhans

On 2/27/07, va:patrick.kranzlmueller <[EMAIL PROTECTED]> wrote:
>
> why doesn´t this work?
>   (r'^stars/', 'django.views.generic.simple.direct_to_template',
> {'template': 'site/stars/stars_overview.html'}, extra_context=
> {'category': 'stars', 'subcategory': 'none'}),
>
> the error is "invalid syntax".

You'll need to show more of your surrounding code for us to be able to
help you with this one. The problem in that particular snippet is the
"extra_context=".

Jospeh

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



direct_to_template, extra_context

2007-02-27 Thread va:patrick.kranzlmueller

why doesn´t this work?
  (r'^stars/', 'django.views.generic.simple.direct_to_template',  
{'template': 'site/stars/stars_overview.html'}, extra_context= 
{'category': 'stars', 'subcategory': 'none'}),

the error is "invalid syntax".

thanks,
patrick
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---