Re: How to format datetime stamp in JS like it is doing by the date template tag?

2024-03-21 Thread the.one.abo...@gmail.com
Hello, thanks for your reply! The DATETIME_FORMAT setting of Django uses format strings that are incompatible with JS. E.g the default DATETIME_FORMAT value in Django is 'N j, Y'. You can check the allowed format strings in Django documentation

Re: How to format datetime stamp in JS like it is doing by the date template tag?

2024-03-21 Thread Matthias Yeni
To format the timestamp in JavaScript according to the format defined by Django, you can use Django settings to determine the format and adapt it in JavaScript. Here's how you can do it: Retrieve the date and time format defined by Django in your JavaScript file using a Django template rendering

How to format datetime stamp in JS like it is done by the date template tag?

2024-03-21 Thread the.one.abo...@gmail.com
Hello everyone, I am customizing Django admin by adding a datetime stamp to the page using JavaScript. I want to format the datetime stamp according to the format set by Django. It is possible to get the DATETIME_FORMAT using the get_format() method in JS which is "'j M Y, P'". But, this for

How to format datetime stamp in JS like it is doing by the date template tag?

2024-03-21 Thread the.one.abo...@gmail.com
Hello, I have customizing Django admin by adding a datetime stamp to the page using JavaScript. I want to format the datetime stamp according to the format set by Django. It is possible to get the DATETIME_FORMAT using the get_format() method in JS. But, this format is not supported by the D

Re: Use include template tag in another app template folder

2022-09-02 Thread Wazed Khan
Sep 2, 2022, 5:22 PM mohamed khaled < >> mohamed.khaled33...@gmail.com> wrote: >> >>> I have two apps each one has template folder I want to use *include >>> *template >>> tag to get template from other app how can I handle that >>> >>>

Re: Use include template tag in another app template folder

2022-09-02 Thread Wazed Khan
It would be problematic. Just copy and paste the template file from one > app into the other. > > Abdul Qoyyuum Bin Haji Abdul Kadir > about.me/qoyyuum > > On Fri, Sep 2, 2022, 5:22 PM mohamed khaled > wrote: > >> I have two apps each one has template folder I want to use *inc

Re: Use include template tag in another app template folder

2022-09-02 Thread Abdul Qoyyuum Haji Abdul Kadir
It would be problematic. Just copy and paste the template file from one app into the other. Abdul Qoyyuum Bin Haji Abdul Kadir about.me/qoyyuum On Fri, Sep 2, 2022, 5:22 PM mohamed khaled wrote: > I have two apps each one has template folder I want to use *include *template > tag

Use include template tag in another app template folder

2022-09-02 Thread mohamed khaled
I have two apps each one has template folder I want to use *include *template tag to get template from other app how can I handle that -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiv

Re: NoReverseMatch if "url" template tag not used with app_name

2020-07-15 Thread Franz Ulenaers
It seems you have specified an app_name in your post/urls.py : *app_name='post'* Have you different name='home' in your apps then you have to use the app_name to make it unique !! Op dinsdag 14 juli 2020 22:08:22 UTC+2 schreef strang: > > I understand what you are trying to explain. > > I ha

NoReverseMatch if "url" template tag not used with app_name

