Re: How To expertise Django templates Language(DTL)

2022-05-23 Thread Mike Dewhirst
On 24/05/2022 4:30 am, waqar khan wrote: How To expertise Django templates Language(DTL) Kindy help me, i am intermediate DTL , any budy suggest link , you  tube video or books. This is likely your best bet ... https://docs.djangoproject.com/en/4.0/topics/templates/ -- You received this

How To expertise Django templates Language(DTL)

2022-05-23 Thread waqar khan
How To expertise Django templates Language(DTL) Kindy help me, i am intermediate DTL , any budy suggest link , you tube video or books. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiv

Re: What methods are available to determining display type & screen dimensions for dynamic formatting of Django templates.

2022-03-17 Thread Jason
It does seem like you're looking for something related to analytics, ie Google Analytics or one of the alternatives. On Thursday, March 17, 2022 at 5:52:14 AM UTC-4 Django2021 wrote: > Increasingly we are finding the need to have reactive Django templates, in > order to present cro

What methods are available to determining display type & screen dimensions for dynamic formatting of Django templates.

2022-03-17 Thread Django2021
Increasingly we are finding the need to have reactive Django templates, in order to present cross platform Django forms and pages to not only desktop users buy also tablet, and mobile phone users. We realize Bootstrap offers breakpoints as a means to control columns, still we are looking for

Re: Reusable django templates

2022-03-14 Thread Heman Okumbo
Can't customize individual templates:the templates inherit all the properties of the base template eg styling and content.I am not able to add custom content to the template that inherits from base template. On Sat, Mar 12, 2022, 21:37 Clive Bruton wrote: > > On 12 Mar 2022, at 17:43, Heman Oku

Re: Reusable django templates

2022-03-12 Thread Clive Bruton
On 12 Mar 2022, at 17:43, Heman Okumbo wrote: How comes I'm not able to modify my templates after extending from a base template.eg can't add extra contents,the template only display contents of the inherited template. Some code might help. It's not really clear to me what you are asking.

Reusable django templates

2022-03-12 Thread Heman Okumbo
How comes I'm not able to modify my templates after extending from a base template.eg can't add extra contents,the template only display contents of the inherited template. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this

"include super" with django templates?

2021-12-30 Thread Nick Farrell
I would like to extend a django template which is used via the include macro. That is, I want to add additional output before or after what would otherwise be emitted. With the normal {% block %} syntax, it's easy to use super to follow the template heirachy similar to __mro__ - but to my knowl

Shouldn't there be a library already for how to render your JS Frontend code into HTML and then insert your Django templates with jinja2 very easily?

2020-06-18 Thread Andrew
Hi all! I'm no frontend person, but I do help triage issues in djangorestframework-simplejwt. It's probably one of the most used authentication library for DRF users and most of all frontend framework devs of Django (i.e. React, Angular, Vue). I've been getting lots of comments about issue #1

Re: Can we use python related api's on the Django templates ?

2020-05-27 Thread Derek
While you cannot use Python operators and functions directly in the templates, you can write your own "wrappers" around those you need: https://docs.djangoproject.com/en/3.0/howto/custom-template-tags/ On Wednesday, 27 May 2020 15:57:34 UTC+2, Daniel Roseman wrote: > > On Wednesday, 27 May 2020

Re: Can we use python related api's on the Django templates ?

2020-05-27 Thread Daniel Roseman
On Wednesday, 27 May 2020 13:21:24 UTC+1, ratnadeep ray wrote: > > Hi all, > > Currently I am trying to print the type of a variable from the Django > template html file as follows: > > The type of feature list report for version >> {%type(version)%} is > > > For the above, I am getting the

Can we use python related api's on the Django templates ?

2020-05-27 Thread ratnadeep ray
Hi all, Currently I am trying to print the type of a variable from the Django template html file as follows: The type of feature list report for version > {%type(version)%} is For the above, I am getting the following error: Invalid block tag on line 9: 'type(version)'. Did you forget

Re: django templates stop to working html autocomplete

2020-05-07 Thread Carson
What do you want to autocomplete but not? If you use Python as the main language, It so recommends that you convert IDE to PyCharm. Eren ARTUÇ於 2020年5月8日星期五 UTC+8上午7時09分18秒寫道: > > hello everyone, > > Im using Vs.Code. When i enabled to django templates, my HTML autocomlete >

