Re: on delete cascade - best way to do override this behaviour?

2009-03-12 Thread SnappyDjangoUser
I am in the same boat as Erwin. Does anyone have any suggestions on the best solution to avoid the cascading delete? Override the delete () method? Foreign key restrictions at the DB level? -Brian On Feb 9, 8:56 am, Erwin Elling wrote: > Dear community, > On some of

Re: Sessions Unexpectedly Causing Logout

2009-02-11 Thread SnappyDjangoUser
On Feb 3, 6:10 pm, Graham Dumpleton <graham.dumple...@gmail.com> wrote: > On Feb 4, 6:43 am, SnappyDjangoUser <bpwall...@gmail.com> wrote: > > > > > I am having a weird issue in which users are randomly logged out of > > the site and redirected to the login page.

Re: Sessions Unexpectedly Causing Logout

2009-02-11 Thread SnappyDjangoUser
On Feb 3, 6:10 pm, Graham Dumpleton <graham.dumple...@gmail.com> wrote: > On Feb 4, 6:43 am, SnappyDjangoUser <bpwall...@gmail.com> wrote: > > > > > I am having a weird issue in which users are randomly logged out of > > the site and redirected to the login page.

Sessions Unexpectedly Causing Logout

2009-02-03 Thread SnappyDjangoUser
I am having a weird issue in which users are randomly logged out of the site and redirected to the login page. They must re-enter credentials before being able to continue browsing the site. The weird thing is I only see this on my production machine and not on my development box (both serving

Re: Combining form fields into a single MultiWidget and getting all field data returned

2009-01-15 Thread SnappyDjangoUser
(self.error_messages ['invalid_update_preference']) return data_list return None On Jan 13, 4:31 pm, SnappyDjangoUser <bpwall...@gmail.com> wrote: > Hi All, > > Is there a way to "link" 2 form fields or use a create a MultiWidget > consisting of 2

Re: Slow application performance...

2009-01-14 Thread SnappyDjangoUser
I am having a similar problem with super slow performance in my production environment (Apache with mod_python). Does anyone have suggestions of settings that I can try tweaking? Graham has provided a lot of useful information earlier in the post, but I am with Vernon in that I am unsure

Combining form fields into a single MultiWidget and getting all field data returned

2009-01-13 Thread SnappyDjangoUser
Hi All, Is there a way to "link" 2 form fields or use a create a MultiWidget consisting of 2 fields so they are logically displayed together? I have a search form which asks the user for a date range to search and I am trying to figure out the best way to display them. The obvious option would

Re: Sort Table Headers after data has been rendered via a POST request

2008-12-15 Thread SnappyDjangoUser
:29 pm, SnappyDjangoUser <bpwall...@gmail.com> wrote: > I am hoping someone from this list may have some ideas on a solution > to a problem I am facing... > > I am using aSortHeadersclass to perform ascending and descending > filtering on table column headers.  (TheSortHeader

Sort Table Headers after data has been rendered via a POST request

2008-11-25 Thread SnappyDjangoUser
I am hoping someone from this list may have some ideas on a solution to a problem I am facing... I am using a SortHeaders class to perform ascending and descending filtering on table column headers. (The SortHeaders is found on Django Snippets, http://www.djangosnippets.org/snippets/308/, and

Django Application for performing Model Searches

2008-10-13 Thread SnappyDjangoUser
Hi, Is anyone aware of a django utility that has already been developed to search model fields? I have found djangosearch and django-search in the google code projects, but it appears that these only support basic text search. They do not support searching boolean fields, date fields, etc

Re: Filter horizontal question

2008-10-09 Thread SnappyDjangoUser
I think you are looking for the Pagination class. Check out the documentation at http://docs.djangoproject.com/en/dev/topics/pagination/. On Oct 7, 2:14 am, Donn <[EMAIL PROTECTED]> wrote: > Hi, > After spending many (many) days on my own CRUD system I am *really* seeing the > beauty of the

Re: Using forloop counter to index into a query set

2008-09-30 Thread SnappyDjangoUser
for each product zipped = [] count = 0 for form in formset.forms: product = product_queryset[count] zipped.append( ( form, product) ) # add them as a tuple count = count + 1 Thanks! On Sep 30, 12:36 pm, SnappyDjangoUser <[EMAIL PROTECTED]> wrote: > This is extremely helpful!  I di

Re: Using forloop counter to index into a query set

2008-09-30 Thread SnappyDjangoUser
, v) ) # add them as a tuple > >    # or more pythonically if its easy to find your vendor: >    zipped = [ (p, vendor for product) for p in products ] >    context = { 'products': zipped } > > {% for product, vendor in products %} >   {{product}} {{vendor}} > {% endfor %} > &g

Re: Using forloop counter to index into a query set

2008-09-30 Thread SnappyDjangoUser
uot;for loop" tag in Django is built only to iterate through one structure at a time. Do you have any examples how how to loop through 2 strucutres simultaneously? Thanks! -Brian On Sep 30, 12:10 am, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Mon, 2008-09-29 at 17:3

Re: Using forloop counter to index into a query set

2008-09-29 Thread SnappyDjangoUser
it might be easiest to write a custom tag there > > {% vendor_of_product product forloop.counter %} > > is product an array ? > > On Sep 30, 2:31 am, SnappyDjangoUser <[EMAIL PROTECTED]> wrote: > > > Hi Folks, > > > How can I use a forloop counter to index into a q

Using forloop counter to index into a query set

2008-09-29 Thread SnappyDjangoUser
Hi Folks, How can I use a forloop counter to index into a query set as in the example below? (I know this code does not work, but I want to do something of the sort): {% for form in quote_product_formset.forms %} {{ product.(forloop.counter).Vendor }} {{ form }} {%

Printing a specific form within a formset in a template file

2008-09-26 Thread SnappyDjangoUser
Hi Folks- Is it possible to access a specific form (i.e. form 1 of n) within a formset and print that form within a template file? All the examples on the Django documentation page show accessing formset forms via a forloop and I have not been able to find my answer within the docs. For

Re: Manager to add entries where there is a ManyToMany relationship

2008-09-25 Thread SnappyDjangoUser
://www.djangoproject.com/documentation/models/m2m_intermediary/ I'm a bit stuck at the moment, so I would really appreciate any guidance you can provide. Thank you! On Sep 24, 11:53 am, SnappyDjangoUser <[EMAIL PROTECTED]> wrote: > Hi Everyone, > > I need some guidance with adding tabl

Manager to add entries where there is a ManyToMany relationship

2008-09-24 Thread SnappyDjangoUser
Hi Everyone, I need some guidance with adding table entries where I have a M2M table relationship. I am adding entires via a Quote ModelForm. The problem is that I am getting the following error when submitting the form: "Cannot set values on a ManyToManyField which specifies an intermediary

TemplateSyntaxError: Caught an exception while rendering: coercing to Unicode: need string or buffer, long found

2008-09-15 Thread SnappyDjangoUser
Hi Folks, I am receiving an obscure TemplateSyntaxError (Caught an exception while rendering: coercing to Unicode: need string or buffer, long found ) when rending a ModelForm that has a foreign key back to a specific table. My template correctly renders forms for all models except for this

Re: Accessing field names and data from a queryset in a generic template

2008-09-15 Thread SnappyDjangoUser
EMAIL PROTECTED]> wrote: > SnappyDjangoUser wrote: > > I am a new django user so please excuse my naive question. > > > I have a generic view function (see below) which is used to perform a > > query on one of many tables (depending on the "model" argumen

Accessing field names and data from a queryset in a generic template

2008-09-11 Thread SnappyDjangoUser
I am a new django user so please excuse my naive question. I have a generic view function (see below) which is used to perform a query on one of many tables (depending on the "model" argument) and then render the results to a single template file (object_list.html) def item_list(request,