Form that handles variable number of inputs.

2009-11-20 Thread apramanik
Hi all, How would I get a Form to handle a variable number of inputs (these inputs are added via javascript)? Is this possible in Django? Thanks! Abhik -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: MemoryError when adding a lot of data

2009-11-20 Thread Karen Tracey
On Fri, Nov 20, 2009 at 6:19 PM, Doug Blank wrote: > Some additional data: > > I'm using Django 1.1 on Fedora11 with sqlite backend. I get the same > kind of spiking of memory usage if I just enter: > > >>> Person.objects.all().delete() > > Memory usage continues to grow,

Re: Complex Query Question

2009-11-20 Thread Javier Guerra
mystand wrote: > I need to do a query that selects all Events that a logged in user can edit. > They can edit an event if they are in the default group, if they are in any > of the other groups, or they are one of the users added to the event. first of all, it might be easier if you follow the

Re: MemoryError when adding a lot of data

2009-11-20 Thread Doug Blank
On Fri, Nov 20, 2009 at 6:32 AM, Doug Blank wrote: > I'm filling my Django tables with data through a regular Python > program (not through the browser). After it runs for a few hours, I > get: > > 10557896: ERROR: gramps.py: line 121: Unhandled exception > Traceback (most

Complex Query Question

2009-11-20 Thread mystand
Hi all, I have a question about a complicated query I need to do. I have a model for an event like this: class Events(models.Model): default_group = models.ForeignKey(Group, related_name='default_group', null=True) group = models.ManyToManyField(Group) users =

Re: viewing and adding comments while editing an object in the admin interface

