Re: HttpResponseRedirect and IE6

2007-07-17 Thread Bob Dively
On Jul 16, 10:23 am, Bob Dively <[EMAIL PROTECTED]> wrote: > I have some suspicion that an Apache misconfiguration is at fault as This problem appears to have been fixed by setting Apache's MaxRequestsPerChild setting back to 0. Of course, that's no good for development purposes, but

Re: HttpResponseRedirect and IE6

2007-07-17 Thread Bob Dively
On Jul 16, 10:23 am, Bob Dively <[EMAIL PROTECTED]> wrote: > I have some suspicion that an Apache misconfiguration is at fault as When I set Apache's MaxRequestsPerChild to 0 (as it should be for production environments), this issue seems to go away. That doesn't make it less of a P

Re: HttpResponseRedirect and IE6

2007-07-16 Thread Bob Dively
I'm also having a problem with redirecting and IE6. User enters data in an HTML form, clicks save button and gets IE's "The page cannot be displayed" error. In this case the initial URL is /household123/client/ add/ and the browser should be redirected to /household123/. However, the URL is is

Re: displaying values with SelectDateTime widget

2007-07-05 Thread Bob Dively
On Jul 5, 4:20 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I take it you're using a default {{form}} view instead of outputting > your own? > If you output your own, it's as simple as using the |date:"" filter. It's not a formatting problem. I can't figure out how to get the correct

displaying values with SelectDateTime widget

2007-07-05 Thread Bob Dively
I'm trying to use the SelectDateTime widget but I can't figure out how to get it to correctly display a value retrieved from a database. For example: client = Client.objects.get(Client_ID=client_id) ClientForm = forms.models.form_for_instance(client) ClientForm.base_fields['Birth_Dat'].widget =

Re: not getting custom template tags

2007-05-25 Thread Bob Dively
On May 25, 4:06 pm, "Jeremy Dunck" <[EMAIL PROTECTED]> wrote: > That appears related to filters, somehow. Please include the full > code for your templates. Not really feasible since there are dozens. --~--~-~--~~~---~--~~ You received this message because you

Re: not getting custom template tags

2007-05-25 Thread Bob Dively
Thanks for the info, Jeremy. If I change register.simple_tag("media") to register.simple_tag(media), and I remove that extraneous path from INSTALLED_APPS, I now get this error, also from template/__init.py__: Exception Type: TemplateSyntaxError Exception Value:Could not parse

not getting custom template tags

2007-05-25 Thread Bob Dively
Despite several hours of poking around, I'm just not getting how to make custom template tags and would greatly appreciate a little hand holding. I've created a directory called "templatetags" that's in the same directory as models.py and views.py. In the templatetags directory, there's an

Re: problem with file download?

2007-05-15 Thread Bob Dively
On May 14, 5:16 pm, Bob Dively <[EMAIL PROTECTED]> wrote: > The file is sent to the browser (Firefox), which understands the > mimetype correctly and hands the file off to Excel. However, Excel > says that the file is in an unrecognized format. When I open the file > with E

problem with file download?

2007-05-14 Thread Bob Dively
Hi all. Another n00b question. I'm trying to send an Excel file to the user thusly: fullpath = os.path.join('C:/', 'text.xls') response = HttpResponse(file(fullpath).read(), mimetype='application/ vnd.ms-excel') response['Content-disposition'] = 'Attachment; filename=extract.xls' return response

Re: how do I get new record PK after save()?

2007-05-14 Thread Bob Dively
On May 10, 8:02 pm, "Russell Keith-Magee" <[EMAIL PROTECTED]> wrote: > Not quite. AutoField defines a field that tells the DB to choose the > next available value. An AutoField is added automatically to every > Django model that doesn't define its own 'primary_key=True' field > (i.e., you don't

Re: how do I get new record PK after save()?

2007-05-10 Thread Bob Dively
On May 10, 5:12 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > You have to change it to: > > Foo_ID = models.AutoField(primary_key=True, editable=False) Ah, ok, so even though the db (MySQL) is taking care of incrementing the column value on insert, the model has to know that the DB is

how do I get new record PK after save()?

2007-05-10 Thread Bob Dively
Another n00b question: How do I get a new record's PK after save()? If I have: class Foo(models.Model): Foo_ID = models.IntegerField(primary_key=True, editable=False) Foo_Text = models.CharField(blank=True, maxlength=150) And I have a view that contains something like: if

Re: Newforms and foreign keys

2007-05-09 Thread Bob Dively
[Following up to myself to post about my resolution] I resolved the issue by: 1. setting editable=true for the foo class 2. hiding the bar field in the rendered HTML with: FooForm.base_fields['bar'] = forms.CharField(widget=HiddenInput(), initial=bar_id) 3. replacing form.save() with: n =

Re: Newforms and foreign keys

2007-05-04 Thread Bob Dively
On May 4, 4:33 pm, Bob Dively <[EMAIL PROTECTED]> wrote: > I'm struggling to understand newforms. Specifically, when creating a > new record, I can't figure out how to populate the new record's parent > foreign key value. For example (leaving out imports and so forth): I've just