Templates Directory Question

2011-01-03 Thread Anthony Pearce
In Tutorial 2, I was instructed to make a templates directory. It is located at: C:\DjangoProjects\mysite\templates Now again in Tutorial 3, section "Write views that actually do something", I am given the instructions: create a directory, somewhere on your filesys

Re: apps, views and templates

2010-12-21 Thread bruno desthuilliers
On 21 déc, 15:01, Олег Корсак wrote: > hello. I have a question about using multiple apps on the same page > (template). > > Lets imagine a template with two blocks > > {% block left_side %}{% endblock %} > and > {% block right_side %}{% endblock %} > > in left_side block there is a voting app for

apps, views and templates

2010-12-21 Thread Олег Корсак
hello. I have a question about using multiple apps on the same page (template). Lets imagine a template with two blocks {% block left_side %}{% endblock %} and {% block right_side %}{% endblock %} in left_side block there is a voting app for example and in the right_side block there is a newsfee

Re: css templates

2010-12-06 Thread het.oosten
Here you find a page about serving multiple templates on the same site (and saving the preference in a session): http://www.packtpub.com/article/multiple-templates-in-django -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to

Re: css templates

2010-12-06 Thread Shamail Tayyab
Hi, Well here is an approach, you can use the Django's template engine for generating dynamic CSS as well... lets assume your templates path is TEMPLATES Now create a (minimal) file called style.css in your TEMPLATES like this: h1 { font-size: {{font_size}}; text-decor

css templates

2010-12-06 Thread Jonas Geiregat
Hello, I'm developing a application that has the ability to be viewed with two stylesheets. There are some differences between the stylesheets. It's not only a different CSS file that is loaded but some pages also have different HTML output. How could something like this be implemented within th

Cheetah templates

