'WSGIRequest' object has no attribute 'session'

2008-11-08 Thread 为爱而生
Hi,all. I often meet this problem recently while I run the django project. How to fix it? Thanks. Traceback (most recent call last): File "/usr/lib/python2.5/site-packages/django/core/servers/basehttp.py", line 277, in run self.result = application(self.environ, self.start_response) File

Re: filtering in a template based on foreign key or query params

2008-11-08 Thread Milan Andric
Oh, the answer here was to use the regroup template tag. Thanks Magus. -- Milan On Fri, Nov 7, 2008 at 4:37 PM, Milan Andric <[EMAIL PROTECTED]> wrote: > > Any thoughts on this one? Just checking. > > Thanks. > > On Nov 6, 9:06 pm, "Milan Andric" <[EMAIL PROTECTED]> wrote: > > Hello, > > > > I

None model error handling in view

2008-11-08 Thread VP
Hi all, How to handle errors from different modules, for example CSV or DATETIME in view? I am trying to parse CSV content in my view after an uplod a file by user. def my_view(request): ... try: for row in csv.reader(request.FILES['file']): for i in range(0, len(row)

Re: Per-Test Caching?

2008-11-08 Thread Alex Koshelev
Use database backend for caching while testing. Tests create temporary database so it will have no side effects. On Sun, Nov 9, 2008 at 03:13, Adam Seering <[EMAIL PROTECTED]> wrote: > > Hi, >I have a Django app that relies heavily on caching. I'd like > "./manage.py test" to run on its

Per-Test Caching?

2008-11-08 Thread Adam Seering
Hi, I have a Django app that relies heavily on caching. I'd like "./manage.py test" to run on its own test cache instance (so it doesn't see keys from previous runs / other development / etc). I can write code to set up the cache appropriately, but, where can I put it s.t. it ru

Re: global name 'Image' is not defined

2008-11-08 Thread Tsinga
This is the definition of NameError: "Raised when a local or global name is not found. This applies only to unqualified names. The associated value is an error message that includes the name that could not be found." I don't know what I doing wrong! On Nov 8, 4:07 pm, "Alex Koshelev" <[EMAIL PR

Re: global name 'Image' is not defined

2008-11-08 Thread Tsinga
I have checked it out once again. Seems to be the right character! Thanks On Nov 8, 4:07 pm, "Alex Koshelev" <[EMAIL PROTECTED]> wrote: > I think you have a typo in this line, May be you write `Image.new` with > lowercase "L" not uppercase "I" as first char. > > On Sun, Nov 9, 2008 at 02:54, Tsi

Re: global name 'Image' is not defined

2008-11-08 Thread Alex Koshelev
I think you have a typo in this line, May be you write `Image.new` with lowercase "L" not uppercase "I" as first char. On Sun, Nov 9, 2008 at 02:54, Tsinga <[EMAIL PROTECTED]> wrote: > > Hi Djangonauts, > > I need your help > > I am trying to test a view using PIL(Python Imaging Library). This i

global name 'Image' is not defined

2008-11-08 Thread Tsinga
Hi Djangonauts, I need your help I am trying to test a view using PIL(Python Imaging Library). This is the code: from django.http import HttpResponse, HttpResponseRedirect from django.template import Context, RequestContext from django.template.loader import get_template from django.http import

Re: setting value of a ModelForm field through Javascript

2008-11-08 Thread Bruno Desthuilliers
limas a écrit : Limas, please answer on the group, not privately >> This is totally unrelated to Django and ModelForms. javascript runs on >> the browser, *after* the whole page containing the form has been sent >> by the server. IOW, at this stage, all you have is a plain old HTML >> form. >

Re: Submit button names are not showing up in request.POST

2008-11-08 Thread kesmit
I found the problem, but it wasn't Django related. I was using javascript to disable the submit buttons once the form was submitted. This was done to prevent multiple clicks of a submit button. Interestingly enough, making the buttons disabled also prevents them from showing up in the submitted f

django tagging + multilingual doesn't work

2008-11-08 Thread sergo
I'm writing about my problem again, to bring your attention I've made my long report short: I'm using django-tagging and django-multilingual applications in my project. Tagging worked ok until I've added multilingual application to the project, and now I don't know if problem is in tagging or in

Re: How to order a list with a self-referential foreign key? (a category list)

2008-11-08 Thread [EMAIL PROTECTED]
I've found what I was looking for, and it turns out it's not simple at all. Storing hierarchical information in a database is challenging and there are several SQL techniques that can be applied to the problem. There are a few good Django implementations out there, including django-categories, dj

