Re: Question on Template Tags

2013-06-08 Thread Karen Tracey
Please ask questions about using Django on django-users. The topic of this
list is the development of Django itself.

Thanks,
Karen

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Question on Template Tags

2013-06-08 Thread Dave Finnerty
I have been trying to get templates tags working so I can make a sidebar 
tag.  using inclusion_tag.



when templatetags is in the app it works cooreectly 

Project
  |
  |--app01
   |-templatetags
  |
  |--templates




but when I try to move it to a second app and use it in the first app i get 
errors
Project
  |
  |--app01
  |--parts
   |
   |-templatetags
  |
  |--templates


TemplateSyntaxError at /

'dave_tags' is not a valid tag library: Template library dave_tags not found, 
tried 
django.templatetags.dave_tags,django.contrib.staticfiles.templatetags.dave_tags,django.contrib.admin.templatetags.dave_tags,allauth.account.templatetags.dave_tags,allauth.socialaccount.templatetags.dave_tags,django.templatetags.dave_tags

Any idea what I have to set so template tags in one app can work in another app?






-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: RFC: "universal" view decorators

2013-06-08 Thread Donald Stufft

On Jun 8, 2013, at 12:48 PM, Hanne Moa  wrote:

> On 3 June 2013 18:09,  wrote:
> # `DecoratorMixin`
> 
> `DecoratorMixin` is a class factory that converts any view decorator into a 
> class-based view mixin. 
> 
> Using it is easy and intuitive:
> 
> LoginRequiredMixin = DecoratorMixin(login_required)
> 
> Now this, this feels pythonic. Bravo!  I'm so doing this in future 
> projects... (Though, class factories are spelled lowercase_with_underscores, 
> no? At least in Django. For instance formset_factory().)
> 
> I've had a look at various LoginRequiredMixins out there (everybody makes 
> their own it seems, including me). It is quite common that it doesn't cover 
> all the things that login_required covers (like supporting the new way of 
> doing users in 1.5) so in the case of  LoginRequiredMixin, I think the safest 
> solution is to include a mixin in core anyway.
> 
> 
> HM
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-developers+unsubscr...@googlegroups.com.
> To post to this group, send email to django-developers@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-developers?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  

Part of the reasoning of my original Change to make decorators classes was that 
it enabled much easier customization of them. Currently you basically either 
hope there was an option for doing what you wanted, or you copy/paste the 
entire thing and modify it.

Using a class lets you override it.

-
Donald Stufft
PGP: 0x6E3CBCE93372DCFA // 7C6B 7C5D 5E2B 6356 A926 F04F 6E3C BCE9 3372 DCFA



signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: RFC: "universal" view decorators

2013-06-08 Thread Hanne Moa
On 3 June 2013 18:09,  wrote:

> # `DecoratorMixin`
>
> `DecoratorMixin` is a class factory that converts any view decorator into
> a class-based view mixin.
>
> Using it is easy and intuitive:
>
> LoginRequiredMixin = DecoratorMixin(login_required)
>

Now this, this feels pythonic. Bravo!  I'm so doing this in future
projects... (Though, class factories are spelled
lowercase_with_underscores, no? At least in Django. For instance
formset_factory().)

I've had a look at various LoginRequiredMixins out there (everybody makes
their own it seems, including me). It is quite common that it doesn't cover
all the things that login_required covers (like supporting the new way of
doing users in 1.5) so in the case of  LoginRequiredMixin, I think the
safest solution is to include a mixin in core anyway.


HM

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.