Re: Why doesn't Django display template line number of errors?

2009-10-07 Thread NealWalters
Any ideas on this question from about a month ago? Thanks, Neal --~--~-~--~~~---~--~~ 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

Re: Include under an "if" statement

2009-09-11 Thread NealWalters
A follow-up question. The following works [filename=baseMain.html]: {% include templateHead %} {% include templateBody1 %} StartBodyBlock {%block body%} Default Block Body {%endblock%} EndBodyBlock {% include templateBody2 %} but if I combine templateBody1 and templateBody2 int

Re: Why doesn't Django display template line number of errors?

2009-09-11 Thread NealWalters
Maybe on Google App Engine there is no error line? Here's an example of an "endif" insteaf of an "endifequal". Neal Traceback (most recent call last): File "c:\Program Files\Google\google_appengine\google\appengine\ext \webapp\__init__.py", line 501, in __call__ handler.get(*groups) Fil

Re: Include under an "if" statement

2009-09-10 Thread NealWalters
Let me add the reason for my question. The code posted first doesn't work. The "block body" is not being replaced. But the following works fine (remove the ifequal/else/endifequal and the Dijit.html template (which might also have a duplicate "block body". {% include "baseMainIncludeSimpleHea

Why doesn't Django display template line number of errors?

2009-09-10 Thread NealWalters
It's not always a problem, but sometimes it's tricky to find the bad "end" or mismatched Django tag. Why doesn't Django give you the line number where the error is encountered within the template? Is this on the wishlist already? TemplateSyntaxError: Invalid block tag: 'end' In other words, the

Include under an "if" statement

2009-09-10 Thread NealWalters
Do include statements always "include" - or can they be subject to an "if" statement like this: {% ifequal menuStyle "dijit" %} {% include "baseMainIncludeDijit.html" %} {% else %} {% include "baseMainIncludeSimpleHead.html" %} {% include "baseMainIncludeSimpleBody1.html" %} StartBodyB

getting current page URL in a Django Template

2009-08-06 Thread NealWalters
Is there a keyword that will automatically put the URL of the current page in the Django form? Or do I have to do that in code and pass it to the form as a normal user variable? Here's what I'm trying to accomplish. I have a feedback form on a base template. When the user clicks the feedback but

Re: Displaying select box data back to the same form - with correct value already selected.

2009-06-10 Thread NealWalters
Yes, I am using Django forms. This is a variation of the question I posted on the checkboxes. My interim solution is to have a list of objects, set the Selected value in Python, then put a for/loop in the Django form. Neal --~--~-~--~~~---~--~~ You received this m

Re: Displaying a checkbox/list from database back onto a Django form

2009-06-10 Thread NealWalters
Your correct, I'm so close to my issue, I assumed everybody would see it. A user fills out a form to request us to build a website for them. We ask them what languages the would like - and we give them a list, such as English, Spanish, Portuguese, etc... The flag images are there just for looks.

Re: Displaying a checkbox/list from database back onto a Django form

2009-06-10 Thread NealWalters
Here's the last chunk of code. Before I display the template, I have to reset the array with the languages stored in the database. I now default every .Selected variable to False, and this code resets the ones to True based on the database. for dblanguage in session.languages: for

Re: Displaying a checkbox/list from database back onto a Django form

2009-06-10 Thread NealWalters
Can someone advice if this is the optimal solution? I didn't get any feedback yesterday - and must get this working. I've been doing Python a short time, so not always sure the best Pythonic approach... I built an array of objects like this: class Language(db.Model): #this is never stored in d

Displaying select box data back to the same form - with correct value already selected.

2009-06-08 Thread NealWalters
For simple input fields, I'm echoing back the data from database to form like this: Your Domain (example: JohnDoe.com) If I don't put the "if" statement there, I get the value "None" appearing, which is not desireable from a user's perspective. In this case "session" is the name of database

Displaying a checkbox/list from database back onto a Django form

2009-06-08 Thread NealWalters
Template/Form looks like this: English: Spanish: Portuguese: Database model defines column: languages = db.StringListProperty() #stores multiple languages I stored data into Google/BigTable like this: session.languages = self.request.get_all('language') That part wor