django templates stop to working html autocomplete

2020-05-07 Thread Eren ARTUÇ
hello everyone, Im using Vs.Code. When i enabled to django templates, my HTML autocomlete doesnt work. i want to work Python and HTML at the same time. How can i solve this problem ? Do you have any idea ? -- You received this message because you are subscribed to the Google Groups "D

Security question: Can Django templates be used to execute arbitrary code on the server?

2020-05-05 Thread jrief
Is it safe to keep Django template strings inside a TextField of a Django model and allow users with staff privileges to edit them? I'm asking because I'm unsure how safe/dangerous this could be. Would it be possible to abuse a built-in templatetag to execute arbitrary code on the server? What

Re: [Django] How to traverse through query set in java script using django templates?

2019-12-09 Thread Andréas Kühne
This is a strange way to do things - but all you need to do is to add a template for loop in the javascript part of your template. For example: {% for gsp in apply_gsp_model %} var value1 = {% gsp.id %}; {% endfor %} What will happen then is that the iteration will create that line fo

[Django] How to traverse through query set in java script using django templates?

2019-12-06 Thread Dilipkumar Noone
Hi, I have a model named ApplyGSP in models.py. *In my views.py:* apply_gsp_model = ApplyGSP.objects.all() context = {'form': form,'apply_gsp_model':apply_gsp_model, 'Message': message, 'action': action} if action == 'edit': print("action is edit") return render(request, 'EditApplyGSP

Re: Django templates render

2018-09-02 Thread Kasper Laudrup
Hi Ronak, On 02/09/2018 08.24, RONAK JAIN wrote: Thanks for reply Firar of all i need here I want to make relation between projects and categories. You can look attached HTML page picture there categories parts three attributes digital, print or branding and projects are there show pictures or

Re: Django templates render

2018-09-01 Thread RONAK JAIN
Thanks for reply Firar of all i need here I want to make relation between projects and categories. You can look attached HTML page picture there categories parts three attributes digital, print or branding and projects are there show pictures or pictures name. 1. How can I make expect relation bet

Re: Django templates render

2018-09-01 Thread Jason
I'm sorry, I have no idea what you're trying to do. what exactly is correct relationship and what is different from the render output that you desire? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop rec

Re: how i set pagination's in django templates

2018-06-14 Thread Jason
https://simpleisbetterthancomplex.com/tutorial/2016/08/03/how-to-paginate-with-django.html On Thursday, June 14, 2018 at 3:19:11 AM UTC-4, arvind yadav wrote: > > hello > I want set pagination in Django templates > my data format is directory > dict = {'a': 123, &#x

how i set pagination's in django templates

2018-06-14 Thread arvind yadav
hello I want set pagination in Django templates my data format is directory dict = {'a': 123, 'b': 12,'c': 123, 'd': 12,'e': 123, 'f': 12,'g': 123, 'h': 12,'i': 123, 'j': 12,'k': 1

Re: Setting up Django templates

2018-05-21 Thread Daniel Roseman
On Sunday, 20 May 2018 15:31:08 UTC+1, Salty beggar wrote: > > Hi, I'm trying to set up Templates for Django. I already have models and > views that function, and now I'm trying to figure out a way to get an > actual page to show for it. > > > > The views return JSON-formatted information,

Setting up Django templates

2018-05-20 Thread Salty beggar
Hi, I'm trying to set up Templates for Django. I already have models and views that function, and now I'm trying to figure out a way to get an actual page to show for it. My models are from django.db import models class Continent(models.Model): name = models.CharField(max_length=60, de

Re: Django Templates and Conditional CSS classes

2017-11-11 Thread PASCUAL Eric
make big rivers :) Eric From: django-users@googlegroups.com on behalf of treyd Sent: Saturday, November 11, 2017 20:49 To: Django users Subject: Re: Django Templates and Conditional CSS classes Omar (and everybody else who responded), Thanks for that ideas

Re: Django Templates and Conditional CSS classes

2017-11-11 Thread treyd
Omar (and everybody else who responded), Thanks for that ideas and putting a method on the model to return the appropriate CSS class based on the state. I think that would be the cleanest solution if I am going to bite the bullet and put this template-specific logic on the model. It got me th

Re: Django Templates and Conditional CSS classes

2017-11-11 Thread Omar Helal
Hi treyd, I think idea of updating the model and storing it in the db is a bit overkill, however you could create an @propery on the model that will do that logic for you and return the css class for you. e.g. @property def css_class(self): if self.state is SUCHANDSUCH: return "label-soan

Re: Django Templates and Conditional CSS classes

2017-11-10 Thread treyd
Thanks, all, for the info. Looks like the best way to clean this up is to make the model have some knowledge of the CSS class I want to use and make a method to get it. I like that, but I was unsure about sticking view information into the model. Probably the best solution is javascript logic

Re: Django Templates and Conditional CSS classes

2017-11-10 Thread Vijay Khemlani
You can also add a "state_css_class" (or something) method to your object class and just call ... the method should be quite simple On Fri, Nov 10, 2017 at 7:01 PM, Adam Simon wrote: > > You can pass the class from either the model or the view into the > template. For example, you can assign

Re: Django Templates and Conditional CSS classes

2017-11-10 Thread Adam Simon
You can pass the class from either the model or the view into the template. For example, you can assign a class to a button with a variable: <|button> And then the class would have to be defined in your style somewhere On Fri, Nov 10, 2017 at 1:37 PM treyd wrote: > At some point I plan on fig

Re: Django Templates and Conditional CSS classes

2017-11-10 Thread treyd
At some point I plan on figuring out how to do more intelligent front-end in-browser stuff (Angular, etc) which yeah would definitely help me here but I was wondering if there was a Django-only way of doing this. On Friday, November 10, 2017 at 3:51:09 PM UTC-5, Adam wrote: > > > Are you open to

Re: Django Templates and Conditional CSS classes

2017-11-10 Thread Adam Simon
Are you open to using JavaScript in the front end? It would make it really easy On Fri, Nov 10, 2017 at 12:40 PM treyd wrote: > Hello, > > I am trying to render a model field in a django template, and, based on > the value of the field, I want to specify a different CSS class. Right > now, my s

Django Templates and Conditional CSS classes

2017-11-10 Thread treyd
Hello, I am trying to render a model field in a django template, and, based on the value of the field, I want to specify a different CSS class. Right now, my solution is this: {{ myobject.state }} This works, but seems like a really ugly solution and a bunch of logic in the template. Is the

Re: What is the use of parent_template filter in Django templates

2016-11-16 Thread Andrew Pinkham
On Nov 1, 2016, at 10:26 AM, Prateek wrote: > I am reading Django Unleashed in which the author uses the following code to > extends the template > > {% extends parent_template|default:"organizer/base_organizer.html" %} > > What does parent_template do ? Hi Prateek, Thanks for buying my book!

Re: What is the use of parent_template filter in Django templates

2016-11-01 Thread ludovic coues
Is there any variable called parent_template in the context ? 2016-11-01 15:26 GMT+01:00 Prateek : > I am reading Django Unleashed in which the author uses the following code to > extends the template > > {% extends parent_template|default:"organizer/base_organizer.html" %} > > > What does parent_

What is the use of parent_template filter in Django templates

2016-11-01 Thread Prateek
I am reading Django Unleashed in which the author uses the following code to extends the template {% extends parent_template|default:"organizer/base_organizer.html" %} What does parent_template do ? I am unable to find this tag in the Django Documentation

Re: Django templates

2015-11-01 Thread Humphrey Butau
The templates work on any platform, try Django cookie cutter! -- 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 post

Re: Django templates

2015-10-31 Thread Andreas Kuhne
Hi, There aren't any specific templates for windows or any other operating system. Django runs on a webserver and is compatible regardless of OS. I would recommend that you look at the tutorial and see how to get started: https://docs.djangoproject.com/en/1.8/intro/tutorial01/ Regards, Andréas

Django templates

2015-10-31 Thread misheck mujeyi
hi guys a still very new to django so i was wondering is ter a link where i can find Djnago windows templates -- 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

Re: Possible bug in interaction between 'block' and 'include' in Django Templates

2015-09-10 Thread Suriya Subramanian
I got the answer on IRC that this is not a bug as explained in the documentation for include https://docs.djangoproject.com/en/1.8/ref/templates/builtins/#include Suriya On Thursday, September 10, 2015 at 2:55:42 PM UTC+5:30, Suriya Subramanian wrote: > > Hi, > > I think there is a bug in how

Possible bug in interaction between 'block' and 'include' in Django Templates

2015-09-10 Thread Suriya Subramanian
Hi, I think there is a bug in how 'block' and 'include' template tags interact in the Django Template Language. I have created a Gist showing this issue: https://gist.github.com/anonymous/2627bb35955db77dbfaa The order of the files in the Gist can be a bit confusing. I will explain what I am t

Re: django templates

2014-07-22 Thread ngangsia akumbo
please give me an exmaple , all my urls for the various apps are all in the main project urls file On Tuesday, July 22, 2014 12:37:37 PM UTC+1, Akshay Mukadam wrote: > > > > On Tuesday, July 22, 2014 1:20:14 PM UTC+5:30, ngangsia akumbo wrote: >> >> Hi Django Users >> >> I have a question. >> >>

Re: django templates

2014-07-22 Thread Akshay Mukadam
On Tuesday, July 22, 2014 1:20:14 PM UTC+5:30, ngangsia akumbo wrote: > > Hi Django Users > > I have a question. > > I have created all my apps for my websites which are events , blog, and > gallery. > They all extends to the base.html file . > > From my development server i can access this in

Re: django templates

2014-07-22 Thread ngangsia akumbo
Ok i have created all my apps and extended to the base.html file so what next? On Tuesday, July 22, 2014 8:50:14 AM UTC+1, ngangsia akumbo wrote: > > Hi Django Users > > I have a question. > > I have created all my apps for my websites which are events , blog, and > gallery. > They all exten

django templates

2014-07-22 Thread ngangsia akumbo
Hi Django Users I have a question. I have created all my apps for my websites which are events , blog, and gallery. They all extends to the base.html file . >From my development server i can access this individual app by just typing localhost:8000/blogs and the blog template will appear. My

Re: imagens com django templates

2014-07-15 Thread erico
No settings.py MEDIA_ROOT = os.path.join(ROOTDIR, 'media') MEDIA_URL = '/media/' urls.py # arquivos de media-uploads (r'^media/(.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}), no .html {% for item in lista_itens %} {% endfor %} Altera imagem =

imagens com django templates

2014-07-14 Thread Carlos Andre
Olá pessoal, estou tentando usar um slideshow e uso um for para iterar as imagens que passam vidas de um repositório, problemas que funciona sem o comando for no template, quando adiciono ele mostra nada para! Pelo que vejo há problemas no reconhecimento dos comandos de templates, caso como o que t

Re: Django Templates: Using the "with" statement and "block.super" together

2013-09-24 Thread Russell Keith-Magee
On Wed, Sep 25, 2013 at 1:59 AM, Warren Smith wrote: > On occasion, I've used the following technique in my django templates: > > # parent.html > > {% block someblock %} > …stuff… > {% if cool_optional_feature_is_enabled %} > …optional stuff... > {% en

Re: Django Templates: Using the "with" statement and "block.super" together

2013-09-24 Thread Vijay Katam
Seems legit to me. Some documentation could help get more usage. On Tuesday, September 24, 2013 12:59:27 PM UTC-5, Warren Smith wrote: > > On occasion, I've used the following technique in my django templates: > > # parent.html > > {% block someblock

Re: Django Templates: Using the "with" statement and "block.super" together

2013-09-24 Thread Tomas Ehrlich
I use it too. Maybe it would be nice to document it somewhere. Cheers, Tom Dne Tue, 24 Sep 2013 10:59:27 -0700 (PDT) Warren Smith napsal(a): > On occasion, I've used the following technique in my django templates: > > # parent.html > > {% block someblock %}

Re: Django Templates: Using the "with" statement and "block.super" together

2013-09-24 Thread Bill Freeman
PM, Warren Smith wrote: > On occasion, I've used the following technique in my django templates: > > # parent.html > > {% block someblock %} > …stuff… > {% if cool_optional_feature_is_enabled %} > …optional stuff... > {% endif %} > …stuff... >

Django Templates: Using the "with" statement and "block.super" together

2013-09-24 Thread Warren Smith
On occasion, I've used the following technique in my django templates: # parent.html {% block someblock %} …stuff… {% if cool_optional_feature_is_enabled %} …optional stuff... {% endif %} …stuff... {% endblock %} # child.html {% extends "parent.html" %} {%

Re: django templates

2013-07-17 Thread Kamal Kaur
On Wed, Jul 17, 2013 at 9:13 PM, Harjot Mann wrote: > It is used only for one report and there is some error,so it is there > but not working. Then fix it! -- Kamaljeet Kaur Blog:http://kamalkaur188.wordpress.com/ -- You received this message because you are subscribed to the Google Groups

Re: django templates

2013-07-17 Thread Harjot Mann
On Wed, Jul 17, 2013 at 8:26 PM, Kamal Kaur wrote: > Hope this helps: > https://docs.djangoproject.com/en/dev/howto/outputting-pdf/ > > http://stackoverflow.com/questions/1377446/html-to-pdf-for-a-django-site @ Kamal thnks but its already there. -- Harjot Kaur Mann Blog: http://harjotmann.wordp

Re: django templates

2013-07-17 Thread Harjot Mann
On Wed, Jul 17, 2013 at 8:53 PM, Kamal Kaur wrote: > It must work if it is there?? It is used only for one report and there is some error,so it is there but not working. -- Harjot Kaur Mann Blog: http://harjotmann.wordpress.com/ -- You received this message because you are subscribed to the G

Re: django templates

2013-07-17 Thread Tom Evans
On Wed, Jul 17, 2013 at 4:01 PM, Harjot Mann wrote: > On Wed, Jul 17, 2013 at 8:20 PM, Tom Evans wrote: >> Does your website currently produce pdfs, or are you asking how to >> turn multiple HTML pages from your site into a single PDF? > > > Yes, I want this it has reportlab and pisa modules to p

Re: django templates

2013-07-17 Thread Kamal Kaur
On Wed, Jul 17, 2013 at 8:33 PM, Harjot Mann wrote: > @ Kamal thnks but its already there. It must work if it is there?? -- Kamaljeet Kaur Blog:http://kamalkaur188.wordpress.com/ -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscrib

Re: django templates

2013-07-17 Thread Kamal Kaur
On Wed, Jul 17, 2013 at 8:04 PM, Harjot Mann wrote: > No, this is not admin problem. I am getting the reports templates but > these are not saved anywhere, valuse are coming from database. But I > want to take the print outs i.e the hard copy of all the reports which > are made till now by saving

Re: django templates

2013-07-17 Thread Harjot Mann
On Wed, Jul 17, 2013 at 8:20 PM, Tom Evans wrote: > Does your website currently produce pdfs, or are you asking how to > turn multiple HTML pages from your site into a single PDF? Yes, I want this it has reportlab and pisa modules to produce pdfs. -- Harjot Kaur Mann Blog: http://harjotmann.wor

Re: django templates

2013-07-17 Thread Larry Martell
On Wed, Jul 17, 2013 at 8:34 AM, Harjot Mann wrote: > On Wed, Jul 17, 2013 at 6:46 PM, Derek wrote: >> One option is to use a Django admin action - the user selects which job/jobs >> are needed from the usual list - >> and your action can then generate the data, passing this into a single >> "mas

Re: django templates

2013-07-17 Thread Tom Evans
On Wed, Jul 17, 2013 at 3:34 PM, Harjot Mann wrote: > No, this is not admin problem. I am getting the reports templates but > these are not saved anywhere, valuse are coming from database. But I > want to take the print outs i.e the hard copy of all the reports which > are made till now by saving

Re: django templates

2013-07-17 Thread Harjot Mann
On Wed, Jul 17, 2013 at 6:46 PM, Derek wrote: > One option is to use a Django admin action - the user selects which job/jobs > are needed from the usual list - > and your action can then generate the data, passing this into a single > "master template" (composite of your other templates) for the u

Re: django templates

2013-07-17 Thread Derek
One option is to use a Django admin action - the user selects which job/jobs are needed from the usual list - and your action can then generate the data, passing this into a single "master template" (composite of your other templates) for the user to print (or you could have an action just to g

Re: django templates

2013-07-17 Thread Daniel Oźminkowski
Hello, I am a beginner, but this looks like a job for custom admin command: https://docs.djangoproject.com/en/1.5//howto/custom-management-commands/ I found it very easy, so it should also be easy for you. Best regards, Daniel W dniu wtorek, 16 lipca 2013 18:43:42 UTC+2 użytkownik Harjot Mann

django templates

2013-07-16 Thread Harjot Mann
In my project the lab reports, reciepts, and bills are made from html templates but thse are not saved anywhere but now I need to take the print outs of all the reports which are made till now for example form job_id 30 to 400. I want to make function for this so that it can be done in a one script

django templates

2013-06-25 Thread Harjot Mann
I have created a table in django templates but I want that the fields which are not filled from form should not be display in table not even the border and header of that field also. The headers are static while the data is coming from database. I used if and for loop for this but whenever I

Re: How can I divide a page into multiple parts using multiple html files and django templates?

2013-04-25 Thread Nikolas Stevenson-Molnar
I'm not sure I understand your end goal. You /can/ extend your includes, you'd just include the extended template. E.g.: sidenav_base.html sidenav_specific.html {% extends "sidenav_base.html" %} base.html {% include "sidenav_specific.html" %} Or if you're then extending base.html and want a d

Re: How can I divide a page into multiple parts using multiple html files and django templates?

2013-04-25 Thread bilgehan . balban
Let us assume that I have 5 files like this that are included by base.html via "include". How would I then extend each of those? Looks like once you include a couple pages, you have no way of extending them each, because you have to render one child template. Perhaps the best practice is to mix

Re: How can I divide a page into multiple parts using multiple html files and django templates?

2013-04-25 Thread Nikolas Stevenson-Molnar
The include would probably help you here: https://docs.djangoproject.com/en/1.5/ref/templates/builtins/#include _Nik On 4/25/2013 11:56 AM, bilgehan.bal...@gmail.com wrote: > Hi, > > I want to divide a page into parts, such as sidenav.html, topnav.html > and so on such that the base.html is not c

How can I divide a page into multiple parts using multiple html files and django templates?

2013-04-25 Thread bilgehan . balban
Hi, I want to divide a page into parts, such as sidenav.html, topnav.html and so on such that the base.html is not cluttered with details of the complex topnav or sidebar. Problem is Django template inheritence can only have one to one parent child relationship and I cannot have multiple html c

Re: django templates and tex/latex

2013-03-16 Thread thanos
On Thu, Mar 14, 2013 at 9:58 AM, Bill Freeman wrote: > Note that you don't have to use the Django template engine to render > things. > > For one thing, if you found a less problematic templating engine, using it > as > well doesn't prevent you from using Django's template engine for other > page

Re: django templates and tex/latex

2013-03-14 Thread Bill Freeman
Note that you don't have to use the Django template engine to render things. For one thing, if you found a less problematic templating engine, using it as well doesn't prevent you from using Django's template engine for other pages. You could also roll your own by coming up with, for example, a T

Re: django templates and tex/latex

2013-03-13 Thread Ken
Actually, that's exactly what I'm trying to do. I have database tables whose columns contain TeX fragments. I am trying to generate various file outputs from database searches - TeX, pdf, etc. I could construct the tex file on the fly with python strings as you suggest but that's rather cumber

Re: django templates and tex/latex

2013-03-13 Thread Drew Ferguson
On Wed, 13 Mar 2013 07:01:45 -0700 (PDT) Ken wrote: > I would like to write a tex/latex file with django tags in it. Load it > with the template loader and render it with a context. The problem is > that my tex/latex file has quite a few '{%' in them. They are > conventional in TeX for writi

Re: django templates and tex/latex

2013-03-13 Thread Tom Evans
gt; Nope. Well, of course, you can fork and change Django itself, but > there be many edge cases where > Damn: … but there may be many edge cases where simply changing the tokens where they are defined (django/templates/base.py) may not work correctly. Cheers Tom -- You received this messa

Re: django templates and tex/latex

2013-03-13 Thread Tom Evans
On Wed, Mar 13, 2013 at 2:01 PM, Ken wrote: > I would like to write a tex/latex file with django tags in it. Load it with > the template loader and render it with a context. The problem is that my > tex/latex file has quite a few '{%' in them. They are conventional in TeX > for writing readabl

django templates and tex/latex

2013-03-13 Thread Ken
I would like to write a tex/latex file with django tags in it. Load it with the template loader and render it with a context. The problem is that my tex/latex file has quite a few '{%' in them. They are conventional in TeX for writing readable macros and are used to escape the newline. I c

Re: django templates - iterate over several lists

2013-03-08 Thread Roberto López López
Thank you very much! On 03/08/2013 03:12 PM, Javier Guerra Giraldez wrote: > On Fri, Mar 8, 2013 at 5:07 AM, Roberto López López > wrote: >> I'd like to avoid having to concatenate them in the view and pass that >> as another parameter. > > > two ideas come to mind: > > - itertools.chain() o

Re: django templates - iterate over several lists

2013-03-08 Thread Javier Guerra Giraldez
On Fri, Mar 8, 2013 at 5:07 AM, Roberto López López wrote: > I'd like to avoid having to concatenate them in the view and pass that > as another parameter. two ideas come to mind: - itertools.chain() on the view. it's equivalent to concatenating, but done lazily, so there's _very_ little overh

django templates - iterate over several lists

2013-03-08 Thread Roberto López López
Hi, How can I iterate over several list objects available in my template? I'd like to avoid having to concatenate them in the view and pass that as another parameter. I mean something like this: {% for x in list1, list2, list3... listN %} {% if not forloop.first %}, {% endif %}write som

Re: Compile/generate JavaScript from Django Templates?

2012-08-07 Thread Melvyn Sopacua
On 7-8-2012 10:52, Alec Taylor wrote: > To completely decouple the client-side, would it be possible to > generate JavaScript from the server-side Django Template? The template documentation explicitly tells you it can generate *any* text-based format. [1] A few threads ago I gave an example and p

Compile/generate JavaScript from Django Templates?

2012-08-07 Thread Alec Taylor
simplify things a lot and prevent double typing thought if it is possible to compile/generate JavaScript from Django Templates. Thanks for all information, Alec Taylor -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this g

Re: Custom tag inside a block tag. Django templates

2012-06-10 Thread Даниил Рыжков
Can you please submit error you get? {{ var }} is for varaibles, not for tags. 2012/6/11 David Gómez > Hello everyone. > > In Django 1.2.5 I had something like: > > {% block contact %} > rel="stylesheet" /> > {% endblock %} > > Where custom_tag returns a single url. Now, in Django 1.4 this is n

Custom tag inside a block tag. Django templates

2012-06-10 Thread David Gómez
Hello everyone. In Django 1.2.5 I had something like: {% block contact %} {% endblock %} Where custom_tag returns a single url. Now, in Django 1.4 this is not working and I have to change {% custom_tag %} for {{ custom_tag }} in order to make it work. Why? Best regards, David Gómez. -- You

Re: Best Practices: How to best implement Rating-Stars in Django Templates

2012-05-14 Thread DragonFly
thanks, i will see it -- 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 django-users+unsubscr...@googlegroups.com. For more options,

Re: Best Practices: How to best implement Rating-Stars in Django Templates

2012-05-14 Thread Kai Diefenbach
On 2009-10-31 14:40:05 +, David said: I would like to have reusable ratings (typical layout with 5 stars). FWIW, https://github.com/diefenbach/django-reviews Kai -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, se

Re: Best Practices: How to best implement Rating-Stars in Django Templates

2012-05-14 Thread Trần Quang Thắng
hi Ethan, can you reup [5] http://pastebin.ca/1650596 [6] http://pastebin.ca/1650609 [7] http://pastebin.ca/1650616 , thanks you :) -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web v

Re: Best Practices: How to best implement Rating-Stars in Django Templates

2012-05-14 Thread Trần Quang Thắng
Hi Ethan, can u reup your code demo rating star ? Thanks you :) -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/JcRqI9Ne9JcJ. To post to this group, send em

Re: Display Video inside a Text field -Django Templates

2012-04-28 Thread Nikhil Verma
jquery with lots of pain because i was not able to find any good solution. Do you think jquery is the write approach. Can you give some links how do we use youtube api integration with django templates On Sun, Apr 29, 2012 at 1:09 AM, Pratik Mandrekar wrote: > Hi, > > You wil

Re: Display Video inside a Text field -Django Templates

2012-04-28 Thread Pratik Mandrekar
Hi, You will need to identify the video url in the post, then depending on the url try do some processing, like getting the title or thumbnail and render it back to your template. If you want to play the video, you will need a video player. Eg. If it is a youtube link, then embed the youtube playe

Display Video inside a Text field -Django Templates

2012-04-27 Thread Nikhil Verma
Hi All I have a TextField to which after applying css it looks like a markup editor where i write some text, paste file links upload image etc.Now if the user paste a video link to that editor the video should display inide that editor/TextField like in other websites eg: facebook(On click Video

Re: Any tool to validate django templates?

2012-04-16 Thread Marcin Tustin
his help? > > http://stackoverflow.com/questions/3086637/how-should-i-validate-html-in-django-templates-during-the-development-process > > I quite like the not-accepted-as-answer. Just go through your urls. > Essentially, you have two types of possible template errors: > > 1. human

Re: Any tool to validate django templates?

2012-04-16 Thread Mario Gudelj
PyCharm does a very good job here when it comes to highlighting and error detection in templates. Try it out. On 17 April 2012 01:12, John Yeukhon Wong wrote: > Would this help? > > http://stackoverflow.com/questions/3086637/how-should-i-validate-html-in-django-templates-during-the-de

Re: Any tool to validate django templates?

2012-04-16 Thread John Yeukhon Wong
Would this help? http://stackoverflow.com/questions/3086637/how-should-i-validate-html-in-django-templates-during-the-development-process I quite like the not-accepted-as-answer. Just go through your urls. Essentially, you have two types of possible template errors: 1. human errors (missing a

Re: Any tool to validate django templates?

2012-04-16 Thread william ratcliff
Wing IDE also highlights templates. On Apr 16, 2012 3:16 AM, "Matt Schinckel" wrote: > Generally, I just use syntax highlighting in my text editor: that usually > helps me find errors. > > TextMate has a nice HTML (Django Template) mode. > > Matt. > > > On Monday, April 16, 2012 2:12:14 AM UTC+9:

Re: Any tool to validate django templates?

2012-04-16 Thread Matt Schinckel
Generally, I just use syntax highlighting in my text editor: that usually helps me find errors. TextMate has a nice HTML (Django Template) mode. Matt. On Monday, April 16, 2012 2:12:14 AM UTC+9:30, Marcin wrote: > > Hi all, > > I've got a template that isn't parsing, but the error is the > no

Any tool to validate django templates?

2012-04-15 Thread Marcin Tustin
Hi all, I've got a template that isn't parsing, but the error is the nondescript: TemplateSyntaxError: Could not parse the remainder: '"{%' from '"{%' Is there a tool that can help locate the source of the error? Marcin -- Marcin Tustin Tel: 07773 787 105 -- You received this message because

Re: using django templates to generate and replace a file

2012-03-01 Thread Paul Bunker
Thanks Kurtis, It seems so obvious now! :-) I can do ... t = Template(open('users.template').read()) c = Context([get the users from db]) open('users.cfg','w').write(t.render(c)) Thanks for your speedy response! It seems I couldn't see the wood for the trees -Paul On Feb 29, 8:24 pm, Kurtis Mu

Re: using django templates to generate and replace a file

2012-02-29 Thread Kurtis Mullins
Hey, I just thought I'd give you a quick reply. First, you can save the rendered output of a template using this: https://docs.djangoproject.com/en/1.3/ref/templates/api/#rendering-a-context Then, take that String and write over that 'users.cfg' file. For example, http://docs.python.org/tutoria

using django templates to generate and replace a file

2012-02-29 Thread Paul Bunker
Hi Django Users, I'd like to use the django template system to generate a file 'users.cfg' that gets read some dispatching software. Is it possible to get django to generate this file and replace the existing one? Thanks -Paul -- You received this message because you are subscribed to the Goog

  1   2   3   >