Re: Templates: Looping, ifs and defaults

2010-03-24 Thread ALJ
Hi Paulo, The 'if' test has to fall within the "for sale in sales" loop, because it's testing the values of the the sale. However, if there is no match, then the default is triggered. Therefore I will get as many defaults as there are sales (-1 if there is a match). Nesting {% if %} 's won't work.

Re: Templates: Looping, ifs and defaults

2010-03-24 Thread Paulo Almeida
I don't understand why is it obvious that an 'else' won't work. If a single {% else %} is not what you want, you can nest {% if %} clauses. But if you are doing this it can also mean that you should move this logic to the view and just pass the final table to the template. - Paulo On Wed, Mar 24,

Templates: Looping, ifs and defaults

2010-03-24 Thread ALJ
I have a template that shows a matrix table of form text input boxes. When the form is new, then it should be just empty text boxes. If data already exists, then the form gets repopulated with data. What I am looking for it this: PRODUCTS | DAY1 | DAY2 | DAY3 POLO | Empty text box | 3 | 3 PASSAT

Re: Event more complicated forms / templates

2010-03-22 Thread Paulo Almeida
You could use inline formsets (have CustomerContactAnswer be a formset of CustomerContactQuestion) and then render the Answer forms as a table in the template. - Paulo On Mon, Mar 22, 2010 at 1:31 PM, ALJ wrote: > Is there any to have a table type form will variable rows and columns? > > I have

Event more complicated forms / templates

2010-03-22 Thread ALJ
Is there any to have a table type form will variable rows and columns? I have events. For each event there might be several appointment days. And a set of questions to measure how many people the rep had contact with. My expected form output would be something like: Question,

Re: MEDIA_URL is not pushed to templates

2010-03-15 Thread Bobby Roberts
ah... my media processor got shot somehow On Mar 15, 7:51 pm, Bobby Roberts wrote: > hi group... got a strange situation.  MEDIA_URL is not being pushed to > the templates for some reason. > > In my settings file i have > > MEDIA_URL='/static/' > ..

MEDIA_URL is not pushed to templates