2020-07-14 Thread strang
I understand what you are trying to explain. I have used name=“home” for home view. I’m using urls.py for my app(main URLs.py to route me to my apps urls.py, app urls.py contains path(‘’, HomeView.as_view(), name=‘home’) But when I try to reference this url in templates ({% url ‘home’%})I get

NoReverseMatch if "url" template tag not used with app_name

2020-07-14 Thread Exactly musty
You are using django url, so it should be the same name you gave your url in your URLs.py e.g path('',homeview.as_views, name='home-page') So if I want to call this url in my template I will use the django url which is {% url 'home-page' %}. You will have to check your url and see if what you

NoReverseMatch if "url" template tag not used with app_name

2020-07-14 Thread strang
I just want to confirm if there has been a change in Django3.x In Django2.x i could write something like ** where 'home' is a url pattern in one of my apps(not the main url file) But I get NoReverseMatch when I use the same in Django3 I have to use this convention ** Which one is correct, for D

Django does not Override Settings in Template Tag Testing

2019-12-11 Thread Eray Erdin
I have actually provided quite much verbose information in Stackoverflow <https://stackoverflow.com/questions/59251954/django-does-not-override-settings-in-template-tag-testing>. I have a problem overriding settings as testing template tags. I leave this here in case you are inte

Re: template tag help please?

2018-08-26 Thread Tosin Ayoola
good day guys I'm working on a project but currently I'm having issues, which is I created a model to save some images files & I created a template to display the images but the issue now is for loop isn't displaying the files at the template On 8/23/18, Tosin Ayoola wrote: > this is the link htt

Re: template tag help please?

2018-08-23 Thread Tosin Ayoola
this is the link https://github.com/olaneat/ask_the_schools will rili b glad if u can help On Thu, Aug 23, 2018 at 2:31 PM Tosin Ayoola wrote: > i have the code on git actually because i'm trying to get the add a file > at the admin page but i'm getting the error > > > On Thu, Aug 23, 2018 at 2

Re: template tag help please?

2018-08-23 Thread Tosin Ayoola
i have the code on git actually because i'm trying to get the add a file at the admin page but i'm getting the error On Thu, Aug 23, 2018 at 2:17 PM ireoluwa fakeye wrote: > Sorry didn't look at it well ,can I see a screen shot of your code > > On Thu, 23 Aug 2018, 14:10 Tosin Ayoola, wrote: >

Re: template tag help please?

2018-08-23 Thread ireoluwa fakeye
Sorry didn't look at it well ,can I see a screen shot of your code On Thu, 23 Aug 2018, 14:10 Tosin Ayoola, wrote: > not properly routing my urls as in, i don't understand > > On Thu, Aug 23, 2018 at 2:06 PM ireoluwa fakeye wrote: > >> You Are not properly routing your urls >> >> On Thu, 23 Au

Re: template tag help please?

2018-08-23 Thread Tosin Ayoola
not properly routing my urls as in, i don't understand On Thu, Aug 23, 2018 at 2:06 PM ireoluwa fakeye wrote: > You Are not properly routing your urls > > On Thu, 23 Aug 2018, 14:03 Tosin Ayoola, wrote: > >> good day please i'm having issues, attached below is one of the error i'm >> getting a

Re: template tag help please?

2018-08-23 Thread ireoluwa fakeye
You Are not properly routing your urls On Thu, 23 Aug 2018, 14:03 Tosin Ayoola, wrote: > good day please i'm having issues, attached below is one of the error i'm > getting also ive been trying to add bootstrap glyphicon to my project but > it just display the text without the glyphicon, > > On

RE: template tag help please?

2018-08-23 Thread Mike Jones
. Thank you From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of Andréas Kühne Sent: 23 August 2018 08:15 To: django-users@googlegroups.com Subject: Re: template tag help please? Yes - but you still are doing it strange - you shouldn't use kwargs if yo

Re: template tag help please?

2018-08-23 Thread Andréas Kühne
else: > > for x in val_set: > > val = x.short > > return val > > > > *From:* django-users@googlegroups.com [mailto: > django-users@googlegroups.com] *On Behalf Of *Andréas Kühne > *Sent:* 22 August 2018 15:20 > *To:* django-users@goo

Re: template tag help please?

2018-08-22 Thread Mikhailo Keda
Probably you don't need template tag at all, try {{ b.name }} if you just need to get name value from b -- 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 e

RE: template tag help please?

2018-08-22 Thread Mike Jones
val = x.full else: for x in val_set: val = x.short return val From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of Andréas Kühne Sent: 22 August 2018 15:20 To: django-users@googlegroups.com Subject: Re: template tag help pl

Re: template tag help please?

2018-08-22 Thread Andréas Kühne
Wait a secound, you are doing some very strange things I didn't see this before. You have defined the following: @register.simple_tag def do_cost( name, avn, avd, *args, **kwargs ): avn = kwargs['avn'] avd = kwargs['avd'] name = kwargs['name'] return name The method has 3 par

Re: template tag help please?

2018-08-22 Thread MikeKJ
Thank you Andreas Kuhne, progress So this {% load get_cost %}{% do_cost b.name avn avd %} was working quite happily but for some reason is now complaining Exception Type: TemplateSyntaxError Exception Value: Caught KeyError while rendering: 'avn' Exception Location claims to bege

Re: template tag help please?

2018-08-22 Thread MikeKJ
Thank you Andreas Kuhne, progress So this {% load get_cost %}{% do_cost b.name avn avd %} is not getting any error on the template but as simple as the below is there is no return from django import template from django.conf import settings from django.utils.html import escape register = templa

Re: template tag help please?

2018-08-22 Thread Andréas Kühne
Hi, You don't need the {{}} when sending a variable to the template tag - try removing them. Regards, Andréas Den ons 22 aug. 2018 kl 12:17 skrev MikeKJ : > > I am so rusty I’m having trouble writing a simple_tag > > > > In the template > > > > {% fo

Re: template tag help please?

2018-08-22 Thread MikeKJ
I am so rusty I’m having trouble writing a simple_tag In the template {% for b in list %} {% load get_cost %}{% do_cost {{ b.name }} avn avd %} Also tried (per docs) {% do_cost name={{ b.name }} avn=avn avd=avd %} I definitely have values in the template passed from the view for avn

Re: template tag help please?

2018-08-17 Thread Mikhailo Keda
"Then in the template any number of arguments, separated by spaces, may be passed to the template tag." from the Documentation -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop rece

Re: template tag help please?

2018-08-17 Thread MikeKJ
Yes For example, in the filter {{ var|foo:"bar" }}, the filter foo would be passed the variable var and the argument "bar". I want to pass 2 (maybe 3) variables and correct me if I am wrong but Custom filters are just Python functions that take one or two arguments: So could do {

RE: template tag help please?

2018-08-17 Thread Mike Jones
17 August 2018 14:43 To: Django users Subject: Re: template tag help please? Check the documentation - https://docs.djangoproject.com/ko/2.1/howto/custom-template-tags/ -- You received this message because you are subscribed to a topic in the Google Groups "Django users" group.

Re: template tag help please?

2018-08-17 Thread Mikhailo Keda
Check the documentation - https://docs.djangoproject.com/ko/2.1/howto/custom-template-tags/ -- 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+unsubsc

template tag help please?

2018-08-17 Thread MikeKJ
I want to pass 2 variables to a templatetag from within a template, a name and a date (eg, John 29/09/2018) to output the result of the templatetag def. The reason I want to do this is: >From a list of all names: The name comes from a model that has a foreign key to another model that has act

Re: NoReverseMatch when trying to use get_absolute_url with custom template tag

2017-03-30 Thread Will Holmes
Oh yeah i see. Brilliant sorted it! Thanks for your help Melvyn. -- 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 p

Re: NoReverseMatch when trying to use get_absolute_url with custom template tag

2017-03-29 Thread Melvyn Sopacua
On Wednesday 29 March 2017 09:16:17 Will Holmes wrote: > url(r'^(?P\d+)$/', views.viewEvent, name='viewevent'), name = viewevent > def get_absolute_url(self): > return reverse('cal:viewEvent', args=[str(self.id)], > current_app='cal') name = viewEvent > Sorry about the load of

NoReverseMatch when trying to use get_absolute_url with custom template tag

2017-03-29 Thread Will Holmes
I am making a calendar app which has a custom template tag that takes the python HTML template function and overlays objects from the Events model on the correct days. I am trying to get the displayed objects to have a link directly to an object detail/edit view and am trying to use

Re: "trans" template tag using wrong language

2017-03-11 Thread Joan Perals
Hi Antonis, I think I figured this out. I have English as fallback language (LANGUAGE_CODE = 'en') in the settings, but my source language is German, and this mismatch seems to have been the source of all the trouble. Providing German translations (even if the original strings are already in Ge

Re: "trans" template tag using wrong language

2017-03-11 Thread Joan Perals
Hi Antonis, I think I figured this out. I have English as fallback language (LANGUAGE_CODE = 'en') in the settings, but my source language is German, and this mismatch seems to have been the source of all the trouble. Providing German translations (even if the original strings are already in Ge

Re: "trans" template tag using wrong language

2017-03-09 Thread Antonis Christofides
It's very unlikely that such a basic behaviour won't work, so probably you are doing something wrong (and so's the stack overflow poster). I made several related changes in an app yesterday and I had absolutely no problem with {% trans %} (but I'm using 1.8). Do you have USE_I18N = True? If in th

Re: "trans" template tag using wrong language

2017-03-09 Thread Joan Perals
This post on StackOverflow seems to report the same behaviour: http://stackoverflow.com/questions/10282074/how-to-set-default-language-in-django-for-templates It's quite old (almost 5 years), but remains unresolved. -- You received this message because you are subscribed to the Google Groups "D

"trans" template tag using wrong language

2017-03-08 Thread Joan Perals
I have a site using Django 1.10 with German and English as available languages, where German is the source language. Dynamic content is translated with django-modeltranslation and for static strings I am using Django's built-in `trans` template tag. I want Django to return the page i

Re: extend Media in custom template tag

2017-02-22 Thread guettli
/41592766/django-include-media-css-js-in-class-based-views Am Montag, 9. Mai 2016 10:25:49 UTC+2 schrieb guettli: > > I have a custom Django template tag which creates HTML. > > > This HTML needs some JS and CSS. > > > How can I extend the media list with my custom template t

Re: extend Media in custom template tag

2017-02-22 Thread guettli
I see replies. Now I am unsure what happened: - nobody read my question - someone read it, but did not understand it - someone read it, understood it, but had no solution. - ... other. Am Montag, 9. Mai 2016 10:25:49 UTC+2 schrieb guettli: > > I have a custom Django template tag

Re: Custom Template Tag

2016-09-15 Thread 'Abraham Varricatt' via Django users
gt;>> >>> Thanks, >>> >>> Al >>> >>> On Thursday, September 1, 2016 at 8:09:29 AM UTC-4, ludovic coues wrote: >>>> >>>> I wouldn't do it this way. >>>> Personally, I would make the POST request in the view func

Re: Custom Template Tag

2016-09-10 Thread Al Johri
1, 2016 at 8:09:29 AM UTC-4, ludovic coues wrote: >>> >>> I wouldn't do it this way. >>> Personally, I would make the POST request in the view function, put >>> the return value in the context. The template isn't a good place to >>> hav

Re: Custom Template Tag

2016-09-01 Thread Constantine Covtushenko
ally, I would make the POST request in the view function, put >> the return value in the context. The template isn't a good place to >> have logic. It should only take data and format them. >> >> 2016-09-01 5:33 GMT+02:00 Al Johri : >> > Hi Django Users, &g

Re: Custom Template Tag

2016-09-01 Thread Al Johri
, put > the return value in the context. The template isn't a good place to > have logic. It should only take data and format them. > > 2016-09-01 5:33 GMT+02:00 Al Johri >: > > Hi Django Users, > > > > I want to make a custom template tag wher

Re: Custom Template Tag

2016-09-01 Thread ludovic coues
t; I want to make a custom template tag where the tag's renderer needs to make > a POST request. > > https://docs.djangoproject.com/en/1.10/howto/custom-template-tags/#writing-the-renderer > https://docs.djangoproject.com/en/1.10/howto/custom-template-tags/#thread-safety-considerati

Custom Template Tag

2016-09-01 Thread Al Johri
Hi Django Users, I want to make a custom template tag where the tag's renderer needs to make a POST request. https://docs.djangoproject.com/en/1.10/howto/custom-template-tags/#writing-the-renderer https://docs.djangoproject.com/en/1.10/howto/custom-template-tags/#thread-safety-considera

Re: template tag don't work ==

2016-06-09 Thread Ing. Jaime Sanchez
Sanchez {{ over.primary_contacts }} {% endifequal %} {% endfor %} NOC Technician: Status: Remaining Time: Preview {% endif %} {% endfor %} El jueves, 9 de junio de 2016, 11:33:24 (UTC-5), Ing. Jaime Sanchez escribió: > > Help please

Re: template tag don't work ==

2016-06-09 Thread Tim Graham
A sample project to reproduce the problem is probably needed. On Thursday, June 9, 2016 at 12:33:24 PM UTC-4, Ing. Jaime Sanchez wrote: > > Help please!! > > I need do like this > in django 1.9 template tag > > {% if model1.obj == model2.obj %} > print ok > {% else %

template tag don't work ==

2016-06-09 Thread Ing. Jaime Sanchez
Help please!! I need do like this in django 1.9 template tag {% if model1.obj == model2.obj %} print ok {% else %} print not OK {% endif %} but don't work. someone help me?? -- You received this message because you are subscribed to the Google Groups "Django users" group.

extend Media in custom template tag

2016-05-09 Thread guettli
I have a custom Django template tag which creates HTML. This HTML needs some JS and CSS. How can I extend the media list with my custom template tag? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this

Fwd: Built In Template Tag Request

2016-04-27 Thread Paul Kenjora
Hello, I sometimes have to pass more complex content into an include or another tag as a variable. The {% with %} tag and filters aren't enough to for example render an HTML button and pass it into another include. I'd like to request a {% with_html variable %} tag in the built in tag set.

Re: [django1.9] Url template tag, dotted path and decorator

2016-04-24 Thread knbk
PM UTC-4:30, François Magimel wrote: >> >> Hi! >> >> I'm facing an issue reversing a dotted path with django 1.9.4. Here are >> more details. >> >> I pass a dotted path to the django template tag "url": >> "{% url 'my.app.

Re: [django1.9] Url template tag, dotted path and decorator

2016-04-23 Thread Camilo Torres
On Saturday, April 23, 2016 at 1:17:26 PM UTC-4:30, François Magimel wrote: > > Hi! > > I'm facing an issue reversing a dotted path with django 1.9.4. Here are > more details. > > I pass a dotted path to the django template tag "url": > "

[django1.9] Url template tag, dotted path and decorator

2016-04-23 Thread François Magimel
Hi! I'm facing an issue reversing a dotted path with django 1.9.4. Here are more details. I pass a dotted path to the django template tag "url": "{% url 'my.app.view.func' arg %}" And the function "my.app.view.func" has a decorator which is usi

Re: STATIC_URL with thumbnail_url Template Tag

2015-07-10 Thread Luis Zárate
Hi, Stephanie Your are using easy-thumbnails, right? so, are you sure that Pillow are right installed ? http://easy-thumbnails.readthedocs.org/en/latest/usage/ As I see your questions is same that this question http://stackoverflow.com/questions/12956788/how-to-thumbnail-static-files thumbnail

STATIC_URL with thumbnail_url Template Tag

2015-06-30 Thread Stephanie Socias
stackoverflow <http://stackoverflow.com/questions/31125560/static-url-with-thumbnail-url-template-tag> yesterday.) Thank you! I've tried this: {% load thumbnail %} {% with path="{{STATIC_URL}}/images/green-icon.png" %} {% endwith %} and also: {% load thumbnail %}{% l

Re: Problem with url template tag and namespaces

2015-04-07 Thread donarb
On Tuesday, April 7, 2015 at 9:19:17 AM UTC-7, donarb wrote: > > I'm having a problem with a generated url using the url template tag, > currently using Django 1.6.5. > > The appname is 'dashboard', here is the main urls.py: > > urlpatterns = pattern

Problem with url template tag and namespaces

2015-04-07 Thread donarb
I'm having a problem with a generated url using the url template tag, currently using Django 1.6.5. The appname is 'dashboard', here is the main urls.py: urlpatterns = patterns("", (r'^dashboard/', include('dashboard.urls', namespace=

Re: Problem with a token in my custom template tag

2014-10-15 Thread Daniel Grace
I got it working thanks. My template tag file is as follows: from django import template from django.utils import timezone register = template.Library() @register.simple_tag def rowcolour(dt): diff = timezone.now() - dt if diff.days > 14: return "pinkrow" else: return "

Re: Problem with a token in my custom template tag

2014-10-15 Thread Daniel Roseman
On Wednesday, 15 October 2014 19:30:01 UTC+1, Daniel Grace wrote: > > Hi, > I'm encountering the following problem with a token in my custom template > tag: > Request Method: GET > Request URL: http://127.0.0.1:8000/flows/ > Django Version: 1.7 > Exception Type:

Problem with a token in my custom template tag

2014-10-15 Thread Daniel Grace
Hi, I'm encountering the following problem with a token in my custom template tag: Request Method: GET Request URL: http://127.0.0.1:8000/flows/ Django Version: 1.7 Exception Type: ValueError Exception Value: need more than 2 values to unpack Exception Location: C:\landy\cresta\flow\templat

Combining use of template tag + filter in same expression

2014-06-26 Thread Darren Spruell
I have a template in which I'm trying to achieve the use of the 'firstof' tag to display whichever of two variables is present, and the resulting variable filtered through 'truncatewords'. Is there a way this can be accomplished? Have tried the following: {% first of result.meta.summary|truncatew

Re: testing equality in template tag

2014-06-26 Thread Tom Evans
On Wed, Jun 25, 2014 at 7:34 PM, Lee Hinde wrote: > with view code like so: > > import calendar > months_choices = [] > for i in range(1,13): > months_choices.append((i, calendar.month_name[i])) > context['months'] = months_choices > > > and > > context[

Re: testing equality in template tag

2014-06-26 Thread Roman Klesel
Ugh , sorry of course we know ... forget what i said ... 2014-06-26 9:48 GMT+02:00 Roman Klesel : > hard to tell since we do not know what values default_month and month.0 have > ... > try to print in the view and examine: > print type(month[0]), month[0], type(today.month), today.month > > 2014-

Re: testing equality in template tag

2014-06-26 Thread Roman Klesel
hard to tell since we do not know what values default_month and month.0 have ... try to print in the view and examine: print type(month[0]), month[0], type(today.month), today.month 2014-06-25 20:34 GMT+02:00 Lee Hinde : > with view code like so: > > import calendar > months_choice

testing equality in template tag

2014-06-25 Thread Lee Hinde
with view code like so: import calendar months_choices = [] for i in range(1,13): months_choices.append((i, calendar.month_name[i])) context['months'] = months_choices and context['default_month'] = today.month I have this snippet in a template (my f

Re: Template tag render method doesn't get called

2014-02-16 Thread stevedegrace
This is a real problem. I have had the same issue, and I have seen several other people besides yourself bring this up without getting satisfactory answers. I was having the same problem where __init__ was being called but not render, where the purpose of the tag is to insert several variables

Re: Empty context within template tag render() method after using django.test.client.Client.login() method

2013-09-23 Thread Jonathan Baker
essionid=q27przqeidsnfykuufu7m6lo7nw606qw; > Domain=None; expires=None; Max-Age=None; Path=/; secure', > u'PATH_INFO': u'/accounts/', > u'QUERY_STRING': '', > u'REMOTE_ADDR': '127.0.0.1', > u'REQUEST_METHO

Empty context within template tag render() method after using django.test.client.Client.login() method

2013-09-22 Thread jondbaker
_NAME': u'', u'SERVER_NAME': 'testserver', u'SERVER_PORT': '80', u'SERVER_PROTOCOL': 'HTTP/1.1', u'wsgi.errors': <_io.BytesIO object at 0x2358050>, u'wsgi.input': , u'wsgi.multiproce

Re: How template tag can receive values JS

2013-08-01 Thread Bill Freeman
If this is only to be done when loading a new page, then you could add the JS var value to the request as a query parameter. Then the view would have to pass the value to the template for the new page. On Thu, Aug 1, 2013 at 9:51 AM, Christian Erhardt < christian.erha...@mojo2k.de> wrote: > No,

How template tag can receive values JS

2013-08-01 Thread Christian Erhardt
No, what you are trying is not possible. The template tags are rendered on the server. They never appear on the client machine. Javascript is running on the client machine. They both will never see each other. You will always have to do a roundtrip to interact between Javascript and django temp

Re: How template tag can receive values JS

2013-08-01 Thread Larry Martell
On Thu, Aug 1, 2013 at 6:48 AM, Mário Idival wrote: > Good morning everyone, > I wonder how I can do (and if it is possible), pass a value of javascript > variable to a template tag Django. > > eg > how it works: > {{Document.id | split_filter}} -> split_filter is just a r

How template tag can receive values JS

2013-08-01 Thread Mário Idival
Good morning everyone, I wonder how I can do (and if it is possible), pass a value of javascript variable to a template tag Django. eg how it works: {{Document.id | split_filter}} -> split_filter is just a random method, receives an ID as would {{"Value Var JS" | split_filter}} -

Re: django dynamic template tag

2013-07-13 Thread Andriyko
Try {{ pagecontent.plugin }} instead of {% pagecontent.plugin %} On Wednesday, July 3, 2013 3:11:08 AM UTC+3, Fadi Samara wrote: > > I try to build a plugins based application, I have created tags and > registered them for each plugin. > > I have a table stores each page plugins, and need to

Re: django dynamic template tag

2013-07-03 Thread Fadi Samara
Hi Fred, its already included at the start of the template to load all plugin tags {% load slider ...%} Thanks, On Wednesday, July 3, 2013 11:00:31 PM UTC+10, Fred Stluka wrote: > > Fadi, > > You need to {% load %} the file that defines the tags. > > --Fred > -- >

Re: django dynamic template tag

2013-07-03 Thread Fadi Samara
its already included at the start of the template to load all plugin tags {% load slider ...%} Regards, Fadi Samara. On Wed, Jul 3, 2013 at 11:00 PM, Fred Stluka wrote: > Fadi, > > You need to {% load %} the file that defines the tags. > > --Fred > -- > Fred Stluk

Re: django dynamic template tag

2013-07-03 Thread Fred Stluka
Fadi, You need to {% load %} the file that defines the tags. --Fred Fred Stluka -- mailto:f...@bristle.com -- http://bristle.com/~fred/ Bristle Software, Inc -- http://bristle.com -- Glad to be of service! Open Source: With

django dynamic template tag

2013-07-02 Thread Fadi Samara
I try to build a plugins based application, I have created tags and registered them for each plugin. I have a table stores each page plugins, and need to render any stored plugin in the template accordingly as inclusion tag. Now for the template i use this: {% block slider_region %}{% for p

Access request object in a custom template tag

2013-04-29 Thread Ponytech
Hello, I am currently writing a custom template tag and I need to access the request object within the tag code. When using tag helpers (*simple_tag*, *inclusion_tag *and *assignment_tag*) you can register them with an additional takes_context=True parameter that makes the request object

Re: {% url %} template tag not resolving app url in template

2013-04-09 Thread Sithembewena Lloyd Dube
Issue resolved. The problem was a similar usage of a url template tag without a namespace - in the same template. All I had to do was check the correct line number in the template. Thanks to all. Time for a walk outside. On Tue, Apr 9, 2013 at 5:36 PM, Sithembewena Lloyd Dube wrote: >

Re: {% url %} template tag not resolving app url in template

2013-04-09 Thread Sithembewena Lloyd Dube
Issue resolved. The problem was a similar usage of a url template tag without a namespace. All I had to do was check the correct line number in the template. Thanks to all. Time for a walk outside. On Tue, Apr 9, 2013 at 5:36 PM, Sithembewena Lloyd Dube wrote: > New trace below: I am stum

Re: {% url %} template tag not resolving app url in template

2013-04-09 Thread Sithembewena Lloyd Dube
New trace below: I am stumped. Request Method: GET Request URL: http://127.0.0.1:8000/contact_us/ Django Version: 1.5.1 Exception Type: NoReverseMatch Exception Value: Reverse for 'contact_us' with arguments '()' and keyword arguments '{}' not found. On Tue, Apr 9, 2013 at 5:34 PM, Sithem

Re: {% url %} template tag not resolving app url in template

2013-04-09 Thread Sithembewena Lloyd Dube
Hi all, I have the correct url, but the dev server seems to be caching my old template, even though I updated it to include namespacing. I have restarted the server and cleared my browser cache. contacts On Tue, Apr 9, 2013 at 5:11 PM, Sithembewena Lloyd Dube wrote: > Tom, > > The latter. I di

Re: {% url %} template tag not resolving app url in template

2013-04-09 Thread Sithembewena Lloyd Dube
Tom, The latter. I did not call reverse explicitly (not yet). I have implemented namespacing as recommended. Contact Us On Tue, Apr 9, 2013 at 4:59 PM, Tom Evans wrote: > On Tue, Apr 9, 2013 at 3:56 PM, Sithembewena Lloyd Dube > wrote: > > Hi Tom, > > > > I see what you meant. In the docum

Re: {% url %} template tag not resolving app url in template

2013-04-09 Thread Tom Evans
On Tue, Apr 9, 2013 at 3:56 PM, Sithembewena Lloyd Dube wrote: > Hi Tom, > > I see what you meant. In the documentation (tutorial) namespacing is used in > the form example. Even with that in place, I am having trouble. > > I did notice that I am not getting a 404 error instead, because the url >

Re: {% url %} template tag not resolving app url in template

2013-04-09 Thread Tom Evans
On Tue, Apr 9, 2013 at 3:43 PM, Sithembewena Lloyd Dube wrote: > Thanks, Tom. > > I am not sure how you mean? In the contact_us app, I am not explicitly > calling reverse. I only have the following: > > from django.shortcuts import render, reverse > > def contact_us(request): > return render(r

Re: {% url %} template tag not resolving app url in template

2013-04-09 Thread Sithembewena Lloyd Dube
"contact_us")), >> > >> > and in the contact_us app's urls.py file, I have the following url >> pattern: >> > >> > urlpatterns = patterns('', >> > url(r'^$', views.contact_us, name='contact_us'), >>

Re: {% url %} template tag not resolving app url in template

2013-04-09 Thread Sithembewena Lloyd Dube
namespace="contact_us")), >> > >> > and in the contact_us app's urls.py file, I have the following url >> pattern: >> > >> > urlpatterns = patterns('', >> > url(r'^$', views.contact_us, name='contact_us'

Re: {% url %} template tag not resolving app url in template

2013-04-09 Thread Sithembewena Lloyd Dube
x27;contact_us.urls', namespace="contact_us")), > > > > and in the contact_us app's urls.py file, I have the following url > pattern: > > > > urlpatterns = patterns('', > > url(r'^$', views.contact_us, name='con

Re: {% url %} template tag not resolving app url in template

2013-04-09 Thread Tom Evans
_us app's urls.py file, I have the following url pattern: > > urlpatterns = patterns('', > url(r'^$', views.contact_us, name='contact_us'), > ) > > In a template residing in the contact_us app's own templates folder, I use > the ur

Re: {% url %} template tag not resolving app url in template

2013-04-09 Thread Andrey Kostakov
t;contact_us")), >> > >> > and in the contact_us app's urls.py file, I have the following url >> > pattern: >> > >> > urlpatterns = patterns('', >> > url(r'^$', views.contact_us, name='contact_us'), &

Re: {% url %} template tag not resolving app url in template

2013-04-09 Thread Sithembewena Lloyd Dube
> > > urlpatterns = patterns('', > > url(r'^$', views.contact_us, name='contact_us'), > > ) > > > > In a template residing in the contact_us app's own templates folder, I > use > > the url template tag as follows: > &

Re: {% url %} template tag not resolving app url in template

2013-04-09 Thread Andrey Kostakov
s")), > > and in the contact_us app's urls.py file, I have the following url pattern: > > urlpatterns = patterns('', > url(r'^$', views.contact_us, name='contact_us'), > ) > > In a template residing in the contact_us app's own templa

{% url %} template tag not resolving app url in template

2013-04-09 Thread Sithembewena Lloyd Dube
;^$', views.contact_us, name='contact_us'), ) In a template residing in the contact_us app's own templates folder, I use the url template tag as follows: Contact Us resulting in the following exception: *NoReverseMatch at /contact_us/* Reverse for 'contact_us' with

Re: 'url' template tag throws and error after upgrading to 1.4

2013-04-04 Thread Bastian
I am trying now in a brand new environment, I have set up a new os, a new virtualenv with all the dependencies upgraded to latest versions, and I installed the project from the repository. It loads with debug = False, quite strange. I need it to work with debug = True and I want to understand wh

Re: 'url' template tag throws and error after upgrading to 1.4

2013-04-04 Thread Bastian
I'm not sure what you mean with 'connect to views'. In this case Django is complaining about the URL tags, the first one that gives an error tries to load django.views.i18n.javascript_catalog. When I manage.py shell I can do from django.views import * without problem. I really have no clue, may

Re: 'url' template tag throws and error after upgrading to 1.4

2013-04-04 Thread Mark Furbee
Can you run manage.py shell and connect to 'views?' On Thu, Apr 4, 2013 at 4:13 PM, Mark Furbee wrote: > It would appear to me that your missing the path to django in your > environment. When you upgraded did you also upgrade to another version of > Python, perhaps? Is the dist-packages/site-pa

  1   2   3   4   5   6   7   >