Il 30/05/2016 13:11, VRS Rajkot ha scritto:
> hi,
> 
> |
> Entercode here...
> |
> 
> my django_cms == 3.2.3
> django == 1.8.10
> 
> my cms_plugins.py is
> 
> 
> |
> from.models import*
>  fromcms.utils importget_language_from_request
>  fromdjango.contrib importadmin
> 
> 
> 
> 
>  
> 
> classFaqPlugin(CMSPluginBase):name =_("Faq Plugin")
> render_template ="faq/faq_list.html"
> 
> 
> defrender(self,context,instance,placeholder):
> 
> faqs =Faq.objects.language('fr').filter(status="published")
>  lang =context['request']
> 
>  context.update({'instance':instance,'faqs':faqs})
> 
> | returncontext|
> 
> |
> 
> |
> |
> 
> plugin_pool.register_plugin(FaqPlugin)
> 
> i want to get current language object instead of 'fr' how can i get that
> plz help!!

instance.language is the plugin language if you want the language of the
plugin, or get_language_from_request(request, check_path) (from
django.utils.translation) if you want the request language


> 
> -- 
> Message URL:
> https://groups.google.com/d/msg/django-cms-developers/topic-id/message-id
> Unsubscribe: send a message to
> [email protected]
> ---
> You received this message because you are subscribed to the Google
> Groups "django CMS developers" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to [email protected]
> <mailto:[email protected]>.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/django-cms-developers/c087a609-96a7-4995-a462-22cdd87091b2%40googlegroups.com
> <https://groups.google.com/d/msgid/django-cms-developers/c087a609-96a7-4995-a462-22cdd87091b2%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.


-- 
Iacopo Spalletti

Nephila s.a.s. - Firenze
Telefono: +39 055 5357189
Assistenza Tecnica: +39 055 3985730
http://nephila.it

-- 
Message URL: 
https://groups.google.com/d/msg/django-cms-developers/topic-id/message-id
Unsubscribe: send a message to 
[email protected]
--- 
You received this message because you are subscribed to the Google Groups 
"django CMS developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/django-cms-developers/574C24AB.1090300%40nephila.it.
For more options, visit https://groups.google.com/d/optout.

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to