2010-03-15 Thread Bobby Roberts
hi group... got a strange situation. MEDIA_URL is not being pushed to the templates for some reason. In my settings file i have MEDIA_URL='/static/' ... TEMPLATE_CONTEXT_PROCESSORS=( 'django.core.context_processors.request',) and in the template i am specifying it as {{

Re: templates?

2010-03-10 Thread lalla
Hello jirka, i could not get through the error. But when i run python manage.py shell.. and do the same.i aint getting any errors. what should i put in PYTHONPATH? to make it run through only python.How to configure the things manually. Thanx in advance On Mar 11, 2:41 am, Jirka Vejrazka wrote: >

Re: templates?

2010-03-10 Thread Jirka Vejrazka
> DJANGO_SETTINGS_MODULE=C:/django/Django-1.1.1/djangotest/mysite/settings Oops - I take it back (it's been a long day). You need to supply Python path, i.e just "mysite.settings" if you PYTHONPATH is already set to PYTHONPATH=C:\django\Django-1.1.1\djangotest and mysite is a directory there.

Re: templates?

2010-03-10 Thread Jirka Vejrazka
Hi Nadeesh, you need to use forward slashes, even on Windows (or double-backslashes). So, changing to: DJANGO_SETTINGS_MODULE=C:/django/Django-1.1.1/djangotest/mysite/settings might solve your problem, assuming everything else is OK. Cheers Jirka -- You received this message becaus

templates?

2010-03-10 Thread Nadeesh Kumar
I've setup an environmental variable DJANGO_SETTINGs_MODULE=C:\django\Django-1.1.1\djangotest\mysite\settings and PYTHONPATH=C:\django\Django-1.1.1\djangotest I also edited the registry key value for PYTHONPATH I've got these errors. Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001

Using Cheetah Templates in django

2010-03-08 Thread srini
hi all, do anybody think that Using Cheetah Templates in django is more than any normal Html Thank you, -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubs

Re: Templates sometimes load at bottom of page

2010-03-03 Thread Shawn Milochik
Dude, I have one word for you, and you've heard it already tonight: virtualenv I do everything on my Mac, and virtualenv and git make it a lot easier than I deserve. Let me know if you need help. Shawn On Mar 3, 2010, at 9:28 PM, timdude wrote: > I know I should do it. But I'm such a noob, t

Re: Templates sometimes load at bottom of page

2010-03-03 Thread timdude
I know I should do it. But I'm such a noob, the idea scares the crap out of me. I've got half a dozen sites hanging off the same code base...which is all .96 dependant. I'll get the time and the guts up one of these days. Cheers, Tim On Mar 3, 5:47 pm, Atamert Ölçgen wrote: > On Wednesday 03 Mar

Re: Templates sometimes load at bottom of page

2010-03-02 Thread Atamert Ölçgen
On Wednesday 03 March 2010 07:58:39 timdude wrote: > I'm using .96. Other than that, what would my problem be? There has been significant changes since 0.96, you should seriously consider upgrading! -- Saygılarımla, Atamert Ölçgen -+- --+ +++ www.muhuk.com mu...@jabber.org -- You receiv

Templates sometimes load at bottom of page

2010-03-02 Thread timdude
Hi, First post, first question. I've been using django for about a year now, learning heaps. My problem: Sometimes pages load...the base template loads fine, but the template inside my base template, sometimes loads with a large gap at the top. All I have to do is refresh the page and all is well

Re: Model Inheritance - best practice for templates?

2010-02-24 Thread fgasperino
mis-clicked, continuing: @register.filter def A_get_B(instance):     if isinstance(instance, B):         return instance.b     try:         return instance.b     except B.DoesNotExist:         return None and lastly, the template: {% with a|A_get_B as b %} {% if b %} .. work with b {% endif

Model Inheritance - best practice for templates?

2010-02-24 Thread fgasperino
ot;, template_object_name = "A", paginate_by = 20), name = "list_As"), I have a pair of templates that view individual, and list, A objects. Should a B object be in the queryset results, I'm rendering additional template content (B.somefield). Currently, I&#x

Re: question regarding blocks in templates

2010-02-23 Thread Shawn Milochik
Both forks are not being executed within the 'if' block. The template is validated before being rendered, and it fails validation so it's not even getting that far. So just put the block tags outside the 'if' block and you will be fine. I'm not clear on what you were getting at in the 'BUT, I a

Re: question regarding blocks in templates

2010-02-23 Thread joep
The relevant part of what I am trying to do is this: {% if form_included %} {% block header %} {{ form.media }} {% endblock %} {{form.as_p}} {% endif %} That is, I have a form with several widgets, each with some javascript and css files attached, but I only want to put them within the b

question regarding blocks in templates

2010-02-23 Thread joep
I ran across some unexpected behavior. I'm using django 1.1. I tried the following: {% if something %} {% block head %} some stuff here... {% endblock %} {% else %} {% block head %} some other stuff here.. {% endblock %} {% endif %} But I get: Exception Type: TemplateSy

Problem when copy django-admin templates directory

2010-02-22 Thread konatufe
I'm trying to change django templates to my own directory templates copying the django-admin templates directory. cp -R /usr/local/lib/python2.6/dist-packages/django/contrib/admin/ templates/admin /home/konatufe/djproyect/djapp/templates/ When do that, I can't see the change_list pag

Re: what if I need to use two objects to get a third object in my templates?

2010-02-21 Thread Jeremy Dillworth
On Feb 21, 11:14 am, Jeremy Dillworth wrote: > and a view named list: > > def list(request): >     people = Person.objects.all() >     for p in people: >         p.columns = [None, None, None] >         for c in DataPoint.objects.filter(person=p, value__gt=4): >             p.columns.append(c) > >

Re: what if I need to use two objects to get a third object in my templates?

2010-02-21 Thread Jeremy Dillworth
You could also put a columns property onto each person object. Given the models: class Person(models.Model): name = models.CharField(max_length=30) class DataPoint(models.Model): person = models.ForeignKey(Person) value = models.IntegerField() and a view named list: def list(reques

Re: what if I need to use two objects to get a third object in my templates?

2010-02-20 Thread Daniel Wong
oo_large %} class="too-large"{% endif > %}> >       {{ person.get(col) }} >     >   {% endfor %} > {% endfor %} > > I know Django templates were intentionally designed to disallow > passing arguments to methods; therefore, I'm assuming there must be a > clean wa

Re: what if I need to use two objects to get a third object in my templates?

2010-02-19 Thread Daniel Wong
in columns %} too_large %} class="too-large"{% endif %}> {{ person.get(col) }} {% endfor %} {% endfor %} I know Django templates were intentionally designed to disallow passing arguments to methods; therefore, I'm assuming there must be a clean way of implementing this exampl

