Re: Generating a list of available templates

2014-10-28 Thread William Stewart
I know this thread has been dead for over 2 years, but I've been trying to solve this problem or a similar problem today for a library I'm working on. I've only tested it with the filesystem and app_directories loaders, but the code I've got to so far looks like this: for loader in settings.TEM

Re: how to save in inline form total sum

2014-10-28 Thread carlos
Hi, +Collin i update my ModelA and now is this: class ModelA(models.Model): field1 = charfield(...) field2 = integeterfield() total_men = integerField(editable=False) total_women = integerField(editable=False) def save(self, *args, **kwargs): #this is for sum all 3 data put

[polls tutorial] error message not showing

2014-10-28 Thread otmeek
I am trying to follow part 4 of the polls app tutorial. I am new to Django and not very experienced with Python or programming in general. My problem is throwing an error message when "Vote" is pressed without a choice being selected. polls/views.py: from django.shortcuts import render, get_obj

Re: [polls tutorial] error message not showing

2014-10-28 Thread Charly Román
Import Choice in this file. 2014-10-28 13:06 GMT-06:00 otmeek : > I am trying to follow part 4 of the polls app tutorial. I am new to Django > and not very experienced with Python or programming in general. > > My problem is throwing an error message when "Vote" is pressed without a > choice bei

Re: How to get rid of help text on a ModelForm?

2014-10-28 Thread Daniel Grace
Oops, too much indentation on the "def ..." line. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this grou

Re: [polls tutorial] error message not showing

2014-10-28 Thread otmeek
I completely missed that. Thank you!! On Tuesday, 28 October 2014 20:20:14 UTC+1, Charly Román wrote: > > Import Choice in this file. > > > 2014-10-28 13:06 GMT-06:00 otmeek >: > >> I am trying to follow part 4 of the polls app tutorial. I am new to >> Django and not very experienced with Python

What is the purpose of the include function?

2014-10-28 Thread Daniel Grace
Hi, In reference to urls.py what is the purpose of the include function? For example what is the difference between these two lines? url(r'^admin/', admin.site.urls), url(r'^admin/', include(admin.site.urls)), -- You received this message because you are subscribed to the Google Groups "Djang

Dictionary passed to widget attr gets mutated

2014-10-28 Thread Leon Sasson
When a dictionary is passed to a Widget as the `attr` kwarg, to be used in filling HTML attributes, this dictionary is mutated, so cannot be reused. See below example to see a clear problem with this. Note how in the first form, when printer as_p(), the second field (session_end) gets an incorre

Rendering TabuarInline inside ModelAdmin without a foreign key

2014-10-28 Thread Mario Gudelj
Hi list, I have a table of orders where one of the columns is a IntegerField containing the id of a user who created the order. Since it's not a FK field django admin can't display these orders inline inside the user details page. I would normally use something like: class OrderInline(admin.Tab