2010-11-23 Thread Tim
template_source` function.") The "tools/example.tmpl" is a subdirectory under my templates dir, which is configured in the settings TEMPLATE_DIRS and django has no problem finding other templates in those subdirectories. Can someone point out what I'm doing wrong here? thanks

Re: ReportLab and Django - templates? ; FK object has no attribute split

2010-11-19 Thread Carlos Daniel Ruvalcaba Valenzuela
go views can be almost as usual: get parameters from the > request, data from the database, filter and preprocess all you need, > and feed to the relevant PDF format function. > > that way you get the same content/presentation separation, even if the > presentation is written in proc

Re: ReportLab and Django - templates? ; FK object has no attribute split

2010-11-18 Thread Javier Guerra Giraldez
relevant PDF format function. that way you get the same content/presentation separation, even if the presentation is written in procedural python instead of descriptive templates. -- Javier -- You received this message because you are subscribed to the Google Groups "Django users" g

Re: ReportLab and Django - templates? ; FK object has no attribute split

2010-11-18 Thread Victor Hooi
gt; > views. > > > My first question is - at the moment, I'm building up the PDF inside > > my view. Is this really the recommended way of doing it? It's like > > I've got presentation code inside my view (controller). Isn't there a > > cleaner way of

Re: ReportLab and Django - templates? ; FK object has no attribute split

2010-11-18 Thread Jirka Vejrazka
ded way of doing it? It's like > I've got presentation code inside my view (controller). Isn't there a > cleaner way of doing it, or going from a template to PDF somehow? (I > know ReportLab offers a commercial package using RML templates, > however I was hoping for an opensour

Re: ReportLab and Django - templates? ; FK object has no attribute split

2010-11-17 Thread natebeacham
nt, I'm building up the PDF inside > my view. Is this really the recommended way of doing it? It's like > I've got presentation code inside my view (controller). Isn't there a > cleaner way of doing it, or going from a template to PDF somehow? (I > know ReportLa

ReportLab and Django - templates? ; FK object has no attribute split

2010-11-17 Thread Victor Hooi
x27;t there a cleaner way of doing it, or going from a template to PDF somehow? (I know ReportLab offers a commercial package using RML templates, however I was hoping for an opensource/free method). Second question, I have a model with several FK fields. E.g. class Article(models

Re: Can Admin Widgets be used in non-admin templates?

2010-11-12 Thread mathphreak
If you want them to access everything on certain admin pages, then you can change user permissions around to give them access to only a few pages. If what you want can be picked out of (add, change, view), then the permissions model works for that too. If you need something more fine-grained, or

Can Admin Widgets be used in non-admin templates?

2010-11-11 Thread codingJoe
Hi all, Django newbie question here. I am building some pages to let my users manage lists of data. I really like the look, feel, and behavior, of the admin pages. But I can't give my users that much control. Is there a way to reuse the admin widgets in non-admin pages? I want to give them l

Re: Makemessages with Templates - Not Working

2010-10-04 Thread nsbk
Hi, Something similar is happening to me. I tried to run django-admin.py makemessages -l es and then compilemessages from the root of my templates folder (which is outside the project tree) and it creates the file Templates/conf/locale/es/LC_MESSAGES/django.po / django.mo correctly. My problem

Re: django-friends | setup views.py with templates

2010-10-02 Thread appel268576
gt; please help me through the process > thx > > On 6 Sep, 18:24, justin jools wrote: > > > > > trying to setup simple social network > > have installed: registration, profiles, accoutns, messages > > > but am stuck as how to setup/link the views.py to templ

Re: Django feed templates and how do I use them with images?

2010-09-29 Thread Lisa B
Not exactly what you want, but if you are trying to publish images in your RSS feed with each item: I did this by putting an tag inside the description. Look at the way they did the feed here: http://ciclops.org/rssfeed.php this feed w3c validates and seems to work as desired everywhere I've tried

Re: Django feed templates and how do I use them with images?

2010-09-29 Thread Lisa B
I did this without feed templates by putting an tag inside the description. Look at the way they did it here: http://ciclops.org/rssfeed.php this feed w3c validates and seems to work as expected everywhere I've tried it (feedly, Ning, firefox's display of the feed) Code is just the ord

Makemessages with Templates - Not Working

2010-09-27 Thread Katrina
I am currently translating a project, and many of the strings needing translation are located in my templates. Unfortunately, the .po files are not being created when I run makemessages, which I am doing from my project home using: ./manage.py makemessages -l es -e html,shtml Makemessages is

Django feed templates and how do I use them with images?

2010-09-15 Thread PeterR
home page"> I like to ask which part is what I need to include in the Django feed template ?? The explanation of feed templates is somehow very short? Should I have two templates, one for RSS(XML) and one for HTML? Thank you for your help. Peter -- You received this message because

Re: django-friends | setup views.py with templates

2010-09-06 Thread justin jools
talled: registration, profiles, accoutns, messages > > but am stuck as how to setup/link the views.py to templates/ > notification. I guess this is what is needed to be done. > > Any help much appreciated -- You received this message because you are subscribed to the Google Groups &qu

django-friends | setup views.py with templates

2010-09-06 Thread justin jools
trying to setup simple social network have installed: registration, profiles, accoutns, messages but am stuck as how to setup/link the views.py to templates/ notification. I guess this is what is needed to be done. Any help much appreciated -- You received this message because you are

Re: Ability to use PSP templates with Django?

2010-08-21 Thread hcarvalhoalves
There are 2 approaches: - Think data structures instead, and put all this logic on your view, such that the template just needs to iterate thru one variable to build the menu. Something like passing in the template context: menu = [{'name': 'django', 'text': 'Official Django Site', 'url': 'http:/

Re: Ability to use PSP templates with Django?

2010-08-21 Thread Albert Hopkins
g off it's probably best to stick with what's built-in. Like most toolkits, there is no 1-to-1 translation between PSP and Django. They are indeed very different beasts. You are best off just learning how things work in Django and adapting to its methods and idiosyncrasies. Have you actua

Ability to use PSP templates with Django?

2010-08-21 Thread Kevin
I come from the world of mod_python and really enjoyed the PSP template system, where I can embed Python code directly in my template for dynamically generating menus and such. What is the recommended method of calling a PSP template from inside Django and rendering it? Here is a sniplet of code

using acrobat fdf in templates

2010-08-16 Thread Sells, Fred
I'm trying to use the Django template system to render PDF's from .fdf's. The PDF's are provided by client and I can generate a dummy .fdf from them and edit that. I can use pdftk to merge the two, but it seems like the template system does something similar. My first problem is that the .fd

Re: issues with form error in custom templates not displaying correctly

2010-08-12 Thread cootetom
You would use CSS for styling. li { border:1px solid #FF; } You might want to create a class for error styling though! On Aug 12, 4:44 pm, reduxdj wrote: > Hi, > > I can't seem to get my form errors to work with customs forms in > django, following the examples I have done this: > >    

issues with form error in custom templates not displaying correctly

2010-08-12 Thread reduxdj
Hi, I can't seem to get my form errors to work with customs forms in django, following the examples I have done this: Price {% if form.price.errors %}

Re: I need a middleware to add language to urls in my templates

2010-08-11 Thread Nuno Maltez
eware that incercepts all my href="http://mydomain";> urls in templates and adds to href a lang=en, > lang=fr, > if the request.language is respectively en, fr. > So all my links should be ok. > Is it possible? > > -- > Alessandro Ronchi > http://www.soasi.com >

I need a middleware to add language to urls in my templates

2010-08-11 Thread Alessandro Ronchi
on google. I know I should have different urls, but I cannot in this project because I'm using satchmo, a django e-commerce system, and I can't edit urls to work this way. So I thought I can create a middleware that incercepts all my http://mydomain";> urls in templates and add

Re: extends templates with the same name

2010-08-06 Thread Alessandro Ronchi
to have a tag to enable those extends without empty templates, for DRY principle and because usually you don't want to change a library template at all, and with this you have to move to realbase.html. -- Alessandro Ronchi http://www.soasi.com Hobby & Giochi http://hobbygiochi.com ht

Re: extends templates with the same name

2010-08-06 Thread Reinout van Rees
On 08/06/2010 12:22 PM, Alessandro Ronchi wrote: It's useful to have some templates with the same name of another one, like you can do with YOURPROJECT/templates/admin/base_site.html that override the base site django default. but If I want to add a word in the title of my base_site.html I

extends templates with the same name

2010-08-06 Thread Alessandro Ronchi
It's useful to have some templates with the same name of another one, like you can do with YOURPROJECT/templates/admin/base_site.html that override the base site django default. but If I want to add a word in the title of my base_site.html I need to copy the entire content of the base_site.h

Re: errors serving text files using templates and static files

2010-07-27 Thread Dennis Kaarsemaker
c = Context({ > 'user_bootimage_list': user_bootimage_list, > }) > f = > open('/home/jboon/Lesson1/templates/netboot/static/dynamicmenu.cfg', > 'w') > menu_file = File(f) > menu_file.write(t.render(c)) > return Htt

Re: errors serving text files using templates and static files

2010-07-26 Thread Josh Boon
_list = Bootimage.objects.filter(person=user)[:5] t = loader.get_template('netboot/menu.cfg') c = Context({ 'user_bootimage_list': user_bootimage_list, }) f = open('/home/jboon/Lesson1/templates/netboot/static/dynamicmenu.cfg', 'w') menu_file = File(f

Re: errors serving text files using templates and static files

2010-07-26 Thread Dennis Kaarsemaker
On ma, 2010-07-26 at 09:21 -0700, Josh wrote: > return HttpResponse(menu, mimetype="plain/text") > > What makes Django's text serving different? What can I do to > troubleshoot this issue further? Am I just missing something about > how text files are served? The correct mimetype is tex

errors serving text files using templates and static files

2010-07-26 Thread Josh
Good morning, I've been writing a Django app to create a dynamic net boot program to boot configs created by users from a web interface using a tool called gPXE. I've exhausted my troubleshooting methods and can't seem to figure out why gPXE can boot from a static file served directly from apache

join objects in templates

2010-07-24 Thread deepak dhananjaya
(auto_now_add=True) analysis = models.CharField(max_length=200) prescription = models.CharField(max_length=500) NOw if I want the joined content like.. if I want to display all the patients name, problem and the analysis history how do I do it? how do I pass it to templates? the relation could be

Re: Iterating over model instances ordered_with_respect_to in templates

2010-07-22 Thread Marek Dudek
I found solution but very inefficient one: {% with gallery.get_pictureingallery_order as ids_in_order %} {% for picture_in_gallery_id in ids_in_order %} {% for picture_in_gallery in gallery.pictureinga

Iterating over model instances ordered_with_respect_to in templates

2010-07-21 Thread Marek Dudek
Hello I have two models and 1-to-many relation between them, using ForeignKey (gallery with pictures). Additionally instances on 'many' side are ordered_with_respect_to owning instance. I need to iterate over them in template, respecting imposed order. I can use "get_pictureingallery_order" o

Re: Google App Engine error with templates

2010-07-19 Thread Venkatraman S
On Tue, Jul 20, 2010 at 9:57 AM, Tereno wrote: > I'm experiencing this error: Module > "django.template.loaders.filesystem" does not define a "Loader" > callable template source loader > > and I can't figure out why at all. I've placed my templ

Google App Engine error with templates

2010-07-19 Thread Tereno
Hey there, I'm experiencing this error: Module "django.template.loaders.filesystem" does not define a "Loader" callable template source loader and I can't figure out why at all. I've placed my templates dir in the settings file and yet somehow it doesn't

Re: Most common uses of Django templates

2010-07-16 Thread Antoni Aloy
2010/7/15 fabiofz : > Hi All, > > I'm currently working on providing an editor for django templates in > Pydev (http://pydev.org). > > Now, while I do work with django templates sometimes, my experience is > a bit limited with it -- so far I used it only for .html fi

Re: Apache, wsgi and templates

2010-07-15 Thread lupuscramus
> > Another way is to set your admin_media_prefix to something like / > admin_media/ and then in your apache conf set an alias for it. > > Alias /admin_media/ /usr/local/pyvans/lib/python2.6/site-packages/ > grappelli/media/ > > > jaymz > In fact, this way works for me. Thanks for your help

Most common uses of Django templates

2010-07-15 Thread fabiofz
Hi All, I'm currently working on providing an editor for django templates in Pydev (http://pydev.org). Now, while I do work with django templates sometimes, my experience is a bit limited with it -- so far I used it only for .html files, sometimes with some javascript in it, so, that'

Re: Apache, wsgi and templates

2010-07-15 Thread lupuscramus
dules/python2.5/django/contrib/admin/media/ In addition, I've enable the personnal templates by fulfilling templates_dir. The behaviour is strange : sometimes I can see my personnal title, sometimes I see "Django Administration", when I refresh the page. And I don't see images. M

Re: Apache, wsgi and templates

2010-07-15 Thread jaymzcd
My server uses Debian, and I've installed Django by aptitude. My files are > located in /usr/share/pyshared/django. > > I can see on the documentation of django about deploying an app with apache > and wsgi that I should have another web server, or configure apache for the > media

Apache, wsgi and templates

2010-07-15 Thread lupuscramus
r, or configure apache for the media files. It could be the problem (Images are they media files ?). In fact, I don't understand really this part of the doc. Are the defaults templates of django concerned by this part ? Thanks, -- You received this message because you are subscribed to the

templates translation problem

2010-07-13 Thread turbidus
I have site with text written in Russian. Now I want to translate it to English. I've upgraded templates with trans tag like that {% trans "Всем привет" %}. Then I run makemessages, translated what I want, compilemessages. And now, the translation for the string "Всем пр

Re: break/continue for templates

2010-07-05 Thread Torsten Bronger
y control structure more intuitive. But the other things are simply bringing full-blown programming into templates. Besides, it is *very* easy to migrate them into the Python code. Tschö, Torsten. -- Torsten Bronger, aquisgrana, europa vetus Jabber ID: torsten.bron...@ja

Re: break/continue for templates

2010-07-05 Thread George Sakkis
On Jul 5, 2:25 pm, Torsten Bronger wrote: > Hall chen! > > George Sakkis writes: > > [...] > > > To be honest, I never *had to* do it (in the strict sense) either > > but apparently others did ([1-4]). As for the "just put it in the > > view" argument, remember that until last month this was the >

Re: break/continue for templates

2010-07-05 Thread Torsten Bronger
ing "if" to be a bit smarter :) People will want to do *everything* in the template. The lowest rated snippet on djangosnippets currently is an {% exec %} tag. :-) Therefore, it's important to enforce some discipline, so that the templates don't become sort of PHP. I use &quo

Re: break/continue for templates

2010-07-05 Thread George Sakkis
've never come across a > situation where I've needed to do that in 2.5 years of developing > Django templates, and, whilst I agree that we don't want to get into a > holy war about whether stuff should be done in templates or views, I > reckon the reason I've avo

Re: break/continue for templates

2010-07-05 Thread euan.godd...@googlemail.com
The link to your snippet doesn't work for me. It sounds like a neat idea. However, I've never come across a situation where I've needed to do that in 2.5 years of developing Django templates, and, whilst I agree that we don't want to get into a holy war about whether stu

break/continue for templates

2010-07-04 Thread George Sakkis
Hi all, there have been at least three threads in this list alone from people asking how to "break" from a for loop in templates, so the following snippet [1] might be useful to some. Leaving aside the "thou shalt not use logic in templates" religious debate, it's

genstatic - Generate and maintain static HTML files with Django templates

2010-06-25 Thread Aaron Maxwell
Hi all, Here is a GPLed software tool I made recently: http://github.com/redsymbol/genstatic Hope some of you find it useful and interesting. Please let me know if you have any feedback. Cheers, Aaron -- Aaron Maxwell http://redsymbol.net/ -- You received this message because you are subs

Re: Django templates and libraries

2010-06-21 Thread shofty
e sure that the > library is on the template_dirs list in the settings.py file (/home/ > jhumunc/webapps/jhumunc/lib/python2.5/django_forms-0.5-py2.5.egg/forms/ > templates). However, when I load the page, it's saying that it can't > find the templatetags that correspond to that t

Django templates and libraries

2010-06-20 Thread tanman
ngs.py file. I'm trying to get the page at http://www.jhumunc.webfactional.com/accounts/register/ to work properly. The pages uses the forms library and I've made sure that the library is on the template_dirs list in the settings.py file (/home/ jhumunc/webapps/jhumunc/lib/python2.5/dja

Re: key error in templates - solved

2010-06-16 Thread Kenneth Gonsalves
On Thursday 17 June 2010 10:02:20 Venkatraman S wrote: > > Once I repickled, the problem was solved > > Totally not related to your Q, but if you are using photos - try using > django-photologue. Its awsum! > was awesome - I do not think it is maintained now, I tried it with trunk and gave up a

Re: key error in templates - solved

2010-06-16 Thread Venkatraman S
On Thu, Jun 17, 2010 at 9:58 AM, Kenneth Gonsalves wrote: > solved - what had happened was that when I pickled the results, the model > in > question did not have a 'photo' field which I added subsequently to > pickling. > Once I repickled, the problem was solved > Totally not related to your Q,

Re: key error in templates - solved

2010-06-16 Thread Kenneth Gonsalves
On Thursday 17 June 2010 06:46:21 Kenneth Gonsalves wrote: > In my current project I am getting keyerror: photo where the photo does > not exist. This is running on latest trunk. The only difference between > the two sites is that in site where it is working, 'p' is a query set > passed from th

Re: key error in templates

2010-06-16 Thread Kenneth Gonsalves
On Thursday 17 June 2010 06:46:21 Kenneth Gonsalves wrote: > in many models with an imagefield called photo, I have this code in the > template: > > {% if p.photo %} > > > {% endif %} > > this has been working across many sites for years - and is working on a > par

key error in templates

2010-06-16 Thread Kenneth Gonsalves
, 'djangogolf.web', 'sorl.thumbnail'] Installed Middleware: ('django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.middleware.locale.LocaleMiddleware', '

Re: styling with django templates

2010-06-08 Thread Venkatraman S
On Wed, Jun 9, 2010 at 3:57 AM, Nick wrote: > Boy, that just flew right past me. Ridiculous. Thanks everyone. > > On Jun 8, 1:06 pm, Dejan Noveski wrote: > > http://docs.djangoproject.com/en/dev/ref/templates/builtins/#for > > > > scroll a bit down to see the forloo

Re: styling with django templates

2010-06-08 Thread Nick
Boy, that just flew right past me. Ridiculous. Thanks everyone. On Jun 8, 1:06 pm, Dejan Noveski wrote: > http://docs.djangoproject.com/en/dev/ref/templates/builtins/#for > > scroll a bit down to see the forloop object and its properties. > > > > On Tue, Jun 8, 2010 at 8

styling with django templates

2010-06-08 Thread Nick
I am looking for a way to identify the first item returned in a loop and display it differently than the others: basically it would go like: {% for item in items %} {% if is_first_item %} This is what will show {% else %} this is what will show {% endfor %} Am I overlooking some

Re: how to show blank spaces at the start of string in django templates

2010-05-30 Thread knicholes
On May 29, 7:47 am, Ogi Vranesic wrote: > Hi > > I formated with python numbers like e.g.: > > "   3457.50" > " 11450.25" > > but my problem is to show them correctly one below the other > in a column by django templates > because the blank sp

Re: how to show blank spaces at the start of string in django templates

2010-05-29 Thread Daniel Roseman
On May 29, 2:47 pm, Ogi Vranesic wrote: > Hi > > I formated with python numbers like e.g.: > > "   3457.50" > " 11450.25" > > but my problem is to show them correctly one below the other > in a column by django templates > because the blank sp

how to show blank spaces at the start of string in django templates

2010-05-29 Thread Ogi Vranesic
Hi I formated with python numbers like e.g.: " 3457.50" " 11450.25" but my problem is to show them correctly one below the other in a column by django templates because the blank spaces are ignored. I tried with the filter escape, however it does not work. A solution w

Re: Pass variable to all templates

2010-05-10 Thread zinckiwi
;base/base.html", } ...will expose BASE_TEMPLATE in all my templates. Regards Scott > my Django project has several apps, and each app contains a constant > named APPLABEL. This constant should be passed to all templates, but > I'd like to avoid adding it to each ren

Pass variable to all templates

2010-05-10 Thread janedenone
Hi, my Django project has several apps, and each app contains a constant named APPLABEL. This constant should be passed to all templates, but I'd like to avoid adding it to each rendering context manually. Is that possible? Thanks, Jan -- You received this message because you are subscrib

Creating hierachical views and processing these in templates?

2010-05-01 Thread Derek
I am struggling to grasp the "full picture" when it comes to view queries and associated templates which deal with sets of "nested" parent/child relationships, and am hoping someone here can enlighten me. All the examples I have seen seem to deal with simple views showi

Re: coltrane sample at "practical django projects" book has a templates error

2010-04-22 Thread Alexandre González
I was searching for the error in google and I solve it, I don't know if I solve it at good way, but... It works :p from django.conf.urls.defaults import * from coltrane.models import Category urlpatterns = patterns('', (r'^$', 'django.views.generic.list_detail.object_list', { 'queryset': Cate

Re: coltrane sample at "practical django projects" book has a templates error

2010-04-22 Thread Rodrigo
could you post your urls.py ? On Apr 21, 6:51 pm, xota wrote: > Or I do something bad, I was searching in google and some pepople have > same/similar error without replies, can you help me, this is my error: > > Caught an exception while rendering: Reverse for > 'coltrane_category_list' with argu

coltrane sample at "practical django projects" book has a templates error

2010-04-21 Thread xota
Or I do something bad, I was searching in google and some pepople have same/similar error without replies, can you help me, this is my error: Caught an exception while rendering: Reverse for 'coltrane_category_list' with arguments '()' and keyword arguments '{}' not found. If you need more info,

Re: Non-conventional use of django templates.

2010-04-17 Thread Tomasz Zieliński
afety measures built in. Regarding tag processing, it might be harder than I think, but I don't see a problem with cutting such unwanted tags, e.g. with regex or maybe even by cloning source code for templates and removing set of tags (OR maybe it's possible to disable some of tags, I&#

Non-conventional use of django templates.

2010-04-16 Thread Paweł Roman
I'm writing an application which is kind of event handling app, and the important functionality is sending emails. User can create his own email template, and when an event occurs the email is built using this template and sent. An event is nothing but a python dictionary with some values. As you m

Re: Calling the same views, displaying in different templates

2010-04-13 Thread rvidal
Thanks! I knew there was a way around this. Repeating code is very not like django :) Works like a charm. Thanks again. On Apr 13, 12:30 am, Danny Adair wrote: > On Tue, Apr 13, 2010 at 15:59, rvidal wrote: > >[...] > > I have my urls.py looking something like this: > > urlpatterns = patterns(

Re: Calling the same views, displaying in different templates

2010-04-13 Thread Danny Adair
On Tue, Apr 13, 2010 at 15:59, rvidal wrote: >[...] > I have my urls.py looking something like this: > urlpatterns = patterns('mysites.shop.views', >        (r'^$', 'index'), >        (r'^client/(?P\d+)/$', 'details'), >        (r'^client/(?P\d+)/receipts/$', 'receipts'), >        (r'^client/(?P\d

Re: Calling the same views, displaying in different templates

2010-04-13 Thread bruno desthuilliers
On 13 avr, 05:59, rvidal wrote: > I have my urls.py looking something like this: > urlpatterns = patterns('mysites.shop.views', >         (r'^$', 'index'), >         (r'^client/(?P\d+)/$', 'details'), >         (r'^client/(?P\d+)/receipts/$', 'receipts'), >         (r'^client/(?P\d+)/contacts/$',

Calling the same views, displaying in different templates

2010-04-12 Thread rvidal
Hi, I have a database of related data connected via foreign keys. One to many relationships between one table and various other tables. Random example: Client - id - name - age Receipts - id - client (fk) - timestamp Contacts - id - client (fk) - timestamp I have my urls.py looking something l

Re: what lines in the templates are culpable?

2010-04-12 Thread Karen Tracey
On Mon, Apr 12, 2010 at 5:55 PM, Phlip wrote: > Or do all of your see filenames and line numbers, for your .html > templates, at error time? > > I do on debug pages, with the line causing the error highlighted. I'm still not sure if you are talking about test output or debug

Re: what lines in the templates are culpable?

2010-04-12 Thread bax...@gretschpages.com
Without seeing the traceback, this is all just guessing--stabbing in the dark. But... a) posting a traceback allows people to actually help not only solve the problem, but help show how to read the traceback. b) commenting out template code may have suppressed the problem, but that still doesn't

Re: what lines in the templates are culpable?

2010-04-12 Thread Phlip
;. That part's done - by clamping out segments with {% comment %} until they isolated the faulty lines. I am asking _why_ I had to clamp out segments with {% comment %}. (In test.) Or do all of your see filenames and line numbers, for your .html templates, at error time? -- You received

Re: what lines in the templates are culpable?

2010-04-12 Thread bax...@gretschpages.com
here the error is. Without the traceback, it's hard to say where your > > problem lies. > > One of the templates is "basket.html", and "basket.html" does not > appear in the transcript. > > All the lines are only django's internal render() calls (

Re: what lines in the templates are culpable?

2010-04-12 Thread Karen Tracey
On Mon, Apr 12, 2010 at 5:10 PM, Phlip wrote: > > Uusually the first line in the traceback tells you pretty explicitly > > where the error is. Without the traceback, it's hard to say where your > > problem lies. > > One of the templates is "basket.html",

Re: what lines in the templates are culpable?

2010-04-12 Thread Phlip
> Uusually the first line in the traceback tells you pretty explicitly > where the error is. Without the traceback, it's hard to say where your > problem lies. One of the templates is "basket.html", and "basket.html" does not appear in the transcript. All th

Re: what lines in the templates are culpable?

2010-04-12 Thread bax...@gretschpages.com
ed stack trace of all the lines AROUND the template. > > How do I tell what lines INSIDE the templates caused the error? > > -- >   Phlip >  http://c2.com/cgi/wiki?ZeekLand -- You received this message because you are subscribed to the Google Groups "Django users" group

what lines in the templates are culpable?

2010-04-12 Thread Phlip
Djangoists: When code below a template throws an error, we get an insanely detailed stack trace of all the lines AROUND the template. How do I tell what lines INSIDE the templates caused the error? -- Phlip http://c2.com/cgi/wiki?ZeekLand -- You received this message because you are

Re: get_fieldname_display in templates

2010-04-08 Thread Ramiro Morales
On Thu, Apr 8, 2010 at 3:00 AM, mmenchu wrote: > I'm trying to write to one of my templates the display name for > item.category. Item is an object with an IntegerField named > 'category' and a set of specified choices. I call render_to_response > and call get_ca

get_fieldname_display in templates

2010-04-08 Thread mmenchu
I'm trying to write to one of my templates the display name for item.category. Item is an object with an IntegerField named 'category' and a set of specified choices. I call render_to_response and call get_category_display() but I keep getting "Could not parse the remainde

Re: Literal Brace Symbols in Templates

2010-03-24 Thread Rolando Espinoza La Fuente
On Wed, Mar 24, 2010 at 5:49 PM, saxon75 wrote: > I apologize if this is blindingly obvious, but suppose I want to have > a template actually print the literal string "{{ url }}" in the page. > How would I go about doing that? http://docs.djangoproject.com/en/dev/ref

Literal Brace Symbols in Templates

2010-03-24 Thread saxon75
I apologize if this is blindingly obvious, but suppose I want to have a template actually print the literal string "{{ url }}" in the page. How would I go about doing that? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, s

Re: Templates: Looping, ifs and defaults

2010-03-24 Thread bruno desthuilliers
On 24 mar, 16:50, ALJ wrote: > Hi again Paulo, > > Ok. I'll also have a look at that. > > I agree that the business logic should be in the views. However, it > feels that we need a little more flexibility with the templates when > things are truely just a presentation

Re: Templates: Looping, ifs and defaults

2010-03-24 Thread ALJ
Hi again Paulo, Ok. I'll also have a look at that. I agree that the business logic should be in the views. However, it feels that we need a little more flexibility with the templates when things are truely just a presentation problem. When you have to start constructing your own diction

Re: Templates: Looping, ifs and defaults

2010-03-24 Thread Paulo Almeida
Sorry, I hadn't understood your original problem, now I see why the nested ifs wouldn't work. Regarding your last question, I think a list of lists would be easier than dictionaries. You can append the product as the first item in each sublist and then iterate the list to get the rows and columns

Re: Templates: Looping, ifs and defaults

2010-03-24 Thread ALJ
Just as a matter of interest ... is there a 'best way' of formatting the data if you do decide to process it all in the view and then pass to the template? I seem to have dictionaries coming out of my ears if I construct the data myself. -- You received this message because you are subscribed to

Re: Templates: Looping, ifs and defaults

2010-03-24 Thread ALJ
Hi Dalore, Thanks for that. I changed it a bit because it was still within that {% for sale in sales %} loop. It works. But it really makes the raw html pretty ugly with loads of spaces in it. Never mind. I suppose no- one is going to see it. {% for rate in rates %} {{ rate.cost_item

Re: Templates: Looping, ifs and defaults

2010-03-24 Thread dalore
What about something like this? It gets you your text field, empty if no data, but with data if it matches your if clause. {{ rate.cost_item.name }} {% for appointment in appointments %} {% for sale in sales %} {% endfor %} {% endfor %

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