Re: what if I need to use two objects to get a third object in my templates?

2010-02-19 Thread Daniel Roseman
On Feb 19, 8:04 am, Daniel Wong wrote: > Seems like there's no good way to do this, because you can't call > methods that take > 0 arguments. > > Here's an example of the sort of thing I'm trying to do. Imagine > you're trying to create a spreadsheet like view: > > {% for person in people %} >  

what if I need to use two objects to get a third object in my templates?

2010-02-19 Thread Daniel Wong
Seems like there's no good way to do this, because you can't call methods that take > 0 arguments. Here's an example of the sort of thing I'm trying to do. Imagine you're trying to create a spreadsheet like view: {% for person in people %} {% for col in columns %} {{ person.get(col) }}

Re: Noob question: Templates: How to count for loop?

2010-02-16 Thread mhulse
Many thanks for the help rebus_ and Daniel! All of your suggestions, code samples, and links have been extremely helpful. I appreciate it. Have a great day! Cheers, Micky -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group,

Re: Noob question: Templates: How to count for loop?

2010-02-16 Thread Daniel Roseman
On Feb 16, 2:12 am, mhulse wrote: > > You could do it like this. There was a discussion recently about mod > > operator and what happens when you want to do something every N times > > but can't find it now for some reason :( > > Ah, interesting! Thanks for the code sample, I really appreciate you

Re: Noob question: Templates: How to count for loop?

2010-02-15 Thread mhulse
> You could do it like this. There was a discussion recently about mod > operator and what happens when you want to do something every N times > but can't find it now for some reason :( Ah, interesting! Thanks for the code sample, I really appreciate your assistance. I will search around for the

Re: Noob question: Templates: How to count for loop?

2010-02-15 Thread rebus_
om. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > > http://docs.djangoproject.com/en/dev/ref/templates/builtins/#divisibleby http://groups.goo

Re: Noob question: Templates: How to count for loop?

2010-02-15 Thread rebus_
On 16 February 2010 02:58, mhulse wrote: >> Hrmm, forloop.counter. It is one of those days. :P > > But, how can I tell if it is every third item? > > Also, is there a way to check if the current number is even? > > In a PHP template, I might do this: > > ... forloop ... > > ... endforloop ... > >

Re: Noob question: Templates: How to count for loop?

2010-02-15 Thread mhulse
> Check out "cycle" template tag too. > http://docs.djangoproject.com/en/dev/ref/templates/builtins/#cycle Thanks rebus_! I have played with that just a little bit. I will explore it further. Cheers, Micky -- You received this message because you are subscribed to the Google

Re: Noob question: Templates: How to count for loop?

2010-02-15 Thread mhulse
> Hrmm, forloop.counter. It is one of those days. :P But, how can I tell if it is every third item? Also, is there a way to check if the current number is even? In a PHP template, I might do this: ... forloop ... ... endforloop ... Sorry if silly question. Thanks! M -- You received this me

Re: Noob question: Templates: How to count for loop?

2010-02-15 Thread rebus_
oup/django-users?hl=en. > > Check out "cycle" template tag too. http://docs.djangoproject.com/en/dev/ref/templates/builtins/#cycle -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email t

