Re: Doesn't render templates any longer

2011-07-27 Thread Doug Ballance
def main(request): context=Context()     this_is_the_template_object = loader.get_template("main/ start.html") this_is_the_template_rendered=this_is_the_template_object.render(context)     return HttpResponse(this_is_the_template_rendered) What you are feeding HttpResponse is the

Doesn't render templates any longer

2011-07-27 Thread Max Bachl
Hi all! I've encountered a strange bug today. I want to return an HTTP response with this code: def main(request): t = loader.get_template("main/start.html") return HttpResponse(t) However, the only result I get is <'> and the rest of the html file has gone. The same error

Doesn't render templates any longer

2011-07-27 Thread Max Bachl
Hi all! I've encountered a strange bug today. I want to return an HTTP response with this code: def main(request): t = loader.get_template("main/start.html") return HttpResponse(t) However, the only result I get is <'> and the rest of the html file has gone. The same error

Doesn't render templates any longer

2011-07-27 Thread Max Bachl
Hi all! I've encountered a strange bug today. I want to return an HTTP response with this code: def main(request): t = loader.get_template("main/start.html") return HttpResponse(t) However, the only result I get is <'> and the rest of the html file has gone. The same error

Re: Recommended locations for templates?

2011-07-27 Thread bruno desthuilliers
On Jul 27, 9:05 am, Rodney Topor <r.to...@gmail.com> wrote: > What is the recommended best practice for locating templates in a > project directory? Depends... >  In particular, which of the following two > structures is considered better? > > 1.  project/templates/{app1,

Re: Recommended locations for templates?

2011-07-27 Thread Mike Dewhirst
On 27/07/2011 5:05pm, Rodney Topor wrote: What is the recommended best practice for locating templates in a project directory? In particular, which of the following two structures is considered better? 1. project/templates/{app1,app2,...} This is better if you have a separate team editing

Recommended locations for templates?

2011-07-27 Thread Rodney Topor
What is the recommended best practice for locating templates in a project directory? In particular, which of the following two structures is considered better? 1. project/templates/{app1,app2,...} 2. project/{app1/templates, app2/templates,...} If some template is independent

Re: Trouble overriding registration templates

2011-07-19 Thread Joshua Russo
btw, I was correct, it was the development settings causing the problem On Wed, Jul 13, 2011 at 1:43 PM, Joshua Russo wrote: > Correct > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To view this discussion on

Re: Django: forms and custom templates

2011-07-15 Thread Javier Guerra Giraldez
On Fri, Jul 15, 2011 at 6:41 AM, samuele.mattiuzzo wrote: > Nope, what i wanted to achieve is just to have django forms spawn my > custom html instead of the default one. note that you can simply not use the form rendering, simply use your HTML (in a template, or even on a

Re: Django: forms and custom templates

2011-07-15 Thread samuele.mattiuzzo
I figured out i have to override the default form classes of django i have to create a CustomCheckboxSelectMultiple(CheckboxSelectMultiple) class and override the "render" method, making it generate the html i want for my particular cases -- You received this message because you are subscribed

Re: Django: forms and custom templates

2011-07-15 Thread samuele.mattiuzzo
f course you might want to edit it a little bit for it to comply > with the other templates. > > If you want to work with the data from the forms, you'll have to pass the > forms data (whatever is inputet or selected) to a view (per urls.py) and t

Aw: Django: forms and custom templates

2011-07-15 Thread Juergen Schackmann
I am also not sure, what exactly you are looking for, but what about this: https://docs.djangoproject.com/en/1.3/topics/forms/#customizing-the-form-template so you will have complete control of your html code??? -- You received this message because you are subscribed to the Google Groups

AW: Django: forms and custom templates

2011-07-15 Thread Szabo, Patrick (LNG-VIE)
I'm not sure if i understood your problem a 100 percent so i'll just write what i think you want ^^ >From what i understand i think you can use the code that has already been >written. Of course you might want to edit it a little bit for it to comply >with the other templates. If

Django: forms and custom templates

2011-07-15 Thread samuele.mattiuzzo
basic problem: i need to create real customized templates for my django forms. That's it. I'm used to style the forms based on django's output. This time is different, the html/css template is already done (months before i was hired) and i cannot modify it, so i need django to output exactly

Re: Trouble overriding registration templates

2011-07-13 Thread Joshua Russo
Correct -- 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/-/K5yKllF_gPcJ. To post to this group, send email to django-users@googlegroups.com. To unsubscribe

Re: Trouble overriding registration templates

2011-07-13 Thread Joshua Russo
*light bulb* I forgot about my development vs production settings. I was only changing the TEMPLATE_DIRS in the main settings.py that represents my production settings. I'm not in a place where I can test this but I'm almost certain that's what the problem is. -- You received this message

Re: Trouble overriding registration templates

2011-07-13 Thread Shawn Milochik
To be clear, when you say registration/login, you mean templates/registration/login, correct? Your 'registration' directory should be in a 'templates' dir. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group,

Re: Trouble overriding registration templates

2011-07-13 Thread Joshua Russo
Cool, thanks for the confirmation. I do have my template directories explicitly listed in TEMPLATE_DIRS. I even made sure that my app's templates came before the admin templates, but for some reason it's not picking up my /registration/logged_out.html and the others that show up

Re: Trouble overriding registration templates

2011-07-13 Thread Shawn Milochik
On 07/13/2011 12:46 PM, Joshua Russo wrote: That's fine, but I was under the impression that the templates could be overridden just by creating the proper path in my template directories. Is that not true? It's true. Check the order of your TEMPLATE_DIRS in settings.py. If you don't have

Re: Trouble overriding registration templates

2011-07-13 Thread Joshua Russo
That's fine, but I was under the impression that the templates could be overridden just by creating the proper path in my template directories. Is that not true? -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this

Re: Trouble overriding registration templates

2011-07-13 Thread Andre Terra
gt; *An:* django-users@googlegroups.com > *Betreff:* Trouble overriding registration templates > > ** ** > > I want to use my own logout template but it doesn't want to pick it up. The > login template worked just fine, but for anything that's already in the > admin's templ

Re: AW: Trouble overriding registration templates

2011-07-13 Thread Joshua Russo
Am I wrong about how templates work? -- 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/-/FVBKI9qS2PQJ. To post to this group, send email to dj

Re: AW: Trouble overriding registration templates

2011-07-13 Thread Joshua Russo
Sorry, auto correct strikes again. I was trying to reply quickly from my phone. I meant auth, not author views. -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit

AW: Trouble overriding registration templates

2011-07-13 Thread Joshua Russo
I do have a views that are basically just proxies for the author views, but I was under the impression that if I just wanted to replace the registration templates then all I needed was a registration directory in my templates directory with the right file names. From there it should just take

AW: Trouble overriding registration templates

2011-07-13 Thread Szabo, Patrick (LNG-VIE)
@googlegroups.com Betreff: Trouble overriding registration templates I want to use my own logout template but it doesn't want to pick it up. The login template worked just fine, but for anything that's already in the admin's template/registration folder, it only wants to use those. I tried putting my

Trouble overriding registration templates

2011-07-12 Thread Joshua Russo
I want to use my own logout template but it doesn't want to pick it up. The login template worked just fine, but for anything that's already in the admin's template/registration folder, it only wants to use those. I tried putting my templates folder before the admin templates folder in the list

Best way of rendernig ""dynamic"" templates

2011-06-23 Thread Marc Aymerich
Hi, I'm deveolping some reusable apps with the aim of generating apache config files. The schema is: one 'base' app called apache and an arbitrary number of apps that act as OPTIONAL extensions. These extension apps fit with base app on django-admin as inlines forms, and the template is rendered

Re: I have two doubts when It comes to django url and django templates . Please help

2011-06-23 Thread Tom Evans
t is not displaying Hello User . What > can be the error ? Template inheritance replaces the blocks in the parent with the blocks in the child template with the same name. Where you output 'Hello User' is outside of any named blocks, so is ignored. Read the docs: https://docs.djangoproject.com

I have two doubts when It comes to django url and django templates . Please help

2011-06-23 Thread Satyajit Sarangi
{{user}} {% else %} {% endif %} {{ form.as_p }} {% endblock %} This is a template of mine . It is not displaying Hello User . What can be the error ? The other doubt is this . Create a map with OsmMap as baselayer This is a link on one of my templates . Osmmaps.html is a te

Proper way to reuse django's built-in admin javascript in my own templates (outside admin)?

2011-06-17 Thread br
Hi, I am using inline fromsets in my own custom forms and would like to reuse the same functionality that is provided django admin's inlines.js, particularly the add row button functionality, in order to add rows to my own inline formsets, similarly as is done in django's admin. What is the

Re: Help with Templates and ljust

2011-06-17 Thread Chris McComas
Figured it out. Added this to my Model: @property def spacer(self): return (25-len(str(self.team.name)))*' ' then in my template just added {{ team.spacer }} On Jun 17, 7:17 pm, Chris McComas wrote: > I have this as my template code: > >

Help with Templates and ljust

2011-06-17 Thread Chris McComas
I have this as my template code: http://dpaste.com/555651/ This is the HTML it is outputting, which makes sense. What I'm trying to do is make it so the closing tag is right after the team name and the whitespace from the ljust after it. http://dpaste.com/555649/ -- You received this message

Re: How Django render the various templates?

2011-06-14 Thread Derek
f following modern practice and doing feature detection: http://api.jquery.com/jQuery.support/ If you're looking to support mobile devices: http://stackoverflow.com/questions/164427/change-django-templates-based-on-user-agent http://www.chicagopython.com/blog/mobile-web-development-django/ -- You re

How Django render the various templates?

2011-06-12 Thread Nge
Hi Everyone! How can I create Django tablet site program? How can decide Django redirect the web site or mobile site or tablet site? Does there has separately browser detection? Thanks Nge -- You received this message because you are subscribed to the Google Groups "Django users" group. To

Re: Problem reversing urls when calling templates from another project

2011-05-20 Thread ALJ
ok ... still struggling. While in Public_site.views I can call functions from within the Extranet_site.views ... but I can't even do a: return HttpResponseRedirect(reverse('Extranet_site.application_name.views.function_name', args=(999,))) Within my Public_site.settings I have installed

Re: Problem reversing urls when calling templates from another project

2011-05-20 Thread ALJ
@Shawn Cheers. I'm such a c*ck. I am so used to using named URL patterns that I just assumed that that was how you did it. So yes, I've had a look at the documentation, although still struggling to get it to find the reverse, even when using the full path. -- You received this message because

Re: Problem reversing urls when calling templates from another project

2011-05-20 Thread Shawn Milochik
Does this help? http://docs.djangoproject.com/en/1.3/topics/http/urls/#topics-http-reversing-url-namespaces I found it here (where a usage example is given): http://docs.djangoproject.com/en/1.3/ref/templates/builtins/#url -- You received this message because you are subscribed to the Google

Problem reversing urls when calling templates from another project

2011-05-20 Thread ALJ
. A scenario would be that : 1. Someone creates a request on the Extranet_site or via the Public_site 2. This then gets processed using the code within Extranet_site, regardless of where the request came from. 3. An email gets sent to the relevant field manager to deal with it. The email templates

Re: Template inheritance, how to render dynamic content in base templates

2011-05-13 Thread robinne
essors that will add > dynamic data you want to display into the context. Then you can use it > even in your base template. However, you'll have to make sure each > view uses a RequestContext when rendering templates in order for the > context processors to be applied. > > As for the s

Re: Template inheritance, how to render dynamic content in base templates

2011-05-13 Thread Michal Petrucha
template tags as suggested by others. The alternative is to create custom context processors that will add dynamic data you want to display into the context. Then you can use it even in your base template. However, you'll have to make sure each view uses a RequestContext when rendering templat

Re: Template inheritance, how to render dynamic content in base templates

2011-05-13 Thread Gabe
I suggest reading about inclusion tags: http://docs.djangoproject.com/en/1.3/howto/custom-template-tags/ worked for me Gabe On 13 Maj, 07:51, Mateusz Marzantowicz wrote: > On Fri, May 13, 2011 at 5:15 AM, robinne wrote: > > How can I

Re: Template inheritance, how to render dynamic content in base templates

2011-05-13 Thread Mateusz Marzantowicz
On Fri, May 13, 2011 at 5:15 AM, robinne wrote: How can I render dynamic content in a base template if I only call a > view on my child template? > > What I am trying to do is setup a base template that will include > "Profile" information for the user who is logged

Re: Overriding templates for the inclusion_tag

2011-05-13 Thread Daniel Roseman
On Friday, May 13, 2011 1:01:26 AM UTC+1, Stodge wrote: > > Is there any interest in changing the inclusion template functionality > to let the function return the template name in the dictionary to the > inclusion_tag decorator? This would let the developer override the > template filename:

Re: Template inheritance, how to render dynamic content in base templates

2011-05-13 Thread Daniel Roseman
On Friday, May 13, 2011 4:15:59 AM UTC+1, robinne wrote: > > How can I render dynamic content in a base template if I only call a > view on my child template? > > What I am trying to do is setup a base template that will include > "Profile" information for the user who is logged in, for

Template inheritance, how to render dynamic content in base templates

2011-05-12 Thread robinne
How can I render dynamic content in a base template if I only call a view on my child template? What I am trying to do is setup a base template that will include "Profile" information for the user who is logged in, for example: "Welcome John", instead of "login here", on every page. But if I call

Overriding templates for the inclusion_tag

2011-05-12 Thread Stodge
Is there any interest in changing the inclusion template functionality to let the function return the template name in the dictionary to the inclusion_tag decorator? This would let the developer override the template filename: {{{ @register.inclusion_tag('block/render_region.html') def

Re: Print "flash" messages in templates for certain levels

2011-04-30 Thread Kenny Meyer
> Or is there other better solution? I think you should handle this in the view, like checking there if the user has sufficient privileges for seeing the message. Kenny -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group,

Print "flash" messages in templates for certain levels

2011-04-30 Thread veena
Hi, django.contrib.messages is very handy and useful app. When I use it in template I'd like to print in one place in template only messages with certain level. That's not possible as I can understand it. You can print all of them (as described in documentation): {% if messages %} {% for

Re: Best-practice for building URLs in templates with JavaScript

2011-04-23 Thread akaariai
On Apr 23, 6:43 pm, Shawn Milochik wrote: > It occurs to me now that I could just use a placeholder, and replace > that in JavaScript: >     Update Payment > > Then use the JavaScript to replace the string 'payment_id' (or a regex > on its location in the URL) when the user

Re: Best-practice for building URLs in templates with JavaScript

2011-04-23 Thread Shawn Milochik
On Sat, Apr 23, 2011 at 3:31 AM, Ryan Osborn wrote: > You could always make the payment_id group optional using a ?: > > update_payment/(?P\w+)? Ryan, Thanks. I considered that first, but rejected it because I want the extra field to be required. If it's missing then

Re: Best-practice for building URLs in templates with JavaScript

2011-04-23 Thread Artur Wdowiarski
If it's quite a big project with lots of ajax, I'd say it's worth a try to serve your urls to the client in some reasonable way and then write an equivalent of reverse() in javascript. On 23 kwi 2011, at 09:31, Ryan Osborn wrote: > You could always make the

Re: Best-practice for building URLs in templates with JavaScript

2011-04-23 Thread Ryan Osborn
You could always make the payment_id group optional using a ?: update_payment/(?P\w+)? that way this will match either: update_payment/ or update_payment/123 Hope that helps, Ryan -- You received this message because you are subscribed to the Google Groups "Django users" group. To post

Best-practice for building URLs in templates with JavaScript

2011-04-22 Thread Shawn Milochik
I'm working on an app which makes extensive use of AJAX. I'm also using named URLs so I don't have to hard-code URLs into my templates. The problem is that if a URL pattern requires extra info after the path, my templates don't render, because the extra parameters aren't known until the user

Re: problems with errors in templates

2011-04-18 Thread Antonio Sánchez
thanks, i think you are right, but now i cant check it, i'll do it later! thanks! On 17 abr, 23:00, Daniel Roseman wrote: > On Sunday, 17 April 2011 21:41:15 UTC+1, Antonio Sánchez wrote: > > > hi, im working with a modelform, and overrided clen methos for making > > some

Re: problems with errors in templates

2011-04-17 Thread Daniel Roseman
On Sunday, 17 April 2011 21:41:15 UTC+1, Antonio Sánchez wrote: > > hi, im working with a modelform, and overrided clen methos for making > some custom checks, raising a forms.ValidationError when i need, im > sure this error is raised, but i dont know why in the template errors > are not

problems with errors in templates

2011-04-17 Thread Antonio Sánchez
hi, im working with a modelform, and overrided clen methos for making some custom checks, raising a forms.ValidationError when i need, im sure this error is raised, but i dont know why in the template errors are not showed (instead of form is showed again cause it's not valid!), here is some of

Object level permissions in templates

2011-04-07 Thread Eric Hutchinson
custom user.has_perm does not get called with the object. my question is how do i use object level permissions in templates? any resources, blog posts, etc would be well appreciated. i want to make it clear that i am not using the default app level, built in permissions, so telling me to go

Re: validate user input on templates

2011-03-28 Thread Sam Walters
hey use: str.isdigit() http://www.tutorialspoint.com/python/string_isdigit.htm what is idDigit() ? is that a call to a method somewhere else. and arent you trying to validate numberofapples = request.POST['numberofapples'] not playerid? Personally if this is form data you are trying to

validate user input on templates

2011-03-28 Thread django beginner
Hi django experts, just want to know your opinion on how to validate the user input (example: the user input field should be integer, but the user accidentally inputs any character), here is my code: FYI; the numberofapples field is IntegerField here is my sample code: def

Re: Templates are parsed on every request?

2011-03-24 Thread Karen Tracey
stored in a "compiled" form. Django's cache framework > doesn't seem to be what I'm searching for, since if caches the entire > rendered template along with its dynamic context, thus shadows all > changes I make on printed variables unless I manually invalidate the > cache. &g

Templates are parsed on every request?

2011-03-24 Thread Fett
if caches the entire rendered template along with its dynamic context, thus shadows all changes I make on printed variables unless I manually invalidate the cache. Did I miss the entire point of using Django templates? Since my templates won't change once in production, parsing them on each request wasn

Re: Configuring common site URL paths for use in templates

2011-03-23 Thread emre yılmaz
> and then make these accessible in some random template using somthing like > the following: > > Can anyone suggest a good way of doing this? > 1) write your own context_processors http://docs.djangoproject.com/en/dev/ref/templates/api/#writing-your-own-context-processors 2)

Configuring common site URL paths for use in templates

2011-03-23 Thread Ian Stokes-Rees
I have a bunch of regular site paths that I'd like to be able to refer to both in my Python code and in my templates, e.g. settings.py: site_root = "/portal" contact_url = site_root + "/contact" sitemap_url = site_root + "/sitemap" login_url = site_root + "/ac

Re: how to compose templates with widgets (that has dynamic contents in it)

2011-03-20 Thread Shawn Milochik
1. Create a Django form. 2. Add a ChoiceField to the form. 3. Populate the ChoiceField's 'choices' properly with an iterable (tuple or list) full of iterables containing the key and value you like. 4. Put the form into your template somewhere within your HTML form. Shawn P.S. I recommend

how to compose templates with widgets (that has dynamic contents in it)

2011-03-20 Thread django beginner
hi django experts! May I know how to create templates that has django widgets in it? please refer to my should-be template output below: Name: here is the sample model: class Name(models.Model): name_id = models.AutoField(primary_key=True

Re: How do I use widgets on Templates and (not on Forms)?

2011-03-18 Thread Daniel Roseman
On Friday, March 18, 2011 7:29:09 AM UTC, django beginner wrote: > > Hi all, > > How do I use widgets on the field of a template(not forms)? Let's say > I have a field called Member, and this field should be in select form > that has choices from members table (field: member_name)? > > tried

Re: Add, Edit and Delete link using Forms (not templates) per row without using built django-admin functionality

2011-03-18 Thread Daniel Roseman
On Friday, March 18, 2011 2:08:02 AM UTC, django beginner wrote: > > Hi Django users, > > I am having some dilemma over converting simple admin page *Template*(without > having to use the built in django-admin functionality) by using > forms, and not templates, I have th

How do I use widgets on Templates and (not on Forms)?

2011-03-18 Thread django beginner
Hi all, How do I use widgets on the field of a template(not forms)? Let's say I have a field called Member, and this field should be in select form that has choices from members table (field: member_name)? tried using select option on html, but it ain't seem to work. any inputs? Thanks. -- You

Add, Edit and Delete link using Forms (not templates) per row without using built django-admin functionality

2011-03-17 Thread django beginner
Hi Django users, I am having some dilemma over converting simple admin page Template (without having to use the built in django-admin functionality) by using forms, and not templates, I have the following sample Admin page that allows users to add, edit and delete record per row to Forms: (Edit

Add, Edit and Delete link using Forms (not templates) per row without using built django-admin functionality

2011-03-17 Thread djangodjango django
Hi Django users, I am having some dilemma over converting simple admin page *Template*(without having to use the built in django-admin functionality) by using forms, and not templates, I have the following sample Admin page that allows users to add, edit and delete record per row* to Forms

Re: Django templates: accessing list element attributes throws error

2011-03-17 Thread Nathanael Abbotts
Thanks, will try that once I get to my computer : ) -- 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

Re: Django templates: accessing list element attributes throws error

2011-03-17 Thread werefr0g
Hi, you can try {{ list.0.title }} Regards, -- 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 templates: accessing list element attributes throws error

2011-03-17 Thread Nathanael Abbotts
I have a list of python objects with attributes, which is supplied to the django templating engine. I access the first element in the list, to get a particular attribute 'title', from it. Here is the code: {{ list|first.title }} The error given is: TemplateSyntaxError: Could not parse the

Django include templates problem, from 0.96 to 1.2

2011-02-28 Thread Pete.
Hi folks, I using google app engine, in 0.96 I have no problem to include a template as following {% include "../header.html" %} However, in 1.2 the code above not functioning?? Any idea? -- You received this message because you are subscribed to the Google Groups "Django users" group.

Re: Messages framework is not showing messages in my templates

2011-02-19 Thread Gabriel Prat
odel_create.html', {'form' : form}) > > > > > The context processor is not invoked, because you're not using a > RequestContext. So the messages variable is not added to your context. The > last line should be: > >     return render_to_response('mymodel_create.html', {'

Re: Not able to use CSS in Django templates

2011-02-19 Thread Tom Evans
C:\library > > 02/19/2011  07:29 PM              mainapp > 02/19/2011  11:26 AM               557 manage.py > 02/19/2011  08:16 PM              media > 02/19/2011  08:19 PM             3,537 settings.py > 02/19/2011  08:19 PM             2,215 settings.pyc > 02/19/2011  07:58 PM              t

Not able to use CSS in Django templates

2011-02-19 Thread The_Legend
dia 02/19/2011 08:19 PM 3,537 settings.py 02/19/2011 08:19 PM 2,215 settings.pyc 02/19/2011 07:58 PM templates 02/19/2011 08:17 PM 832 urls.py 02/19/2011 08:18 PM 655 urls.pyc 02/19/2011 11:26 AM 0 __init__.py 02

Re: Messages framework is not showing messages in my templates

2011-02-18 Thread Daniel Roseman
rm}, context_instance=RequestContext) See the documentation: http://docs.djangoproject.com/en/1.2/ref/templates/api/#subclassing-context-requestcontext (the Note box, a couple of screens down - unfortunately there's no handy id to link to directly) -- DR. -- You received this message because y

Re: Messages framework is not showing messages in my templates

2011-02-18 Thread Xavier Ordoquy
Hi, It's been some time I haven't used the messages framework but don't you see your messages with some lags ? Like try to submit twice your form and see if you don't get the messages after the second post (and don't go in the admin between those requests). When forms are valid, I usually

Messages framework is not showing messages in my templates

2011-02-18 Thread Gabriel Prat
Hi all, I'm trying to use messages framework, I've checked that middleware, context processor and app is well configured (I'm running django development version which a standard manage.py startproject includes all needed stuff) So, let me write a little bit of code, assume a model like: class

Re: Django Templates: Form field name as variable?

2011-02-16 Thread ju
tion that I decide to use: > >http://stackoverflow.com/questions/4993625/django-templates-form-fiel... > > -as-variable > > I like it too, but aren't you still stuck with validating it or are you > applying a validator to each field you generate this way? > > Mike > -- >

Re: Django Templates: Form field name as variable?

2011-02-15 Thread Mike Ramirez
ch > field of form :( > . > There is another solution that I decide to use: > http://stackoverflow.com/questions/4993625/django-templates-form-field-name > -as-variable I like it too, but aren't you still stuck with validating it or are you applying a validator to each field you generate this way?

Re: Django Templates: Form field name as variable?

2011-02-15 Thread ju
/django-templates-form-field-name-as-variable -- 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...@google

Re: Django Templates: Form field name as variable?

2011-02-14 Thread Mike Ramirez
On Monday, February 14, 2011 07:00:38 am ju wrote: > How can I make this loop to print form fields where is the > value of ticket.id? > > {% for ticket in zone.tickets %} > {{ ticket.id }}: {{ form.ticket_count_ }} > {% endfor %} > > So the output to be something like

Django Templates: Form field name as variable?

2011-02-14 Thread ju
How can I make this loop to print form fields where is the value of ticket.id? {% for ticket in zone.tickets %} {{ ticket.id }}: {{ form.ticket_count_ }} {% endfor %} So the output to be something like this... 1: 10: 12: 3: -- You received this message because you are

Re: Question about including views in base templates

2011-01-27 Thread Mika J
I see now what you mean. I can really use that. Thanks for the answer! Michael 2011/1/27 Shawn Milochik <sh...@milochik.com> > I think you're looking for context processors. > > > http://docs.djangoproject.com/en/dev/ref/templates/api/#writing-your-own-context-processors >

Re: Question about including views in base templates

2011-01-27 Thread Shawn Milochik
I think you're looking for context processors. http://docs.djangoproject.com/en/dev/ref/templates/api/#writing-your-own-context-processors You write functions that add to the context each page receives. That info is available in the template regardless of which view called the rendering. Shawn

Question about including views in base templates

2011-01-27 Thread Mishen'ka
Hello everyone, I'm a while busy with coding in Django applications. Now i have a question, because what I want to do, doesn't work right. if I request the url: http://localhost/shorts/ I have a short template who gives me messages. This template is loaded in a default template base.html. Now

Re: templates - pulling child templates

2011-01-21 Thread Tom Evans
On Fri, Jan 21, 2011 at 2:59 PM, km <srikrishnamo...@gmail.com> wrote: > Hi all, > > The docs say we can have multiple child templates extending the parent > template. But then how to render multiple  child templates in one call ? > > regards, > KM > I don't thin

Re: templates - pulling child templates

2011-01-21 Thread km
Hi all, The docs say we can have multiple child templates extending the parent template. But then how to render multiple child templates in one call ? regards, KM On Fri, Jan 21, 2011 at 8:14 PM, km <srikrishnamo...@gmail.com> wrote: > > Hi all, > > On Fri, Jan 21, 2011

Re: templates - pulling child templates

2011-01-21 Thread km
d automatically. >> both base.html and child html are in the same dir. >> I am using django 1.2.4 on ubuntu 10.10 >> what could be the problem? >> >> pls let me know. >> regards, >> KM >> > > You're doing it the wrong way round. Child templa

Re: templates - pulling child templates

2011-01-21 Thread Daniel Roseman
problem? > > pls let me know. > regards, > KM > You're doing it the wrong way round. Child templates extend parent templates, so you need to render the child. -- DR. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post

Re: templates - pulling child templates

2011-01-21 Thread David De La Harpe Golden
he browser(firefox 3.x) but the child html > pages, holding content details, which extend base.html does not get pulled > automatically. > pls let me know. Um. It sounds like you've misunderstood something about how the template inheritance mechanism works or what it's for. Do you expect

Re: templates - pulling child templates

2011-01-21 Thread Tom Evans
On Fri, Jan 21, 2011 at 12:08 PM, km wrote: > Hi all, > > I am trying to display a  parent django template (base.html) with a view > function called "base" like this: > > def base(request): >    return render_to_response('base.html') > > The base.html gets displayed in

templates - pulling child templates

2011-01-21 Thread km
Hi all, I am trying to display a parent django template (base.html) with a view function called "base" like this: def base(request): return render_to_response('base.html') The base.html gets displayed in the browser(firefox 3.x) but the child html pages, holding content details, which

TestCase.urls with templates that have url to other apps

2011-01-15 Thread Vitaly Babiy
class EmailNotificationTest(BaseTestCase): """ Test Class for testing email notification """ urls = 'notification.urls' def test_create_notification(self): res = self.client.get('email/create/) # will fail self.assertEquals(res.status_code, 200) If I

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

2011-01-07 Thread Sells, Fred
oups.com Subject: Re: ReportLab and Django - templates? ; FK object has no attribute split Hi Victor, It really depends on complexity of your PDF. I needed to do something similar some time ago and used ReportLab addon called "pisa" and used standard Django template language to define

Re: Templates Directory Question

2011-01-03 Thread Daniel Hepper
You can put the templates anywhere you want, by a good place is a directory named templates in the base directory of your project, i.e. C:\DjangoProjects\mysite\templates\ Don't forget to add this path to the TEMPLATE_DIRS variable in your settings.py. The template file from the example would

Re: Templates Directory Question

2011-01-03 Thread Anthony Pearce
<mo.mughr...@gmail.com> wrote: > By document root they mean apache public directory, aka htdocs > > Sent from my iPhone > > On Jan 3, 2011, at 4:53 PM, Anthony Pearce <coden...@gmail.com> wrote: > > > > > In Tutorial 2, I was instructed to make a

Re: Templates Directory Question

2011-01-03 Thread Mo J. Al-Mughrabi
By document root they mean apache public directory, aka htdocs Sent from my iPhone On Jan 3, 2011, at 4:53 PM, Anthony Pearce <coden...@gmail.com> wrote: > In Tutorial 2, I was instructed to make a templates directory. It is > located at: > C:\DjangoProjects\mysite\template

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