Re: windows can't find django-admin.py

2008-11-08 Thread mgag
And finally to get arguments to be passed correctly, one needs to adjust the file association settings. Open MyComputer, Tools->FolderOptions, FileTypes, find "PY" in the list, select Advanced, select "open" and Edit. Change the Application Used.. to "C:\Python25\python.exe" "%1" %* Change

Re: model inheritance - getting data from child objects

2008-11-08 Thread euglena
Use ContentType. Read about it in django documentation On Nov 8, 2:03 am, Alistair Marshall <[EMAIL PROTECTED]> wrote: > On Nov 7, 4:19 pm, Gerard flanagan <[EMAIL PROTECTED]> wrote: > > > I don't know if it's clever or stupid, but this is what I have done in a > > similar situation: > > It appea

Re: problem with inlineformset_factory

2008-11-08 Thread Petry
Hi Karen! I use the version of SVN, I am currently with version 1.1 pre- alpha-9335 SVN and the error still remains! On 8 nov, 12:02, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > On Sat, Nov 8, 2008 at 8:56 AM, Petry <[EMAIL PROTECTED]> wrote: > > > somebody can help me? > > I didn't recomme

Problem saving form

2008-11-08 Thread dboddin
Hi, I'm quite new to Python and Django. I realy really need help. I have the problem to save a form , I have 2 model classes. Item and detail. The class detail has a one-to-one field to item and this field is the primary key too, i get the error message in the form, Item already exists , a

Re: problem with inlineformset_factory

2008-11-08 Thread Karen Tracey
On Sat, Nov 8, 2008 at 8:56 AM, Petry <[EMAIL PROTECTED]> wrote: > > somebody can help me? > I didn't recommend changing your code, I recommending trying with current SVN level of the 1.0.X branch or trunk, in order to ensure you have a fix that might be relevant (I still have not had time to loo

Re: select for update

2008-11-08 Thread tegbert
Thanks, I'll check it out. --Tim On Nov 7, 8:37 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > On Fri, Nov 7, 2008 at 9:45 PM, tegbert <[EMAIL PROTECTED]> wrote: > > > SELECT FOR UPDATE has been discussed in this group before, but I don't > > think it's been resolved whether it should be impleme

Re: App initialized twice? plus, debugging tips.

2008-11-08 Thread Karen Tracey
On Thu, Nov 6, 2008 at 6:43 PM, project2501 <[EMAIL PROTECTED]> wrote: > > Hi, > I'm new to django and have a couple questions. > > I have a __init__.py in my app and try to declare a simple module wide > variable. I noticed __init__.py is called twice when I run "python > manage.py runserver". I

Re: problem with inlineformset_factory

2008-11-08 Thread Petry
somebody can help me? On 7 nov, 13:24, Petry <[EMAIL PROTECTED]> wrote: > I changed my template model to use OneToOneField and remove the > Blank=True, but the same error appears... > > On 7 nov, 12:30, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > > > On Fri, Nov 7, 2008 at 9:10 AM, Daniel Roseman

Re: Apache Segmentation Fault on succesful authentication

2008-11-08 Thread Graham Dumpleton
On Nov 7, 10:29 pm, huw_at1 <[EMAIL PROTECTED]> wrote: > Graham thanks, > > First of all here is my httpd.conf file modules: > > # Example: > # LoadModule foo_module modules/mod_foo.so > # > > LoadModule python_module modules/mod_python.so > #LoadModule dav_svn_module     modules/mod_dav_svn.so

Re: Django with Apache2 on Ubuntu

2008-11-08 Thread Graham Dumpleton
On Nov 8, 5:39 am, project2501 <[EMAIL PROTECTED]> wrote: > Hi, >   I got Django to work behind Apache2 with mod_python, but had some > questions for the experts. > > 1) Is there an easy way to log stdout without re-writing all my output > statements? What about python logging? Anything sent to

Re: [Newbie] Self referencing models

2008-11-08 Thread Alex Koshelev
Did you read the documentation? http://docs.djangoproject.com/en/dev/ref/models/fields/#foreignkey On Sat, Nov 8, 2008 at 09:58, sunn <[EMAIL PROTECTED]> wrote: > > How do I make a foreign key to self? > > class Page(models.Model): >title = models.CharField(max_length=128) >display = mod

[Newbie] Self referencing models

2008-11-08 Thread sunn
How do I make a foreign key to self? class Page(models.Model): title = models.CharField(max_length=128) display = models.CharField(max_length=64) path = models.CharField(max_length=64) sortorder = models.IntegerField() parent = models.OneToOneField(Page) #Will not work neither