Re: Noob question: Templates: How to count for loop?

2010-02-15 Thread mhulse
> Is this possible? I am sure it is... Any tips ya'll could send my way > would be spectacular! Hrmm, forloop.counter. It is one of those days. :P -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...

Noob question: Templates: How to count for loop?

2010-02-15 Thread mhulse
Hi, In my template: {% for photo in photos %} stuff {% endfor %} Is this possible? I am sure it is... Any tips ya'll could send my way would be spectacular! Thanks! Micky -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group

Re: dynamic variable in templates

2010-02-15 Thread Bill Freeman
Or a method on the project model, maybe called chain, that looks the project instance's name up in chains. The you could say "for item in project.chain", for example. On Sat, Feb 13, 2010 at 3:31 PM, Daniel Roseman wrote: > On Feb 13, 7:20 pm, Madis wrote: >> http://push.cx/2007/django-template

Re: Templates design question

2010-02-15 Thread andreas schmid
you could create a template module where you put in the logic to dipslay the content of the post: Hello, > > I'm writing some simple webblog, just for self teaching, and I have a > question how to do better. Here is the situation, I have base.html, I > have blog.html which extends base. Now i

Templates design question

2010-02-15 Thread R. K.
Hello, I'm writing some simple webblog, just for self teaching, and I have a question how to do better. Here is the situation, I have base.html, I have blog.html which extends base. Now in that blog I would like to put posts, full text posts, without comments, and link to the post only with commen

Re: dynamic variable in templates

2010-02-13 Thread Daniel Roseman
On Feb 13, 7:20 pm, Madis wrote: > http://push.cx/2007/django-template-tag-for-dictionary-access > > This is basically what I'm looking for but I'm not sure that this is > the best way to do this. Yes, this is the right way to do it. -- DR. -- You received this message because you are subscribe

Re: dynamic variable in templates

2010-02-13 Thread Madis
ictionary key is changing > because the name of the project is changing but I can not find a way > to do this in Django templates. > > On Feb 13, 8:47 pm, Karen Tracey wrote: > > > > > On Sat, Feb 13, 2010 at 1:30 PM, Madis wrote: > > > I'm trying to write

Re: dynamic variable in templates

2010-02-13 Thread Madis
op. Now the second loop should be over the list of chains but the dictionary key is changing because the name of the project is changing but I can not find a way to do this in Django templates. On Feb 13, 8:47 pm, Karen Tracey wrote: > On Sat, Feb 13, 2010 at 1:30 PM, Madis wrote: > >

Re: dynamic variable in templates

2010-02-13 Thread Karen Tracey
On Sat, Feb 13, 2010 at 1:30 PM, Madis wrote: > I'm trying to write the following but there seems to be no solution on > the web for this. > > In a template: > {% for project in projects %} > {% for chain in chains.project.name %} <--- project.name should be > dynamic > {% endfor %} > {% endfor

dynamic variable in templates

2010-02-13 Thread Madis
I'm trying to write the following but there seems to be no solution on the web for this. In a template: {% for project in projects %} {% for chain in chains.project.name %} <--- project.name should be dynamic {% endfor %} {% endfor %} -- You received this message because you are subscribed t

Re: Generic templates

2010-02-01 Thread esatterwh...@wi.rr.com
ser has permission 1000 for superuser and > there is a menu item for staff requiring a permission of 100 the if check > would fail. My programmers brain says, no problem just use a bit vector, but > django templates don't allow that either. In the development version it's > possib

Re: Generic templates

2010-01-31 Thread Dylan Evans
% endifequal %} > The problem with that is if the user has permission 1000 for superuser and there is a menu item for staff requiring a permission of 100 the if check would fail. My programmers brain says, no problem just use a bit vector, but django templates don't allow that either. In the

Re: Visual appearance (i.e. templates) for admin site

2010-01-31 Thread Joakim Hove
has been rewritten from scratch and I > > don't have anything of those first fumbling attempts any longer (I > > have vc now ...). When I now activate the admin site it works nicely, > > but looks extremely basic, i.e. it can seem like I have "lost" some > > nice