2009-11-20 Thread Andrew Ball
It looks like overriding the change_form.html template for the Admin site (described at http://docs.djangoproject.com/en/dev/ref/contrib/admin/#adminsite-objects) to include the template tags for the comments may do the trick, but I haven't yet had time to experiment with this approach ... On

Re: How to server static media secured by Django authentication

2009-11-20 Thread Glenn Tenney
At 11:49 PM -0600 9/11/09, Gabriel Gunderson wrote: >On Fri, Sep 11, 2009 at 3:03 PM, Jim Myers wrote: >> I have a requirement to serve static files only to users authenticated >> through Django secure login. > >http://docs.djangoproject.com/en/dev/howto/apache-auth/ I've

Re: OperationalError server closed the connection unexpectedly

2009-11-20 Thread james...@gmail.com
On 11 nov, 14:17, Janusz Harkot wrote: > Request Method: GET > Request URL:    http://localhost/ > Exception Type: OperationalError > Exception Value: > server closed the connection unexpectedly >         This probably means the server terminated abnormally >        

Re: Admin not looking in templates/admin/flatpages/flatpage for change_form.html

2009-11-20 Thread Nev
An update. The correct behaviour occurs when the site is served via apache and fcgi from my A Small Orange account. But the incorrect behaviour occurs when the site is served locally using 'manage.py runserver'. -- You received this message because you are subscribed to the Google Groups

Re: has_delete_permission not called in an admin template?

2009-11-20 Thread rd-london
And ... yes there does seem to be a better way. Define own version of "changelist_view" e.g.: def changelist_view(self, request, extra_context=None): extra_context={ 'has_delete_permission': self.has_delete_permission (request) } return super(MyCommentsAdmin,

Re: has_delete_permission not called in an admin template?

2009-11-20 Thread rd-london
Right, I've worked out why this is: django/contrib/admin/options.py - def changelist_view(self, request, extra_context=None): contains the line: context = { 'title': cl.title, 'is_popup': cl.is_popup, 'cl': cl, 'media': media,

Re: Good way to modify admin list_filter based on is_superuser?

2009-11-20 Thread Daniel Roseman
On Nov 20, 3:26 pm, JHeasly wrote: > In using Simon W.'s "simple example of row-level permissions in the > admin"  (http://www.djangosnippets.org/snippets/1054/), I'm trying to > extend the concept by modifying the 'list_filter' tuple of the > subclassed ModelAdmin based

Re: digg style pagination

2009-11-20 Thread Oleg Oltar
Agree. Fixed now On Thu, Nov 19, 2009 at 11:51 AM, Tim Chase wrote: >> But getting an exception. Could you help to fix it please? >> >> TemplateSyntaxError at /section/home >> >> Caught an exception while rendering: 'request' >> >> Original Traceback (most recent

Re: querySet + select distinct

2009-11-20 Thread Bill Freeman
On Fri, Nov 20, 2009 at 2:47 AM, Andy McKay wrote: > On 09-11-19 3:36 PM, Benjamin Wolf wrote: ... > > Try using values in the filter eg: > > Disposal.objects.values("mydate").filter(mydate__year__gte=2008).distinct() > > The problem is the default django query selects all the

Re: Strange debugger behavior

2009-11-20 Thread Bill Freeman
I don't actually know, but I have a guess... Ordinarily the blah.objects.exclude(...).filter(...) doesn't actually perform the query. It instead happens when you use it in, for example for obj in qset. But your fancy debugger may be trying to get variable values to display in a variables value

Re: autogenerated 'id' field from Django model doesn't autoincrement?

2009-11-20 Thread Ken MacDonald
> > All of this looks correct. Note the data type of integer is not wrong -- > serial is not a true data type. See: > > http://www.postgresql.org/docs/8.1/static/datatype.html#DATATYPE-SERIAL > > > >> >> > So, it has a sequence, but the sequence is out-of-sync (value=7) with the >> actual DB

Good way to modify admin list_filter based on is_superuser?

2009-11-20 Thread JHeasly
In using Simon W.'s "simple example of row-level permissions in the admin" (http://www.djangosnippets.org/snippets/1054/), I'm trying to extend the concept by modifying the 'list_filter' tuple of the subclassed ModelAdmin based upon the request.user.is_superuser property buy am struggling with

has_delete_permission not called in an admin template?

2009-11-20 Thread rd-london
Hi, Wonder if anyone can help. Have following chunk in my own change_list.html template: {% block object-tools %} {% if has_add_permission %} {% blocktrans with cl.opts.verbose_name as name %}Add {{ name }}{% endblocktrans %}

Re: autogenerated 'id' field from Django model doesn't autoincrement?

2009-11-20 Thread Karen Tracey
On Fri, Nov 20, 2009 at 9:25 AM, Ken MacDonald wrote: > Hi, > There's no 'id' in my other fields; the manage.py sql DOES report it as > being 'serial', however the field definition in pgadmin III reports: > > -- Column: id > > -- ALTER TABLE cardtype_cardrange DROP COLUMN id;

Re: Command (Windows+R >cmd) Python

2009-11-20 Thread Mikey3D
Thanks Steve, it works beautiful. ;) On Nov 20, 9:14 am, Steve Holden wrote: > The Python install isn't adding the directory containing the Python > executable to your windows PATH. You just need to add > ";C:\Python26;C:\Python26\Scripts" to the end of your path (which you

Re: autogenerated 'id' field from Django model doesn't autoincrement?

2009-11-20 Thread Ken MacDonald
> > from django.db import models >> >> # Create your models here. >> class Cardrange(models.Model): >> minbin = models.DecimalField(max_digits=12, decimal_places=0) >> maxbin = models.DecimalField(max_digits=12, decimal_places=0) >> >> minpan = models.IntegerField() >> maxpan =

Re: Command (Windows+R >cmd) Python

2009-11-20 Thread Steve Holden
The Python install isn't adding the directory containing the Python executable to your windows PATH. You just need to add ";C:\Python26;C:\Python26\Scripts" to the end of your path (which you can do in My Computer | Properties | Advanced | Environment Variables. regards Steve On Fri, Nov 20,

Command (Windows+R >cmd) Python

2009-11-20 Thread Mikey3D
I have new Windows 7 64-bit instead the old Windows 98. I'm going through setup before starting Django project. I downloaded Windows x86 MSI Installer (2.6.4) - http://www.python.org/download/ and I clicked Start >All Program >Python 2.6 >IDLE (Python GUI) I get:

Exclusion search for django

2009-11-20 Thread http://groups.google.com/group/django-users/
Hi, i´m programming an exlusion search for django but my code is not working. I think the functions are okay but django is not accepting them / running them. Only my ajaxwindow comes. When i start this tag search an ajax window will pop up and i can choose tags from 2 boxes. In the first box are

Using Named Pairs

2009-11-20 Thread esatterwh...@wi.rr.com
When using nested tuples for the choices option on a model you get the get_foo_display(). to get the readable version of the choice. However I want to get at the name of the groups. for example in the docs: MEDIA_CHOICES = ( ('Audio', ( ('vinyl', 'Vinyl'), ('cd', 'CD'),

MemoryError when adding a lot of data

2009-11-20 Thread Doug Blank
I'm filling my Django tables with data through a regular Python program (not through the browser). After it runs for a few hours, I get: 10557896: ERROR: gramps.py: line 121: Unhandled exception Traceback (most recent call last): ... event = models.Event.objects.get(handle=ref) File

Re: ModelForm usage

2009-11-20 Thread gerhard . oettl
Daniel Roseman schrieb: > On Nov 11, 10:04 am, gerhard.oe...@ogersoft.at wrote: >> Hello >> >> I am new to django and try to use the ModelForm paradigma, but can't get the >> point ;-(( > > As the documentation says, the point of a modelform is firstly to > validate input from a user and save it