Cookie muncher

2008-12-08 Thread globophobe
I am still having trouble with Safari and cookies. I can login only sometimes with Safari. About half the time I receive an error page. There is a login box on all the pages of my site. Since I need to set a test cookie before users login, I have the following code in a class that is in the base

Cookie domain

2008-12-04 Thread globophobe
Since upgrading to django 1.0 I've noticed some strange behavior with cookies. 1) Basically, if I do not set SESSION_COOKIE_DOMAIN to a value then my site is not accessible by either Mac Safari or Mac/PC IE. 2) If I set a value of ".domain.com" then my site is accessible by all Mac web browsers,

forms.BooleanField

2008-10-05 Thread globophobe
I encountered this when I upgraded from my recent copy of 0.97 django to 1.0-final. Why does MyForm not validate when instantiated as m = MyForm({'bfield':'False'})? In [27]: class MyForm(forms.Form): bfield = forms.BooleanField() : : In [28]: m = MyForm({'bfield':'False'})

Re: ModelForm and request.POST

2008-09-30 Thread globophobe
Doh, I changed the prefix of my form. I get it now. Thank you Malcolm. --~--~-~--~~~---~--~~ 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 unsub

Re: ModelForm and request.POST

2008-09-29 Thread globophobe
On Sep 30, 10:29 am, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > I strongly suspect you're debugging the wrong problem here. > > Regards, > Malcolm I am passing all the required arguments into the form. I wrote a simple dispatcher that parses request.POST into a dictionary of the form: {mode

Re: Custom attributes of RadioSelect widget choices

2008-09-29 Thread globophobe
On Sep 30, 6:08 am, davenaff <[EMAIL PROTECTED]> wrote: > 2. If not, how have people solved this in the past (subclass the > RadioSelect widget?) Take a look at django.forms.widgets.RadioFieldRenderer Subclass it, specifically the 'render' method. Then add the 'render' param to your form's Radio

Re: ModelForm and request.POST

2008-09-29 Thread globophobe
Pardon me, it's early. What I mean to do is pass new data to the form to be saved to the object. If I create a new object with the ModelForm then it's OK to pass the data to the form in a dictionary, i.e. f = ArticleForm({'title':'Old news'}) In [60]: f.is_valid() Out[60]: True However, if I w

Re: ModelForm and request.POST

2008-09-29 Thread globophobe
On Sep 30, 7:39 am, Alex Koshelev <[EMAIL PROTECTED]> wrote: > If you what to provide some init state for form - use `initial` param I tried to use the 'intial' param, however, i = {'title':'Old news'} a = Article.objects.get(title='Big news') f = ArticleForm(initial=i, instance=a) In [50]: f.i

ModelForm and request.POST

2008-09-29 Thread globophobe
I would like to instantiate a modelform with a dictionary to work with an existing object, e.g. a = Article.objects.get(title='Big news') f = ArticleForm({'title':'Old news'}, instance=a) However, ModelForm seems to require request.POST rather than a dictionary, i.e. f = ArticleForm(request.POS

Re: Problems with signals accessing kwargs

2008-09-14 Thread globophobe
Try: if 'created' in kwargs: if kwargs['created']: # Send email --~--~-~--~~~---~--~~ 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@googlegroup

Change 'name' attribute of form field

2008-09-14 Thread globophobe
Prior to django's 1.0 release, I had unfortunately avoided django's forms. Now, I've mostly converted my project to make use of them. I want to use django to display the form field in my templates; however, I want the 'name' attribute of the field to be as below, but the value does not change: I

Re: Naughty word filter

2008-01-25 Thread globophobe
On Jan 26, 2:29 pm, Tim Chase <[EMAIL PROTECTED]> wrote: > Django comes with a naughty-word filter/validator, > hasNoProfanities.  Just set the PROFANITIES_LIST in your > settings.py to be the list of words you don't want to include.  I > believe there's already a modest default list detailed in >

Naughty word filter

2008-01-25 Thread globophobe
I'm preparing my site for general consumption and would prefer that naughty words not be presented in usernames or on public pages. Is there a recommended way of filtering out the uncouth? --~--~-~--~~~---~--~~ You received this message because you are subscribed to

'module' object has no attribute 'urlpatterns'

2008-01-23 Thread globophobe
I've searched the web and this group, and the consensus seems to be that I must have a problem with my urls.py in one or more places; however, I'm at a loss as to where that might be. I recently transitioned from a fastcgi deployment proxied from nginx to mod_python. Previously, nginx was handlin

Re: Is there a better way to do this with the DB API?

2007-12-05 Thread globophobe
On Dec 6, 10:29 am, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Wed, 2007-12-05 at 15:34 -0800, globophobe wrote: > Probably an easier question to answer if we could see the models > involved (and perhaps an English description of what you are wanting to > achieve). My g

Is there a better way to do this with the DB API?

2007-12-05 Thread globophobe
I've read the documentation. I admit to being more than a little deficient with databases. Can anybody suggest a better way? if len(study) < 20: exclude = user.study_set.filter(stack=stack).values('card') cards = stack.card_set.exclude(id__in=[i.get('card') for i in exclude])[:20-len(stud

request.user -> logout

2007-11-08 Thread globophobe
This is probably a simple question, but once I've a logged-in user with django.contrib.auth.authenticate what is the recommended way to log out the user? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users

nginx + django dev server => WSGIRequestHandler instance has no attribute 'path'

2007-10-27 Thread globophobe
I checked out a recent copy of django from svn recently, and "path_info" returned to rear its ugly head. The patch as per http://code.djangoproject.com/ticket/3414 (mostly) resolves the issue. There doesn't seem to be a problem with FastCGI on my iBook nor on my FreeBSD production machine; howeve

Re: django + nginx: upstream split a header line in FastCGI records

2007-07-13 Thread globophobe
Atypically, the moment I petition for help I solve the problem myself. Solution: Use the latest development version b/c Changes with nginx 0.6.2 09 Jul 2007 *) Bugfix: if the FastCGI header was split in records, then nginx passed garbage in the

django + nginx: upstream split a header line in FastCGI records

2007-07-13 Thread globophobe
Does anyone know what this is about? 2007/07/14 00:35:54 [alert] 22564#0: *17 upstream split a header line in FastCGI records while reading response header from upstream, client: 127.0.0.1, server: localhost, URL: "/", upstream: "fastcgi:// unix:/tmp/django1.sock:", host: "localhost", referrer: "