Re: Visual appearance (i.e. templates) for admin site

2010-01-31 Thread Daniel Roseman
"very nice"; since then the code has been rewritten from scratch and I > don't have anything of those first fumbling attempts any longer (I > have vc now ...). When I now activate the admin site it works nicely, > but looks extremely basic, i.e. it can seem like I have &qu

Visual appearance (i.e. templates) for admin site

2010-01-31 Thread Joakim Hove
tch and I don't have anything of those first fumbling attempts any longer (I have vc now ...). When I now activate the admin site it works nicely, but looks extremely basic, i.e. it can seem like I have "lost" some nice looking templates for the admin site? I am using an svn version

Re: Generic templates

2010-01-31 Thread esatterwh...@wi.rr.com
if if you want to change the menu based on the user, you could probably just use the user permissions from the auth context processor if the user has the permissions ( access ) to the option - show it else - don't show it. or if you want to use the model you have listed here, you could use the

Re: Generic templates

2010-01-30 Thread Dylan Evans
No i have processors, i have all the data i need in the template, i just don't know an elegant way to condition out menu items. This is how my model works ACCESS_CHOICES = ( (1, "Public"), (10, "Private"), (100, "Staff"), (1000, "System") ) class Menu(models.Model): name

Re: Generic templates

2010-01-30 Thread Shawn Milochik
I think you've missed context processors, which is easy to do. I'm assuming that your issue is that you want to have something passed in the context on every page load to do something like decide which menu items are available based upon whether the user is logged in, their privileges, or whatev

Generic templates

2010-01-30 Thread Dylan Evans
I'm new to django and i think it's brilliant except for the weird template system. It seems the only way i can write templates which are generic enough to be reusable is to write complex tags and filters for tasks which could be handled by a simple argument on a function call, or as a

Re: Using the form field values in templates

2010-01-29 Thread Adrian Maier
Shawn, Ondrey, Thanks for your answers. I ended up using to ModelForm and ModelFormSet. Cheers, Adrian On Tue, Jan 19, 2010 at 16:12, ondrey wrote: > Hi, > > if the form is bound (i.e. form.is_bound is true) then you can access > its data attribute, which contains the data entered into the

Any performance issues with including templates within other templates?

2010-01-26 Thread Stodge
Quick template performance question. I have two templates for each model; view_object.html and render_object.html. The view template renders the object and extends the base.html template, which renders the menu, includes the CSS and JS. The render_object.html template is used by a view to render

Re: how to use model name in templates

2010-01-25 Thread Bill Freeman
ity to lie about the model name, this eliminates the need for the method. Bill On Mon, Jan 25, 2010 at 9:35 AM, Ali Rıza Keleş wrote: > Hi, > > How can I use model name in Templates? > > I tried something like this: > > Firstly model is here, > > cl

how to use model name in templates

2010-01-25 Thread Ali Rıza Keleş
Hi, How can I use model name in Templates? I tried something like this: Firstly model is here, class ModelNameXxxx(models.Model): field = . def modelName(): return "ModelNameXxxx" and in template side: {{ p

Re: Confusion about blocks in child templates

2010-01-23 Thread Jesaja Everling
Hello Daniel, thanks for your quick answer. I didn't find the documentation to say this explicitly, but maybe I just overlooked the relevant section. I never used blocks that were not defined in the base template before, but now I tried to use templates from a reusable app, and was expecting

Re: Confusion about blocks in child templates

2010-01-23 Thread Daniel Roseman
On Jan 23, 12:57 pm, Jesaja Everling wrote: > Hello all, > > I'm a little confused about how the template engine handles blocks in > child templates. > I always thought that if you define a block in a child template that > isn't defined in a template the child te

Confusion about blocks in child templates

2010-01-23 Thread Jesaja Everling
Hello all, I'm a little confused about how the template engine handles blocks in child templates. I always thought that if you define a block in a child template that isn't defined in a template the child template extends, the block is just rendered as-is. Otherwise, you would have

Custom templates names for application in a project

2010-01-20 Thread Alejandro Mezcua
Hi. I'm finishing an application to manage an address book and I have a doubt on how to customize the template names for the projects that use that application. The application is named "addresslist" and it provides to urls that use generic views, one for a list and one for details. The objects to

Re: Using the form field values in templates

2010-01-19 Thread ondrey
Hi, if the form is bound (i.e. form.is_bound is true) then you can access its data attribute, which contains the data entered into the form. If the form is valid (i.e. form.is_valid() is true), then you can access the cleaned_data attributes as well. So for example if you have form like this: f =

Re: Using the form field values in templates

2010-01-18 Thread Shawn Milochik
This is something I've run into as well. If it's a forms.ModelForm, and you instantiated it by passing an instance, you can access it like this: {{ person_form.instance.last_name }} Shawn-- You received this message because you are subscribed to the Google Groups "Django users" group. To post

Re: Project layout: put templates and js/css together?

2010-01-18 Thread Bill Freeman
I suppose that you can do what you want, but in deployment static files like js and css files are usually served by the front end (apache, for example), while, despite the .html, templates are not static files, and should never be served as is, only through the django template engine. It is

Re: Debugging Templates

2010-01-18 Thread diofeher
I think this would help you: http://github.com/robhudson/django-debug-toolbar On 17 jan, 14:51, oakmad wrote: > What is the best way to debug templates when data is not showing? > > Here is my problem. I'm using Google App Engine with app-engine-patch > so I realize it ma

Project layout: put templates and js/css together?

2010-01-18 Thread Stephan Walter
Hi, After having Django used a long time ago, I recently started a new project, using "django-admin.py startproject". What I found inconvenient is that in the default project layout, the templates and the static media are so "far away" from each other. What I mean is

Using the form field values in templates

2010-01-17 Thread adrian_m
Hello people, How can I access the value of a form field in the template ? I'm having two different use cases : - display a field value as simple text (the field is not meant to be edited by the user, therefore i don't want to use a input field) - use the field value for generating a link ( some

Debugging Templates

2010-01-17 Thread oakmad
What is the best way to debug templates when data is not showing? Here is my problem. I'm using Google App Engine with app-engine-patch so I realize it may not be a Django specific issue. I have one property on a model that will not display on my template yet all the model's other

Re: Django Groups In Templates

2010-01-10 Thread G B Smith
If your users can belong to only one group, then check this out: - http://stackoverflow.com/questions/1889607/django-middleware-to-determine-users-group-in-a-session GBS. On Jan 10, 1:21 pm, Dave Merwin wrote: > Brilliant!! That worked. Thanks. > > On Jan 10, 12:19 am, G B Smith wrote: > > > us

Re: Django Groups In Templates

2010-01-10 Thread Dave Merwin
Brilliant!! That worked. Thanks. On Jan 10, 12:19 am, G B Smith wrote: > user.groups.all returns not one but (possibly) many objects. Thus you > will have to do something like > > {% for group in user.groups.all %} >     {% if group.name == 'subscribed' %} >        Hello >     {% endif %} > {% en

Re: Django Groups In Templates

2010-01-10 Thread G B Smith
user.groups.all returns not one but (possibly) many objects. Thus you will have to do something like {% for group in user.groups.all %} {% if group.name == 'subscribed' %} Hello {% endif %} {% endfor %} Regards, GBS On Jan 10, 1:12 pm, Dave Merwin wrote: > I'm trying to do somet

Django Groups In Templates

2010-01-10 Thread Dave Merwin
I'm trying to do something I thought was simple. {% ifequal user.groups "subscribed" %} Hello {% endifequal %} But it's not working... Any tips? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-u

Problem to override templates using Apache2

2010-01-03 Thread Vicente Ruiz
nclude: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel warn CustomLog /home/user/logs/access.log combined I want to override admin templates. I created a basic_site.html on / home/user/project/templates/admin directory. On my machine, it works perfectly, bu

Re: weird problem with templates

2009-12-25 Thread gryzzly
Problem is solved. For utf-8 encoded templates you should avoid using BOM (byte order mark). Just turned it off in Komodo Edit and now everything is okay. On Dec 25, 1:50 am, gryzzly wrote: > hi, > while working on templates weird problem occured: > > when templates are being rende

weird problem with templates

2009-12-24 Thread gryzzly
hi, while working on templates weird problem occured: when templates are being rendered (i guess), in code, right before the doctype, strange character is being placed. I call it "strange" because if I select it, copy it and try to paste nothing is pasted. This "dot" is see

Re: Best practice for implementing alternate templates (themes)

2009-12-22 Thread Jarek Zgoda
Wiadomość napisana w dniu 2009-12-22, o godz. 10:38, przez adrian_m: > I'm developing a web application that is intended only for mobile > use. I want to implement some kind of 'themes' : have a list of > templates/stylesheets and make it possible that each user c

Best practice for implementing alternate templates (themes)

2009-12-22 Thread adrian_m
Hello all, I'm developing a web application that is intended only for mobile use. I want to implement some kind of 'themes' : have a list of templates/stylesheets and make it possible that each user chooses one of them for visualisation. The number of users is small and all o

Re: Learning Django - Error going through Chapt 4 on Templates at DjangoBook.com - Probably real simple

2009-12-18 Thread bayousoft
Sorry guys. the explanation is in the next paragraph. Please disregard. On Dec 18, 1:50 pm, bayousoft wrote: > I am brand new to Django and I'm trying to get up to speed ASAP.  I > really like it so far.  I'm getting an error trying to create a > template in the shell. > > >>> from django import

Re: Learning Django - Error going through Chapt 4 on Templates at DjangoBook.com - Probably real simple

2009-12-18 Thread bayousoft
Looking in Synaptic I'm kinda wondering if I need to install python- jinja2 ? On Dec 18, 1:50 pm, bayousoft wrote: > I am brand new to Django and I'm trying to get up to speed ASAP.  I > really like it so far.  I'm getting an error trying to create a > template in the shell. > > >>> from django i

Learning Django - Error going through Chapt 4 on Templates at DjangoBook.com - Probably real simple

2009-12-18 Thread bayousoft
I am brand new to Django and I'm trying to get up to speed ASAP. I really like it so far. I'm getting an error trying to create a template in the shell. >>> from django import template >>> t = template.Template('My name is {{ name }}.') Traceback (most recent call last): File "", line 1, in

Re: request and email templates

2009-12-13 Thread Tim Miller
Daniel Roseman wrote: > Looking at the code for that view, in > django.contrib.auth.views.password_reset, it appears that the actual > email creation and sending happens in the save method of the > PasswordResetForm, and the request is not passed into that method at > all so is not available in the

Re: request and email templates

2009-12-13 Thread Daniel Roseman
On Dec 13, 5:06 pm, Tim Miller wrote: > I'm using django.contrib.auth.views.password_reset and trying to pass > the ip address of the user requesting a password reset into the > confirmation email. > > I've enabled django.core.context_processors.request in settings and can > successfully display r

request and email templates

2009-12-13 Thread Tim Miller
I'm using django.contrib.auth.views.password_reset and trying to pass the ip address of the user requesting a password reset into the confirmation email. I've enabled django.core.context_processors.request in settings and can successfully display request.META.REMOTE_ADDR in the form.html templa

django.contrib.comments Templates

2009-12-12 Thread Carlos Ricardo Santos
-django-comments/ but when I try to comment, no "preview comment" page appears. Anyone has ever tried to change comments templates? Carlos Ricardo Santos -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, sen

Re: Help me with django templates

2009-12-11 Thread Biju Varghese
I got it error was i was trying to check to two different data types one was an integer and other was a string like 1 and '1' On Dec 9, 8:34 pm, Daniel Roseman wrote: > On Dec 9, 2:18 pm, Biju Varghese wrote: > > > > >                 {%for jobsp in jobspecs%} > >                         {%ifequ

Re: Question about forms in templates

2009-12-09 Thread Daniel Roseman
On Dec 9, 5:14 pm, jul wrote: > Hi, > > I'm not very clear on how forms work. > In the form below, both fields are required. When not filling anything > and clicking submit, I got the error messages. > Since I didn't specified any action, how can the form know that the > form is not valid and get

Question about forms in templates

2009-12-09 Thread jul
Hi, I'm not very clear on how forms work. In the form below, both fields are required. When not filling anything and clicking submit, I got the error messages. Since I didn't specified any action, how can the form know that the form is not valid and get the error messages? Thanks for any explanat

Re: Help me with django templates

2009-12-09 Thread Daniel Roseman
On Dec 9, 2:18 pm, Biju Varghese wrote: > >                 {%for jobsp in jobspecs%} >                         {%ifequal jobsp.id jobtitle.jobspec_id %} >                                 {{jobsp.id}} >                         {%endifequal%} >                 {%endfor%} >                        

Help me with django templates

2009-12-09 Thread Biju Varghese
{%for jobsp in jobspecs%} {%ifequal jobsp.id jobtitle.jobspec_id %} {{jobsp.id}} {%endifequal%} {%endfor%} -select- {%for jobspec

Re: admin templates issue

2009-12-07 Thread gentlestone
Sorry, my stupid mystake. I've copied bat templates from old Django 1.0 version. On 7. Dec., 08:50 h., gentlestone wrote: > I did not make any changes, just copied the original template to > template/admin > > I tried to copy the tepmplate to root (templates/admin) for ever

Re: admin templates issue

2009-12-06 Thread gentlestone
I did not make any changes, just copied the original template to template/admin I tried to copy the tepmplate to root (templates/admin) for every app and model and also I tried copy the template to some app and model - the same result Because it didn't work, I put the line: into base

Re: DRY up your Django templates with Showell Markup

2009-12-05 Thread David Martorana
I wrote this rather quickly. It allows you to put a template.showell file in each app folder, and will render the templates on demand if you call "render_showell_to_response(...)". It'll check the last modification time of the .showell files, and re-renders them if they've c

Re: admin templates issue

2009-12-04 Thread Sam Lai
2009/12/4 gentlestone : > I've tried to folow the tutorial and customize the admin template and > made a copy of 'change_form.html' template into the 'templates/admin' > directory in my project. I also set the > TEMPLATE_DIRS = (os.path.join(os.path.dirn

Re: DRY up your Django templates with Showell Markup

2009-12-04 Thread David Martorana
ango > tags) >   2. Allow for clean HTML one-liners that truly separate markup from > content. > > The implementation ofShowellMarkup is just a preprocessor to publish > Django templates.  You edit theShowellMarkup from a master file and > then publish the templates to their loca

permissions in templates

2009-12-04 Thread Adonis
Hi, I am trying to compare some existing permissions with the permissions that a project member has. From views.py i am giving a list with all available permissions. The problem is that the permission format is different and i cannot think of a slick way to compare them..My mind hovers around strin

admin templates issue

2009-12-04 Thread gentlestone
I've tried to folow the tutorial and customize the admin template and made a copy of 'change_form.html' template into the 'templates/admin' directory in my project. I also set the TEMPLATE_DIRS = (os.path.join(os.path.dirname(__file__), 'templates').replace(&#

Re: style guide/autoformatter/linter for Django templates?

2009-12-01 Thread Antoni Aloy
>> > shuffle due to the weekend and U.S. holiday. >>> >>> > On Nov 27, 2:18 pm, Steve Howell wrote: >>> >> I am wondering if there is a style guide anywhere for writing Django >>> >> templates.  Also, are there programs to automatically fo

Re: style guide/autoformatter/linter for Django templates?

2009-12-01 Thread Tom Evans
holiday. >> >> > On Nov 27, 2:18 pm, Steve Howell wrote: >> >> I am wondering if there is a style guide anywhere for writing Django >> >> templates.  Also, are there programs to automatically format your >> >> templates...to indent block tags, fo

<    5   6   7   8   9   10   11   12   13   14   >