Re: الى من يريد مشاركتي معي في الموقع

2008-07-01 Thread Karen Tracey
On Wed, Jul 2, 2008 at 12:15 AM, Torsten Bronger <
[EMAIL PROTECTED]> wrote:

> I was moderated (because my first posting), and even worse, couldn't
> post through Gmane without being on the list, which was *very*
> awkward, and then they have spam here nevertheless?
>

If you don't want your group to be absolutely overrun with spam, you pretty
much have to restrict posting to members only.

Even that doesn't deter some spammers, particularly for a group with nearly
10,000 members and high activity.  So, django-users recently started manual
moderation of messages from new members ("new" is defined as anyone who has
joined after this switch was flipped).  Since it was turned on three weeks
ago, it has prevented an average of 4 to 5 spam posts per day from getting
through to the group.

This post was not by a new member, so it wasn't moderated.  I can't read
Arabic so while I may suspect it is spam, I can't say that for sure.  There
are a couple of things about it that argue against it being spam -- it
doesn't contain a gazillion links and it is not an identical copy of a
message the user posted to a bunch of groups.  Looking at the user's profile
doesn't show a pattern of mass posting; the account has been active for six
months without posting much of anything anywhere.  For all I know it's a
legitimate query -- we have had people post in French or Spanish or Italian
and get some help and direction to other-language Django groups.

So, yes, there are some spam-prevention measures taken in an attempt to keep
spam off this list, but they are not perfect.  The moderators are human and
it's probably just a matter of time before someone chooses "post" when they
mean "remove" and some spam will be posted.  I think the reverse has
happened at least once, which is also inconvenient.  Such is life, in the
grand scheme of things ignoring some spam or re-posting a mistakenly
discarded post is not that big a deal.

Karen

--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



MySQL-python-1.2.2 - build errors

2008-07-01 Thread [EMAIL PROTECTED]

Hello,

I've been having quite a few problems building MySQL-python-1.2.2.
Most recently I'm getting these errors when trying to build:

python setup.py build
running build
running build_py
creating build
creating build/lib.macosx-10.3-i386-2.5
copying _mysql_exceptions.py -> build/lib.macosx-10.3-i386-2.5
creating build/lib.macosx-10.3-i386-2.5/MySQLdb
copying MySQLdb/__init__.py -> build/lib.macosx-10.3-i386-2.5/MySQLdb
copying MySQLdb/converters.py -> build/lib.macosx-10.3-i386-2.5/
MySQLdb
copying MySQLdb/connections.py -> build/lib.macosx-10.3-i386-2.5/
MySQLdb
copying MySQLdb/cursors.py -> build/lib.macosx-10.3-i386-2.5/MySQLdb
copying MySQLdb/release.py -> build/lib.macosx-10.3-i386-2.5/MySQLdb
copying MySQLdb/times.py -> build/lib.macosx-10.3-i386-2.5/MySQLdb
creating build/lib.macosx-10.3-i386-2.5/MySQLdb/constants
copying MySQLdb/constants/__init__.py -> build/lib.macosx-10.3-
i386-2.5/MySQLdb/constants
copying MySQLdb/constants/CR.py -> build/lib.macosx-10.3-i386-2.5/
MySQLdb/constants
copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.macosx-10.3-
i386-2.5/MySQLdb/constants
copying MySQLdb/constants/ER.py -> build/lib.macosx-10.3-i386-2.5/
MySQLdb/constants
copying MySQLdb/constants/FLAG.py -> build/lib.macosx-10.3-i386-2.5/
MySQLdb/constants
copying MySQLdb/constants/REFRESH.py -> build/lib.macosx-10.3-i386-2.5/
MySQLdb/constants
copying MySQLdb/constants/CLIENT.py -> build/lib.macosx-10.3-i386-2.5/
MySQLdb/constants
running build_ext
building '_mysql' extension
creating build/temp.macosx-10.3-i386-2.5
/usr/bin/gcc-4.0 -fno-strict-aliasing -Wno-long-double -no-cpp-precomp
-mno-fused-madd -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -
Wstrict-prototypes -Dversion_info=(1,2,2,'final',0) -
D__version__=1.2.2 -I/usr/local/mysql/include -I/opt/local/Library/
Frameworks/Python.framework/Versions/2.5/include/python2.5 -c _mysql.c
-o build/temp.macosx-10.3-i386-2.5/_mysql.o -Os -arch i386 -fno-common
In file included from /usr/local/mysql/include/mysql.h:47,
 from _mysql.c:40:
/usr/include/sys/types.h:92: error: duplicate ‘unsigned’
/usr/include/sys/types.h:92: error: two or more data types in
declaration specifiers
error: command '/usr/bin/gcc-4.0' failed with exit status 1

Is there something I should fix in the 'types.h' file?

Thanks,

Jason

--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Client testing with custom http request referrer

2008-07-01 Thread Rob P

I am writing an application that tracks URLs and stores different
information about them (ie URL, referrer, user agent, etc...).

Currently I am writing unit tests for it and I need to be able to
spoof the referrer to test functionality (I only want to log specific
referrers).
Is there anyway I can set the referrer to lets say "google.com"?

I am using the Django test client: from django.test.client import
Client
I need to access the correct test view which is why I'm not using any
urllib libraries.

If anyone know how to do this and could impart your great knowledge it
would be much appreciated.

Thanks!
Rob P
--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: CheckboxInput unchecked at formload

2008-07-01 Thread roj

what if you make default true for that form field.

Cheers!
Django Errors, Django Tutorials, Django Blog
http://django.freelancernepal.com





On Jul 1, 5:37 pm, Brian Luft <[EMAIL PROTECTED]> wrote:
> Yes there is a way :)
>
> However, in order for us to help you, it will probably be necessary
> for you to post some snippets (on dpaste.com for example) so we can
> see how you are instantiating and rendering your Form.
>
> -Brian
>
> On Jul 1, 8:36 am, Bobby Roberts <[EMAIL PROTECTED]> wrote:
>
> > Is there a way to make a CheckboxInput unchecked at formload... I can
> > only seem to get it to load in a checked state.
--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: الى من يريد مشاركتي معي في الموقع

2008-07-01 Thread Torsten Bronger

Hallöchen!

bhunter writes:

> On Jul 1, 11:40 pm, "Juan Hernandez" <[EMAIL PROTECTED]> wrote:
>> im my lil' town this is called SPM :D
>
> That's why it's not relevant.  :)

I was moderated (because my first posting), and even worse, couldn't
post through Gmane without being on the list, which was *very*
awkward, and then they have spam here nevertheless?

Tschö,
Torsten.

-- 
Torsten Bronger, aquisgrana, europa vetus
   Jabber ID: [EMAIL PROTECTED]


--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Tag arguments rendering

2008-07-01 Thread Malcolm Tredinnick


On Tue, 2008-07-01 at 20:44 -0700, Yosifov Pavel wrote:
> I made own tags. Sometimes I want to "rendering" arguments (when
> arguments of the tag are Django-template-expressions). So, I use
> template.render() method. All is OK but it's look like this:
> 
> {% some_tag {{var}} %}

You can put whatever you want into your own custom tags, but this won't
work for normal Django tags. The {{...}} is only used to display the
contents of a variable in a template.

> but in built-in tags this is usually without {{..}}:
> {% builtin_tag var %}

This is the way variables are passed to tags.

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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Tag arguments rendering

2008-07-01 Thread Yosifov Pavel

I made own tags. Sometimes I want to "rendering" arguments (when
arguments of the tag are Django-template-expressions). So, I use
template.render() method. All is OK but it's look like this:

{% some_tag {{var}} %}

but in built-in tags this is usually without {{..}}:
{% builtin_tag var %}

What is right style? If I render arguments in another way, I thing it
will be less flexible: it will be impossible to create complex django-
template-expressions...

What is the best practice?

--
/aquagnu

--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: الى من يريد مشاركتي معي في الموقع

2008-07-01 Thread bhunter

On Jul 1, 11:40 pm, "Juan Hernandez" <[EMAIL PROTECTED]> wrote:
> im my lil' town this is called SPM :D

That's why it's not relevant.  :)

--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: الى من يريد مشاركتي معي في الموقع

2008-07-01 Thread Juan Hernandez
im my lil' town this is called SPM :D


2008/7/2 bhunter <[EMAIL PROTECTED]>:

>
>
> On Jul 1, 8:30 pm, GLOBAL705 <[EMAIL PROTECTED]> wrote:
> >   السلام عليكم
> > اما بعد اريد ان الفت انتباهكم الى انة مجموعة كلوبال705 افتتحة موقع من
> > محرك كوكل وهو موقع من تاسيس كوكل بيج فاذا ارادة احدا سواء انثى ام ذكر
> > ان ياتي معي الى الموقع وان يشاركني الموقع اهلا وسهلا  فاذا احببت ان
> > تلقي نضرة على الموقع قبل المشاركة فيمكنك ذالك عن طريق الرابط الدرج
> > ادناه  واذا اطلعت على الموقع واردة مشاركتي به فما عليك الا ان تراسلني
> > ولديك فرصة مراسلتي كل يوم من الساعة 1 ليلى الى 3 ليلى حيث سنتناقش انا
> > وانت \ انتي على كيفية مشاركتك \ مشاركتكي موقعي و العنوان هو
> > [EMAIL PROTECTED]
> >
> > اما عنوان الموقع فهوhttp://arfan1993.googlepages.com/gooogle
> >
> >  بوابة المشاركة مفتوحة في اي
> > وقت سواء في المجموعة ام في الموقع
> >
> > وشكرا للقراء
>
> Yes, my chickens can also count to 20.  But I do not see how that is
> relevant.
>
> >
>

--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: الى من يريد مشاركتي معي في الموقع

2008-07-01 Thread bhunter


On Jul 1, 8:30 pm, GLOBAL705 <[EMAIL PROTECTED]> wrote:
>                                                       السلام عليكم
> اما بعد اريد ان الفت انتباهكم الى انة مجموعة كلوبال705 افتتحة موقع من
> محرك كوكل وهو موقع من تاسيس كوكل بيج فاذا ارادة احدا سواء انثى ام ذكر
> ان ياتي معي الى الموقع وان يشاركني الموقع اهلا وسهلا  فاذا احببت ان
> تلقي نضرة على الموقع قبل المشاركة فيمكنك ذالك عن طريق الرابط الدرج
> ادناه  واذا اطلعت على الموقع واردة مشاركتي به فما عليك الا ان تراسلني
> ولديك فرصة مراسلتي كل يوم من الساعة 1 ليلى الى 3 ليلى حيث سنتناقش انا
> وانت \ انتي على كيفية مشاركتك \ مشاركتكي موقعي و العنوان هو
> [EMAIL PROTECTED]
>
> اما عنوان الموقع فهوhttp://arfan1993.googlepages.com/gooogle
>
>                                          بوابة المشاركة مفتوحة في اي
> وقت سواء في المجموعة ام في الموقع
>
> وشكرا للقراء

Yes, my chickens can also count to 20.  But I do not see how that is
relevant.

--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: unique_together and null=True fields

2008-07-01 Thread Malcolm Tredinnick


On Tue, 2008-07-01 at 23:10 -0400, Wanrong Lin wrote:
> Hi,
> 
> This topic has been discussed before here:
> http://groups.google.com/group/django-users/browse_thread/thread/fcd04f766b101a95/b65b70aa6b03729e?lnk=gst=unique_together%2C+null#
> 
> Don't you agree that two field combinations like ("A", null) and ("A", 
> null) should be considered identical and hence should be blocked from 
> being entered into the database when "unique_together" condition is 
> imposed on that field combination? Right now Django does not think so 
> and will let both of those two records get into the database, which is 
> really puzzling to me. Any rationale for such a counter-intuitive (to 
> me) behavior?

In SQL, all NULLs are unique (NULL != NULL). So this isn't
counter-intuitive at the SQL level and unique_together is enforced at
that level.

I guess the solution is not to allow NULLs in those fields if you can
avoid it, or manually add a more complex check constraint to the
database table (exact syntax and format will depend upon your database).

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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



unique_together and null=True fields

2008-07-01 Thread Wanrong Lin

Hi,

This topic has been discussed before here:
http://groups.google.com/group/django-users/browse_thread/thread/fcd04f766b101a95/b65b70aa6b03729e?lnk=gst=unique_together%2C+null#

Don't you agree that two field combinations like ("A", null) and ("A", 
null) should be considered identical and hence should be blocked from 
being entered into the database when "unique_together" condition is 
imposed on that field combination? Right now Django does not think so 
and will let both of those two records get into the database, which is 
really puzzling to me. Any rationale for such a counter-intuitive (to 
me) behavior?

Thank you for shedding your light on it.

Wanrong



--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: template via email

2008-07-01 Thread James Bennett

On Tue, Jul 1, 2008 at 8:37 PM, Malcolm Tredinnick
<[EMAIL PROTECTED]> wrote:
> Look at the render_to_string() method for converting templates to
> strings:
> http://www.djangoproject.com/documentation/templates_python/#the-render-to-string-shortcut

And if you end up using a template to generate the subject of the
email as well (not an uncommon thing), remember that you **must**
condense the subject to a single line of text.


-- 
"Bureaucrat Conrad, you are technically correct -- the best kind of correct."

--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Development File Structure

2008-07-01 Thread Kenneth Gonsalves


On 01-Jul-08, at 9:23 PM, [EMAIL PROTECTED] wrote:

> I downloaded Python 2.5.2, the most recent release of PostgreSQL, and
> Django 0.96.

with the latest python and latest postgres why are you using an  
ancient version of django? Please use the latest version from the svn  
head. Then worry about finding django - otherwise you will face a lot  
of grief upgrading your install and your code.

-- 

regards
kg
http://lawgon.livejournal.com
http://nrcfosshelpline.in/code/




--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: a thread problem or my bad codes?

2008-07-01 Thread pength

I am using transaction, but still have the problem. ;(

You are right, my problem is from "concurrent requests", which I have
searched in this group, but haven't found a very good solution...

On 7月2日, 上午1时45分, phillc <[EMAIL PROTECTED]> wrote:
> i think you need transactions?
>
> problem being that if all those processes happen at about the same
> time, they will all see enough money, then they will all process it.
>
> On Jul 1, 5:12 am, pength <[EMAIL PROTECTED]> wrote:
>
>
>
> > sorry for the bad indent of the "#models.py" part. I post it again,
> > hope this time that part will be shown OK.
>
> > #models.py
> > class Apple_For_Sale(models.Model):
> > price = models.PositiveSmallIntegerField()
> > has_been_sold = models.BooleanField(default=False)
>
> > class People(models.Model):
> > money = models.PositiveSmallIntegerField()
>
> > def buy_apple(self,apple): #apple should be an instance of
> > Apple_For_Sale
> > if self.money >= apple.price and not apple.has_been_sold:
> > self.money -= apple.price
> > self.save()
> > apple.has_been_sold = True
> > apple.save()
> > Sale_Records.objects.create(apple=apple,people=self)
>
> > class Sale_Records(models.Model): #create one record when one people
> > buy
> > apple = models.ForeignKey(Apple_For_Sale)
> > people = models.ForeignKey(People)
> > dealt_date = models.DateTimeField(auto_now_add=True)
>
> > On Jul 1, 4:53 pm, pength <[EMAIL PROTECTED]> wrote:
>
> > > I am using Django0.96/apache2/mod_python(running prefork MPM) / mysql,
> > > for my Django project, a typical Django environment, I think. And
> > > usually there're more than 10 apache2 processes running on my site, as
> > > the online users is about 100+.
>
> > > I found a problem that sometimes if one user clicks a link several
> > > times very fast (means several identical requests are sent to the
> > > server), some error will happen. Although in my codes, I am tring to
> > > prevent such thing. Let me make a simple example to illustrate my
> > > problem.
>
> > > #models.py
> > > class Apple_For_Sale(models.Model):
> > > price = models.PositiveSmallIntegerField()
> > > has_been_sold = models.BooleanField(default=False)
>
> > > class People(models.Model):
> > > money = models.PositiveSmallIntegerField()
>
> > > def buy_apple(self,apple): #apple should be an instance of
> > > Apple_For_Sale
> > > if self.money >= apple.price and not apple.has_been_sold:
> > > self.money -= apple.price
> > > self.save()
> > > apple.has_been_sold = True
> > > apple.save()
>
> > > Sale_Records.objects.create(apple=apple,people=self)
>
> > > class Sale_Records(models.Model): #create one record when one people
> > > buy
> > > apple = models.ForeignKey(Apple_For_Sale)
> > > people = models.ForeignKey(People)
> > > dealt_date = models.DateTimeField(auto_now_add=True)
>
> > > #views.py
> > > def people_buy_apple(request,aid):
> > > "aid is the id of an apple_for_sale
> > > a = get_object_or_404(Apple_For_Sale, pk=aid)
> > > p = People.object.get(xxx) #get people...omitted here
> > > p.buy_apple(a)
> > > return 
>
> > > The logic is simple. If the people has enough money and the apples
> > > have not already been sold, then the "buy apple" will be successful.
>
> > > And in my site, I think 99% of such things happened correctly. But,
> > > very rarely, when one user clicks a link of "buy apple" several times
> > > fast, there'll be more than 1 records of Sale_Records created, for
> > > same "apple" and "people", and the people's money was minused several
> > > times for one identical apple. And if the network is laggy, it seems
> > > the frequency of such error occurs becomes higher.
>
> > > For my understanding, when the several "identical requests" are sent
> > > to my server, the requests are dispatched to different apache2
> > > processes, and nearly the same time, each process "think" the "buy
> > > apple" can happen successfully. sothe error comes out.
>
> > > In my actual site,  I have added some "unqiue = True" to avoid this
> > > kind of error, in DB level. For example:
> > > class Sale_Records(models.Model):
> > > apple = models.ForeignKey(Apple_For_Sale, unique=True)
>
> > > But really I doubt this is the right way to solve my problem.
>
> > > Can anyone help? Can I avoid such error by using "mod_wsgi in daemon
> > > mode with only 1
> > > thread " (ref. to 
> > > :http://groups.google.com/group/django-users/browse_thread/thread/5bd5...)
>
> > > Thanks a lot!- 隐藏被引用文字 -
>
> - 显示引用的文字 -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" 

Re: template via email

2008-07-01 Thread Malcolm Tredinnick


On Tue, 2008-07-01 at 18:25 -0700, Bobby Roberts wrote:
> hola -
> 
> I'm just about through with my first Django project.  This has been a
> wonderful experience and I thank you for helping me learn so quickly.
> 
> the last part of my application should send and email and I'm
> wondering if it's possible to somehow use a template as the html in my
> email receipt.

Look at the render_to_string() method for converting templates to
strings:
http://www.djangoproject.com/documentation/templates_python/#the-render-to-string-shortcut

Regards,
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: template via email

2008-07-01 Thread Juanjo Conti

Of course. Create a mail template, compile it and sendmail the result.

Juanjo
-- 
mi blog: http://www.juanjoconti.com.ar

--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



template via email

2008-07-01 Thread Bobby Roberts

hola -

I'm just about through with my first Django project.  This has been a
wonderful experience and I thank you for helping me learn so quickly.

the last part of my application should send and email and I'm
wondering if it's possible to somehow use a template as the html in my
email receipt.


BR
--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Tutorial method was_published_today() - problem

2008-07-01 Thread [EMAIL PROTECTED]

Got it. I had to delete the tabs and use spaces. I guess I won't cut/
paste or use tabs.

Thanks,

Jason

On Jul 1, 5:23 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote:
> On Tue, Jul 1, 2008 at 8:06 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> > It IS indented correctly, it looks like it wasn't due to copy/paste
> > but it is in fact inline with def __str__(self): BTW running .96.1
>
> I don't know what to tell you.  Cut/pasting your models, fixing the
> indentation, and cut/paste your shell queries works properly on my machine.
> Are you sure you have not mixed tabs and spaces and so have something that
> looks in your editor like it is indented properly when in fact the
> was_published_today() definition is indented too far as far as Python is
> concerned?
>
> Karen
--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Tutorial method was_published_today() - problem

2008-07-01 Thread Karen Tracey
On Tue, Jul 1, 2008 at 8:06 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:

> It IS indented correctly, it looks like it wasn't due to copy/paste
> but it is in fact inline with def __str__(self): BTW running .96.1
>

I don't know what to tell you.  Cut/pasting your models, fixing the
indentation, and cut/paste your shell queries works properly on my machine.
Are you sure you have not mixed tabs and spaces and so have something that
looks in your editor like it is indented properly when in fact the
was_published_today() definition is indented too far as far as Python is
concerned?

Karen

--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Tutorial method was_published_today() - problem

2008-07-01 Thread [EMAIL PROTECTED]

It IS indented correctly, it looks like it wasn't due to copy/paste
but it is in fact inline with def __str__(self): BTW running .96.1

On Jul 1, 12:26 pm, Matthias Kestenholz <[EMAIL PROTECTED]> wrote:
> On Tue, 2008-07-01 at 12:18 -0700, [EMAIL PROTECTED] wrote:
> > Hello,
>
> > I'm just going through this tutorial and the custom method
> > was_published_today() is not recognized as an attribute of Poll,
> > though it's defined in the model as follows:
>
> > from django.db import models
> > import datetime
>
> > class Poll(models.Model):
> > question = models.CharField(maxlength=200)
> > pub_date = models.DateTimeField('date published')
> > def __str__(self):
> > return self.question
> >def was_published_today(self):
> >return self.pub_date.date() == datetime.date.today()
>
> Your indentation is wrong. was_published_today is an inner function of
> __str__ instead of being a class method of its own. 'def
> was_published_today' should have the same indentation as 'def __str__'
>
> Please be very careful with whitespace when writing python/django code!
>
> Btw, are you using version 0.96.x of Django or a SVN checkout? You
> should use __unicode__ instead of __str__ in code written for a current
> version of Django. This does not matter for the problem you run into,
> I'm just asking.
>
> Matthias
>
> --http://spinlock.ch/blog/
--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Custom Referrer for Unit Tests?

2008-07-01 Thread Rob P

I am writing an application that tracks URLs and stores different
information about them (ie URL, referrer, user agent, etc...).

Currently I am writing unit tests for it and I need to be able to
spoof the referrer to test functionality (I only want to log specific
referrers).
Is there anyway I can set the referrer to lets say "google.com"?

I am using the Django test client: from django.test.client import
Client
I need to access the correct test view which is why I'm not using any
urllib libraries.

If anyone know how to do this and could impart your great knowledge it
would be much appreciated.

Thanks!
Rob P

--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: memcache not used?

2008-07-01 Thread Steven Armstrong

Oscar Carlsson wrote on 07/01/08 23:32:
> ...you were very correct - I didn't have CacheMiddleware loaded, and when I
> loaded it...
> Everything worked.
> 
> Thanks for all your help! :-)
> 
> Oscar
> (I feel a bit stupid, tho)


Hacking for to long without a break, ey?
Guess we've all been there ...

:-D

--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: memcache not used?

2008-07-01 Thread Oscar Carlsson
...you were very correct - I didn't have CacheMiddleware loaded, and when I
loaded it...
Everything worked.

Thanks for all your help! :-)

Oscar
(I feel a bit stupid, tho)

On Tue, Jul 1, 2008 at 11:10 PM, Steven Armstrong <[EMAIL PROTECTED]> wrote:

>
> Oscar Carlsson wrote on 07/01/08 19:02:
> > Heh, ops!
> >
> > That was a typo, but even after fixing it, nothing changed :(
> > (still no change in memory usage, that is)
> >
>
> Looking at your dpaste entry again it seems you haven't configured the
> cache middleware.
>
> > Here is the ZeroDivisionError, btw:
> > http://dpaste.com/60185/
> >
> Installed Middleware:
> ('django.middleware.common.CommonMiddleware',
>  'django.contrib.sessions.middleware.SessionMiddleware',
>  'django.contrib.auth.middleware.AuthenticationMiddleware',
>  'django.middleware.doc.XViewMiddleware',
>  'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware')
>
>
>
> Try adding it in your settings.py, e.g:
>
> MIDDLEWARE_CLASSES = (
> 'django.middleware.cache.CacheMiddleware',
> 'django.middleware.common.CommonMiddleware',
> 'django.contrib.sessions.middleware.SessionMiddleware',
> 'django.contrib.auth.middleware.AuthenticationMiddleware',
> 'django.middleware.doc.XViewMiddleware',
> 'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware'
> )
>
> >
>

--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: memcache not used?

2008-07-01 Thread Steven Armstrong

Oscar Carlsson wrote on 07/01/08 19:02:
> Heh, ops!
> 
> That was a typo, but even after fixing it, nothing changed :(
> (still no change in memory usage, that is)
> 

Looking at your dpaste entry again it seems you haven't configured the 
cache middleware.

> Here is the ZeroDivisionError, btw:
> http://dpaste.com/60185/
> 
Installed Middleware:
('django.middleware.common.CommonMiddleware',
  'django.contrib.sessions.middleware.SessionMiddleware',
  'django.contrib.auth.middleware.AuthenticationMiddleware',
  'django.middleware.doc.XViewMiddleware',
  'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware')



Try adding it in your settings.py, e.g:

MIDDLEWARE_CLASSES = (
 'django.middleware.cache.CacheMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.middleware.doc.XViewMiddleware',
 'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware'
)

--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: CharField as text?

2008-07-01 Thread Brian Luft

What is your purpose in defining a form field if it won't be used for
user input?


On Jul 1, 12:46 pm, Stuart  Grimshaw <[EMAIL PROTECTED]>
wrote:
> Is it possible (with newforms) to either display a CharField as just
> text, or have it's value used as the label on another field? I'm
> displaying names against checkboxes and I want the names to appear as
> the checkbox labels (or at least appear like they are)
>
> Any tips anyone?
>
> -S
--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: memcache not used?

2008-07-01 Thread Oscar Carlsson
I can connect to the daemon, and it's memory usage went up a bit (from 0.2%
to 0.4%)
>>> print mc.get('foo')
bar

But after restarting apache and loading the page in a browser, memcache
doesn't get any bigger. And if I restart the memcache daemon and then
restart apache again, memcache stays on 0.2% memory usage - ie, no change :(

Oscar

On Tue, Jul 1, 2008 at 9:56 PM, Steven Armstrong <[EMAIL PROTECTED]> wrote:

>
> Oscar Carlsson wrote on 07/01/08 21:48:
> > I've checked the following logs, but nothing turned up:
> > /var/log/nginx*
> > /var/log/httpd* (apache)
> >
> > Previously, when something went wrong with the app, all error messages
> > appeared in /var/log/httpd-error.log, but this time - nothing.
> >
> > This is all the output I get when I restart apache (apachectl restart):
> >
> > [Tue Jul 01 21:46:02 2008] [notice] SIGHUP received.  Attempting to
> restart
> > [Tue Jul 01 21:46:02 2008] [warn] (22)Invalid argument: Failed to enable
> the
> > 'httpready' Accept Filter
> > [Tue Jul 01 21:46:03 2008] [notice] Apache/2.2.9 (FreeBSD) DAV/2
> > mod_wsgi/2.0 Python/2.5.2 configured -- resuming normal operations
> >
> > I also removed all *.pyc after adding 'debug=1'.
>
> I believe you wont see anything on starting apache but rather when the
> server starts serving requests.
>
> Apart from that, can you connect to the memcached daemon from the python
> prompt?
>
> e.g. does something like this work?
>
> import memcache
> mc = memcache.Client(['127.0.0.1:11211'], debug=1)
> mc.set('foo', 'bar')
> print mc.get('foo')
>
> >
>

--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: memcache not used?

2008-07-01 Thread Steven Armstrong

Oscar Carlsson wrote on 07/01/08 21:48:
> I've checked the following logs, but nothing turned up:
> /var/log/nginx*
> /var/log/httpd* (apache)
> 
> Previously, when something went wrong with the app, all error messages
> appeared in /var/log/httpd-error.log, but this time - nothing.
> 
> This is all the output I get when I restart apache (apachectl restart):
> 
> [Tue Jul 01 21:46:02 2008] [notice] SIGHUP received.  Attempting to restart
> [Tue Jul 01 21:46:02 2008] [warn] (22)Invalid argument: Failed to enable the
> 'httpready' Accept Filter
> [Tue Jul 01 21:46:03 2008] [notice] Apache/2.2.9 (FreeBSD) DAV/2
> mod_wsgi/2.0 Python/2.5.2 configured -- resuming normal operations
> 
> I also removed all *.pyc after adding 'debug=1'.

I believe you wont see anything on starting apache but rather when the 
server starts serving requests.

Apart from that, can you connect to the memcached daemon from the python 
prompt?

e.g. does something like this work?

import memcache
mc = memcache.Client(['127.0.0.1:11211'], debug=1)
mc.set('foo', 'bar')
print mc.get('foo')

--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: memcache not used?

2008-07-01 Thread Oscar Carlsson
I've checked the following logs, but nothing turned up:
/var/log/nginx*
/var/log/httpd* (apache)

Previously, when something went wrong with the app, all error messages
appeared in /var/log/httpd-error.log, but this time - nothing.

This is all the output I get when I restart apache (apachectl restart):

[Tue Jul 01 21:46:02 2008] [notice] SIGHUP received.  Attempting to restart
[Tue Jul 01 21:46:02 2008] [warn] (22)Invalid argument: Failed to enable the
'httpready' Accept Filter
[Tue Jul 01 21:46:03 2008] [notice] Apache/2.2.9 (FreeBSD) DAV/2
mod_wsgi/2.0 Python/2.5.2 configured -- resuming normal operations

I also removed all *.pyc after adding 'debug=1'.

Oscar

On Tue, Jul 1, 2008 at 7:19 PM, Steven Armstrong <[EMAIL PROTECTED]> wrote:

>
> Oscar Carlsson wrote on 07/01/08 19:02:
> > Heh, ops!
> >
> > That was a typo, but even after fixing it, nothing changed :(
> > (still no change in memory usage, that is)
> >
> > Here is the ZeroDivisionError, btw:
> > http://dpaste.com/60185/
> >
> > Oscar
> >
>
> The python-memcached client fails silently if it encounters an error,
> e.g. can't connect to the server.
>
> You could try changing how the client is created in
> django/core/cache/backends/memcached.py
>
> from:
> self._cache = memcache.Client(server.split(';'))
>
> to:
> self._cache = memcache.Client(server.split(';'), debug=1)
>
> And see if you get some error message in the server log.
>
> hth
> cheers
> Steven
>
> >
>

--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



CharField as text?

2008-07-01 Thread Stuart Grimshaw

Is it possible (with newforms) to either display a CharField as just
text, or have it's value used as the label on another field? I'm
displaying names against checkboxes and I want the names to appear as
the checkbox labels (or at least appear like they are)

Any tips anyone?

-S
--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Development File Structure

2008-07-01 Thread Brian Luft

You need to either copy the python executable to a directory on the
Windows system path (C:\windows\system32 for example), or add the path
to the Python installation (often C:\Python25 or similar) to the PATH
environment variable.



On Jul 1, 11:25 am, bruno desthuilliers
<[EMAIL PROTECTED]> wrote:
> On 1 juil, 20:12, [EMAIL PROTECTED] wrote:
>
> > brian, thnx.
>
> > i got python2.5 installed and django9.6 installed. when i run my
> > python command line and import django and test the version it works.
> > however when i run the command prompt in windows and go to the django
> > directory in python25\lib\site-packages\ and type in python django-
> > admin.py startproject mysite i get an error that 'python' is not
> > recognized as an internal or external command, operable program, or
> > batch file.
>
> > what did i do wrong?
>
> This is actually a system problem, not a Python or Django one. Either
> the path to the python executable is not in your system's PATH
> environment variable (most probably), or you don't have the right to
> execute it (but I think you'd have a different error message then). I
> haven't use any Windows version since the nt4 days so I couldn't say
> for sure how to fix this, but this should be in your system's
> documentation.
--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Tutorial method was_published_today() - problem

2008-07-01 Thread [EMAIL PROTECTED]

oops, it is, that was a result of copy/paste.

On Jul 1, 12:23 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote:
> On Tue, Jul 1, 2008 at 3:18 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> > Hello,
>
> > I'm just going through this tutorial and the custom method
> > was_published_today() is not recognized as an attribute of Poll,
> > though it's defined in the model as follows:
>
> > from django.db import models
> > import datetime
>
> > class Poll(models.Model):
> >question = models.CharField(maxlength=200)
> >pub_date = models.DateTimeField('date published')
> >def __str__(self):
> >return self.question
> >def was_published_today(self):
> >return self.pub_date.date() == datetime.date.today()
>
> Indentation is significant in Python.  You need to un-dent
> was_published_today() so that it is indented just as far as the def
> __str__(), not nested inside __str__().
>
> Karen
--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Polymorphic model: many-to-many is not properly resolved

2008-07-01 Thread Richard Dahl
Yes, of course you did, I just didn't read your post quite right, disregard.
-richard :)


On 7/1/08, Torsten Bronger <[EMAIL PROTECTED]> wrote:
>
>
> Hallöchen!
>
> Richard Dahl writes:
>
> > In your example SpecialProcess inherits from Process and Sample
> > has a M2M to Process, where should the SpecialProcess come in?
>
> I created instances of SpecialProcess and added them to a Sample.
>
> I have many child classes of Process, and in the field "processes"
> instances of all of them should reside next to each other.  Indeed I
> can add arbitrary child classes to a Sample via the admin interface,
> however, sample.processes.all() yields only instances of Process.
>
> Tschö,
> Torsten.
>
> --
> Torsten Bronger, aquisgrana, europa vetus
>   Jabber ID: [EMAIL PROTECTED]
>
>
> >
>

--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Tutorial method was_published_today() - problem

2008-07-01 Thread Matthias Kestenholz

On Tue, 2008-07-01 at 12:18 -0700, [EMAIL PROTECTED] wrote:
> Hello,
> 
> I'm just going through this tutorial and the custom method
> was_published_today() is not recognized as an attribute of Poll,
> though it's defined in the model as follows:
> 
> from django.db import models
> import datetime
> 
> class Poll(models.Model):
> question = models.CharField(maxlength=200)
> pub_date = models.DateTimeField('date published')
> def __str__(self):
> return self.question
>   def was_published_today(self):
>   return self.pub_date.date() == datetime.date.today()
> 

Your indentation is wrong. was_published_today is an inner function of
__str__ instead of being a class method of its own. 'def
was_published_today' should have the same indentation as 'def __str__'

Please be very careful with whitespace when writing python/django code!


Btw, are you using version 0.96.x of Django or a SVN checkout? You
should use __unicode__ instead of __str__ in code written for a current
version of Django. This does not matter for the problem you run into,
I'm just asking.

Matthias


-- 
http://spinlock.ch/blog/


--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Polymorphic model: many-to-many is not properly resolved

2008-07-01 Thread Torsten Bronger

Hallöchen!

Richard Dahl writes:

> In your example SpecialProcess inherits from Process and Sample
> has a M2M to Process, where should the SpecialProcess come in?

I created instances of SpecialProcess and added them to a Sample.

I have many child classes of Process, and in the field "processes"
instances of all of them should reside next to each other.  Indeed I
can add arbitrary child classes to a Sample via the admin interface,
however, sample.processes.all() yields only instances of Process.

Tschö,
Torsten.

-- 
Torsten Bronger, aquisgrana, europa vetus
   Jabber ID: [EMAIL PROTECTED]


--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Tutorial method was_published_today() - problem

2008-07-01 Thread Karen Tracey
On Tue, Jul 1, 2008 at 3:18 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:

>
> Hello,
>
> I'm just going through this tutorial and the custom method
> was_published_today() is not recognized as an attribute of Poll,
> though it's defined in the model as follows:
>
> from django.db import models
> import datetime
>
> class Poll(models.Model):
>question = models.CharField(maxlength=200)
>pub_date = models.DateTimeField('date published')
>def __str__(self):
>return self.question
>def was_published_today(self):
>return self.pub_date.date() == datetime.date.today()
>
>
Indentation is significant in Python.  You need to un-dent
was_published_today() so that it is indented just as far as the def
__str__(), not nested inside __str__().

Karen

--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Polymorphic model: many-to-many is not properly resolved

2008-07-01 Thread Matthias Kestenholz

On Tue, 2008-07-01 at 19:41 +0200, Torsten Bronger wrote:
> Hallöchen!
> 
> I use the current SVN version of Django.
> 
> Consider the following models:
> 
> class Process(models.Model):
> ...
> 
> class SpecialProcess(Process):
> ...
> 
> class Sample(models.Model):
> processes = models.ManyToManyField(Process)
> ...
> 
> Then I populate one sample with a lot of SpecialProcesses.  Now,
> when I try to walk through the processes of this sample with
> 
> for process in sample.processes.all():
> print process.__class__.__name__
> 
> I get a lot of "Process" instead of "SpecialProcess".  Apparently,
> the popymorphic many-to-many relationsship is not fully resolved.
> Am I doing something wrong or is it a limitation of Django?

Hi,

this is a limitation of relational databases. Polymorphism and
relational databases do not go well together.

You can try accessing the process.specialprocess attribute -- if this
process was indeed a SpecialProcess model, you'd get back the
SpecialProcess class, and an error in every other case.

Please note that this is documented behavior:
http://www.djangoproject.com/documentation/model-api/#multi-table-inheritance

Matthias


--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Tutorial method was_published_today() - problem

2008-07-01 Thread [EMAIL PROTECTED]

Hello,

I'm just going through this tutorial and the custom method
was_published_today() is not recognized as an attribute of Poll,
though it's defined in the model as follows:

from django.db import models
import datetime

class Poll(models.Model):
question = models.CharField(maxlength=200)
pub_date = models.DateTimeField('date published')
def __str__(self):
return self.question
def was_published_today(self):
return self.pub_date.date() == datetime.date.today()


class Choice(models.Model):
poll = models.ForeignKey(Poll)
choice = models.CharField(maxlength=200)
votes = models.IntegerField()
def __str__(self):
return self.choice

Here is the shell output:

>>> from mysite.polls.models import Poll, Choice
>>> p = Poll.objects.get(pk=1)
>>> p.was_published_today()
Traceback (most recent call last):
  File "", line 1, in 
AttributeError: 'Poll' object has no attribute 'was_published_today'
--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Polymorphic model: many-to-many is not properly resolved

2008-07-01 Thread Richard Dahl
In your example SpecialProcess inherits from Process and Sample has a M2M to
Process, where should the SpecialProcess come in?
Is this what you mean:
   class Sample(models.Model):
   processes = models.ManyToManyField(SpecialProcess)

If you do this, you should get SpecialProcess from

 print process.__class__.__name__

otherwise, I do not know how SpecialProcess is supposed to fit in to Sample
at all.
-richard



On 7/1/08, Torsten Bronger <[EMAIL PROTECTED]> wrote:
>
>
> Hallöchen!
>
> I use the current SVN version of Django.
>
> Consider the following models:
>
>class Process(models.Model):
>...
>
>class SpecialProcess(Process):
>...
>
>class Sample(models.Model):
>processes = models.ManyToManyField(Process)
>...
>
> Then I populate one sample with a lot of SpecialProcesses.  Now,
> when I try to walk through the processes of this sample with
>
>for process in sample.processes.all():
>print process.__class__.__name__
>
> I get a lot of "Process" instead of "SpecialProcess".  Apparently,
> the popymorphic many-to-many relationsship is not fully resolved.
> Am I doing something wrong or is it a limitation of Django?
>
> Tschö,
> Torsten.
>
> --
> Torsten Bronger, aquisgrana, europa vetus
>   Jabber ID: [EMAIL PROTECTED]
>
>
> >
>

--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: initializing a model with a dicitonary

2008-07-01 Thread Scott Moonen
Hi, try doing this:

c = Customer(**customerdict).save()


  -- Scott

On Tue, Jul 1, 2008 at 12:56 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]>
wrote:

>
> I have an object called customer that I trying to initialize from a
> large XML parse.  I parse the XML into a dictionary into something
> like
>
> customerdict = {'first_name' : 'mike', 'last_name' : 'c', 'etc' :
> 'etc' } and so forth
>
> then I try to do c = Customer(customerdict).save()
>
> I get a "Can't Adapt" error.
>
> However, if I manually pass in each variable like so:
>
> c = Customer(first_name = customerdict['first_name'], last_name =
> customerdict['last_name']).save()
>
> it works fine.
>
> Passing in each variable would be a huge PITA plus any changes to the
> model would require changes in multiple places while parsing and
> passing the dictionary wouldn't require any changes.  What am I doing
> wrong?
>
> >
>


-- 
http://scott.andstuff.org/ | http://truthadorned.org/

--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: initializing a model with a dicitonary

2008-07-01 Thread J Meier



On Jul 1, 10:56 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> c = Customer(first_name = customerdict['first_name'], last_name =
> customerdict['last_name']).save()

try c= Customer(**customerdict)

> What am I doing
> wrong?

Not reading your python manual :)
http://docs.python.org/ref/calls.html

--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



initializing a model with a dicitonary

2008-07-01 Thread [EMAIL PROTECTED]

I have an object called customer that I trying to initialize from a
large XML parse.  I parse the XML into a dictionary into something
like

customerdict = {'first_name' : 'mike', 'last_name' : 'c', 'etc' :
'etc' } and so forth

then I try to do c = Customer(customerdict).save()

I get a "Can't Adapt" error.

However, if I manually pass in each variable like so:

c = Customer(first_name = customerdict['first_name'], last_name =
customerdict['last_name']).save()

it works fine.

Passing in each variable would be a huge PITA plus any changes to the
model would require changes in multiple places while parsing and
passing the dictionary wouldn't require any changes.  What am I doing
wrong?

--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Polymorphic model: many-to-many is not properly resolved

2008-07-01 Thread Torsten Bronger

Hallöchen!

I use the current SVN version of Django.

Consider the following models:

class Process(models.Model):
...

class SpecialProcess(Process):
...

class Sample(models.Model):
processes = models.ManyToManyField(Process)
...

Then I populate one sample with a lot of SpecialProcesses.  Now,
when I try to walk through the processes of this sample with

for process in sample.processes.all():
print process.__class__.__name__

I get a lot of "Process" instead of "SpecialProcess".  Apparently,
the popymorphic many-to-many relationsship is not fully resolved.
Am I doing something wrong or is it a limitation of Django?

Tschö,
Torsten.

-- 
Torsten Bronger, aquisgrana, europa vetus
   Jabber ID: [EMAIL PROTECTED]


--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Development File Structure

2008-07-01 Thread bruno desthuilliers



On 1 juil, 20:12, [EMAIL PROTECTED] wrote:
> brian, thnx.
>
> i got python2.5 installed and django9.6 installed. when i run my
> python command line and import django and test the version it works.
> however when i run the command prompt in windows and go to the django
> directory in python25\lib\site-packages\ and type in python django-
> admin.py startproject mysite i get an error that 'python' is not
> recognized as an internal or external command, operable program, or
> batch file.
>
> what did i do wrong?

This is actually a system problem, not a Python or Django one. Either
the path to the python executable is not in your system's PATH
environment variable (most probably), or you don't have the right to
execute it (but I think you'd have a different error message then). I
haven't use any Windows version since the nt4 days so I couldn't say
for sure how to fix this, but this should be in your system's
documentation.


--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Development File Structure

2008-07-01 Thread mccomas . chris

brian, thnx.

i got python2.5 installed and django9.6 installed. when i run my
python command line and import django and test the version it works.
however when i run the command prompt in windows and go to the django
directory in python25\lib\site-packages\ and type in python django-
admin.py startproject mysite i get an error that 'python' is not
recognized as an internal or external command, operable program, or
batch file.

what did i do wrong?

On Jul 1, 12:42 pm, Brian Luft <[EMAIL PROTECTED]> wrote:
> Any 3rd-party Python package or module that you intend to use needs to
> be on the Python path.
>
> The Django documentation actually provides some instructions on how to
> accomplish 
> this:http://www.djangoproject.com/documentation/install/#install-the-djang...
>
> -Brian
>
> On Jul 1, 8:53 am, [EMAIL PROTECTED] wrote:
>
> > Hey,
>
> > I downloaded Python 2.5.2, the most recent release of PostgreSQL, and
> > Django 0.96. I've installed PostgreSQL and Python, as well as psycopg
> > for PostgreSQL. I ran my Python command line and it can't find Django.
> > Where do I need to put Django so that the Python can find it?
--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Need help filtering a queryset

2008-07-01 Thread Brandon Taylor

Thanks very much for the advice Brian. I'll definitely switch that up
and try both approaches. I hadn't seen another way to get at a subset
of objects other than:

model_set.all

but now I do, thanks to your example.

Kind regards,
Brandon

On Jul 1, 12:28 pm, Brian Luft <[EMAIL PROTECTED]> wrote:
> Another approach would be to add a method to your events model. Name
> it something like "current_occurrences" and have it return the
> filtered occurrences. Ex:
>
> class event( models.Model ):
>    ...
>    def current_occurrences( self ):
>        return
> self.occurrence_set.filter( date__gte=datetime.datetime.today() )
>
> Then you would change your template to
>
> {% for occurrence in event.current_occurences %}
>
> That should offer a little better performance since you wouldn't be
> pulling the entire occurrence set for each event.
>
> If performance is a major factor, investigate writing a custom model
> manager for your events model.  That might be the best option for
> retrieving the joined set of events with current occurrences in one
> fell swoop in a nice abstracted manner.
>
> -Brian
>
> On Jul 1, 10:12 am, Brian Luft <[EMAIL PROTECTED]> wrote:
>
> > Ok, you are asking for a list of events that have occurences on or
> > after today's date.  Then with each event instance you are asking for
> > ALL occurence instances (event.occurrence_set.all). ALL means EVERY
> > occurence associated with that event object.  You haven't done
> > anything to filter out occurrences based on date in that step.
>
> > -Brian
>
> > On Jul 1, 9:51 am, Brandon Taylor <[EMAIL PROTECTED]> wrote:
>
> > > Hi everyone,
>
> > > I have Events and Occurrences of an Event. Occurrence contains a
> > > foreign_key for the Event.
> > > In my template, I need to display the Event and Occurrences as such:
>
> > > Event Title One
> > >     June 1, 2008 [times]
> > >     July 23, 2008 [times]
>
> > > Event Title Two
> > >     August 25, 2008 [times]
> > >     September 1, 2008 [times]
>
> > > But, I only want to display dates that are greater than, or equal to
> > > today. In my view, I am selecting Events as such:
>
> > > events_list =
> > > events.filter(occurrence__date__gte=datetime.datetime.today())
>
> > > Here's my template code:
> > > 
> > >     {% for event in events_list %}
> > >         {{ event.title }}
> > >               {% for occurrence in event.occurrence_set.all %}
> > >                   
> > >                       
> > >                           {{ occurrence.date }}
> > >                       
> > >                   
> > >               {% endfor %}
> > >         
> > >     {% endfor %}
> > > 
>
> > > Which is showing ALL of the occurrences, not just the ones with a date
> > > greater than today. Given the sample data set above, it shouldn't
> > > display the event for June. Can someone please help me out with this?
> > > I'd really appreciate some advice.
>
> > > TIA,
> > > Brandon
--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Strange display of date

2008-07-01 Thread phillc

having trouble understand what you mean

On Jul 1, 2:09 am, gumbah <[EMAIL PROTECTED]> wrote:
> Anyone?
>
> On Jun 27, 9:38 am, gumbah <[EMAIL PROTECTED]> wrote:
>
> > Hi all,
>
> > does anyone know what i am doing wrong when i see adatelooking like
> > this in the "change history" part of the admin app:
>
> > FriAMCDTE_261CDT02_CDT1JunE_June1218655750TrueTrue
>
> > I see this throughout the admin app (change history of users, of
> > groups etc.)
>
> > BTW: Just getting into Django and loving it!!
>
> > Kind regards,
> > J
--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: a thread problem or my bad codes?

2008-07-01 Thread phillc

i think you need transactions?

problem being that if all those processes happen at about the same
time, they will all see enough money, then they will all process it.

On Jul 1, 5:12 am, pength <[EMAIL PROTECTED]> wrote:
> sorry for the bad indent of the "#models.py" part. I post it again,
> hope this time that part will be shown OK.
>
> #models.py
> class Apple_For_Sale(models.Model):
>         price = models.PositiveSmallIntegerField()
>         has_been_sold = models.BooleanField(default=False)
>
> class People(models.Model):
>         money = models.PositiveSmallIntegerField()
>
>         def buy_apple(self,apple): #apple should be an instance of
> Apple_For_Sale
>                 if self.money >= apple.price and not apple.has_been_sold:
>                         self.money -= apple.price
>                         self.save()
>                         apple.has_been_sold = True
>                         apple.save()
>                         Sale_Records.objects.create(apple=apple,people=self)
>
> class Sale_Records(models.Model): #create one record when one people
> buy
>     apple = models.ForeignKey(Apple_For_Sale)
>     people = models.ForeignKey(People)
>     dealt_date = models.DateTimeField(auto_now_add=True)
>
> On Jul 1, 4:53 pm, pength <[EMAIL PROTECTED]> wrote:
>
> > I am using Django0.96/apache2/mod_python(running prefork MPM) / mysql,
> > for my Django project, a typical Django environment, I think. And
> > usually there're more than 10 apache2 processes running on my site, as
> > the online users is about 100+.
>
> > I found a problem that sometimes if one user clicks a link several
> > times very fast (means several identical requests are sent to the
> > server), some error will happen. Although in my codes, I am tring to
> > prevent such thing. Let me make a simple example to illustrate my
> > problem.
>
> > #models.py
> > class Apple_For_Sale(models.Model):
> >         price = models.PositiveSmallIntegerField()
> >         has_been_sold = models.BooleanField(default=False)
>
> > class People(models.Model):
> >         money = models.PositiveSmallIntegerField()
>
> >         def buy_apple(self,apple): #apple should be an instance of
> > Apple_For_Sale
> >                 if self.money >= apple.price and not apple.has_been_sold:
> >                         self.money -= apple.price
> >                         self.save()
> >                         apple.has_been_sold = True
> >                         apple.save()
>
> > Sale_Records.objects.create(apple=apple,people=self)
>
> > class Sale_Records(models.Model): #create one record when one people
> > buy
> >     apple = models.ForeignKey(Apple_For_Sale)
> >     people = models.ForeignKey(People)
> >     dealt_date = models.DateTimeField(auto_now_add=True)
>
> > #views.py
> > def people_buy_apple(request,aid):
> >         "aid is the id of an apple_for_sale
> >         a = get_object_or_404(Apple_For_Sale, pk=aid)
> >         p = People.object.get(xxx) #get people...omitted here
> >         p.buy_apple(a)
> >         return 
>
> > The logic is simple. If the people has enough money and the apples
> > have not already been sold, then the "buy apple" will be successful.
>
> > And in my site, I think 99% of such things happened correctly. But,
> > very rarely, when one user clicks a link of "buy apple" several times
> > fast, there'll be more than 1 records of Sale_Records created, for
> > same "apple" and "people", and the people's money was minused several
> > times for one identical apple. And if the network is laggy, it seems
> > the frequency of such error occurs becomes higher.
>
> > For my understanding, when the several "identical requests" are sent
> > to my server, the requests are dispatched to different apache2
> > processes, and nearly the same time, each process "think" the "buy
> > apple" can happen successfully. sothe error comes out.
>
> > In my actual site,  I have added some "unqiue = True" to avoid this
> > kind of error, in DB level. For example:
> > class Sale_Records(models.Model):
> >     apple = models.ForeignKey(Apple_For_Sale, unique=True)
>
> > But really I doubt this is the right way to solve my problem.
>
> > Can anyone help? Can I avoid such error by using "mod_wsgi in daemon
> > mode with only 1
> > thread " (ref. to 
> > :http://groups.google.com/group/django-users/browse_thread/thread/5bd5...)
>
> > Thanks a lot!
--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Need help filtering a queryset

2008-07-01 Thread Brian Luft

Another approach would be to add a method to your events model. Name
it something like "current_occurrences" and have it return the
filtered occurrences. Ex:

class event( models.Model ):
   ...
   def current_occurrences( self ):
   return
self.occurrence_set.filter( date__gte=datetime.datetime.today() )

Then you would change your template to

{% for occurrence in event.current_occurences %}

That should offer a little better performance since you wouldn't be
pulling the entire occurrence set for each event.

If performance is a major factor, investigate writing a custom model
manager for your events model.  That might be the best option for
retrieving the joined set of events with current occurrences in one
fell swoop in a nice abstracted manner.

-Brian

On Jul 1, 10:12 am, Brian Luft <[EMAIL PROTECTED]> wrote:
> Ok, you are asking for a list of events that have occurences on or
> after today's date.  Then with each event instance you are asking for
> ALL occurence instances (event.occurrence_set.all). ALL means EVERY
> occurence associated with that event object.  You haven't done
> anything to filter out occurrences based on date in that step.
>
> -Brian
>
> On Jul 1, 9:51 am, Brandon Taylor <[EMAIL PROTECTED]> wrote:
>
> > Hi everyone,
>
> > I have Events and Occurrences of an Event. Occurrence contains a
> > foreign_key for the Event.
> > In my template, I need to display the Event and Occurrences as such:
>
> > Event Title One
> >     June 1, 2008 [times]
> >     July 23, 2008 [times]
>
> > Event Title Two
> >     August 25, 2008 [times]
> >     September 1, 2008 [times]
>
> > But, I only want to display dates that are greater than, or equal to
> > today. In my view, I am selecting Events as such:
>
> > events_list =
> > events.filter(occurrence__date__gte=datetime.datetime.today())
>
> > Here's my template code:
> > 
> >     {% for event in events_list %}
> >         {{ event.title }}
> >               {% for occurrence in event.occurrence_set.all %}
> >                   
> >                       
> >                           {{ occurrence.date }}
> >                       
> >                   
> >               {% endfor %}
> >         
> >     {% endfor %}
> > 
>
> > Which is showing ALL of the occurrences, not just the ones with a date
> > greater than today. Given the sample data set above, it shouldn't
> > display the event for June. Can someone please help me out with this?
> > I'd really appreciate some advice.
>
> > TIA,
> > Brandon
--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: memcache not used?

2008-07-01 Thread Steven Armstrong

Oscar Carlsson wrote on 07/01/08 19:02:
> Heh, ops!
> 
> That was a typo, but even after fixing it, nothing changed :(
> (still no change in memory usage, that is)
> 
> Here is the ZeroDivisionError, btw:
> http://dpaste.com/60185/
> 
> Oscar
> 

The python-memcached client fails silently if it encounters an error, 
e.g. can't connect to the server.

You could try changing how the client is created in
django/core/cache/backends/memcached.py

from:
self._cache = memcache.Client(server.split(';'))

to:
self._cache = memcache.Client(server.split(';'), debug=1)

And see if you get some error message in the server log.

hth
cheers
Steven

--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Need help filtering a queryset

2008-07-01 Thread Brian Luft

Ok, you are asking for a list of events that have occurences on or
after today's date.  Then with each event instance you are asking for
ALL occurence instances (event.occurrence_set.all). ALL means EVERY
occurence associated with that event object.  You haven't done
anything to filter out occurrences based on date in that step.

-Brian

On Jul 1, 9:51 am, Brandon Taylor <[EMAIL PROTECTED]> wrote:
> Hi everyone,
>
> I have Events and Occurrences of an Event. Occurrence contains a
> foreign_key for the Event.
> In my template, I need to display the Event and Occurrences as such:
>
> Event Title One
>     June 1, 2008 [times]
>     July 23, 2008 [times]
>
> Event Title Two
>     August 25, 2008 [times]
>     September 1, 2008 [times]
>
> But, I only want to display dates that are greater than, or equal to
> today. In my view, I am selecting Events as such:
>
> events_list =
> events.filter(occurrence__date__gte=datetime.datetime.today())
>
> Here's my template code:
> 
>     {% for event in events_list %}
>         {{ event.title }}
>               {% for occurrence in event.occurrence_set.all %}
>                   
>                       
>                           {{ occurrence.date }}
>                       
>                   
>               {% endfor %}
>         
>     {% endfor %}
> 
>
> Which is showing ALL of the occurrences, not just the ones with a date
> greater than today. Given the sample data set above, it shouldn't
> display the event for June. Can someone please help me out with this?
> I'd really appreciate some advice.
>
> TIA,
> Brandon
--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Need help filtering a queryset

2008-07-01 Thread Brandon Taylor

I made a custom filter that tests for the date:

import datetime

from django import template
register = template.Library()

@register.filter('is_current')
def isPast(occurrence):
if occurrence.date >= datetime.datetime.today().date():
return True
return False


which works, but is this the best way this can be handled? I'm still
relatively new to Django, and I can't help but think this can be
handled at the Database API level in some way that I'm overlooking.

Thoughts? Advice greatly appreciated.

On Jul 1, 11:51 am, Brandon Taylor <[EMAIL PROTECTED]> wrote:
> Hi everyone,
>
> I have Events and Occurrences of an Event. Occurrence contains a
> foreign_key for the Event.
> In my template, I need to display the Event and Occurrences as such:
>
> Event Title One
>     June 1, 2008 [times]
>     July 23, 2008 [times]
>
> Event Title Two
>     August 25, 2008 [times]
>     September 1, 2008 [times]
>
> But, I only want to display dates that are greater than, or equal to
> today. In my view, I am selecting Events as such:
>
> events_list =
> events.filter(occurrence__date__gte=datetime.datetime.today())
>
> Here's my template code:
> 
>     {% for event in events_list %}
>         {{ event.title }}
>               {% for occurrence in event.occurrence_set.all %}
>                   
>                       
>                           {{ occurrence.date }}
>                       
>                   
>               {% endfor %}
>         
>     {% endfor %}
> 
>
> Which is showing ALL of the occurrences, not just the ones with a date
> greater than today. Given the sample data set above, it shouldn't
> display the event for June. Can someone please help me out with this?
> I'd really appreciate some advice.
>
> TIA,
> Brandon
--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: memcache not used?

2008-07-01 Thread Oscar Carlsson
Heh, ops!

That was a typo, but even after fixing it, nothing changed :(
(still no change in memory usage, that is)

Here is the ZeroDivisionError, btw:
http://dpaste.com/60185/

Oscar

On Tue, Jul 1, 2008 at 6:47 PM, Brian Luft <[EMAIL PROTECTED]> wrote:

>
> In your settings file you have indicated that memcached is running on
> port 112211 but your process listing shows it running on 11211.
>
> -Brian
>
> On Jul 1, 9:34 am, "Oscar Carlsson" <[EMAIL PROTECTED]> wrote:
> > Hi!
> >
> > For some reason, django doesn't seem to add anything to my memcache - the
> > process is using 0.2% RAM (seems to be the absolute minimum on my system,
> > FreeBSD 7 with 512 MByte RAM) and never starts using more memory.
> >
> > Why is this? I have no idea where to begin debug this, nothing ever shows
> up
> > in any logs :/
> >
> > This is how I've configured my django app (in settings.py):
> >
> > CACHE_BACKEND = 'memcached://127.0.0.1:112211/'
> > CACHE_MIDDLEWARE_SECONDS = 60 * 60
> > CACHE_MIDDLEWARE_KEY_PREFIX = ''
> > CACHE_MIDDLEWARE_ANONYMOUS_ONLY = True
> >
> > From ps -aux:
> > nobody 54585  0.0  0.2  3204  1240  ??  Ss6:22PM   0:00.01
> > /usr/local/bin/memcached -p 11211 -m 32 -l 127.0.0.1 -d -u nobody
> >
> > I'm using nginx as a frontend for a Apache 2.2 (with event-worker, not
> > prefork etc) using mod_wsgi and a few virtual hosts (although it
> shouldn't
> > matter?).
> >
> > I tried to use this:http://effbot.org/zone/django-memcached-view.htm,
> but
> > I end up with a division by zero exception when the view tries to
> calculate
> > the memory usage, which seems to be because memcache isn't caching
> anything.
> >
> > Anyone experienced this before, or know where to start debug?
> >
> > Oscar
> >
>

--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Need help filtering a queryset

2008-07-01 Thread Brandon Taylor

Hi everyone,

I have Events and Occurrences of an Event. Occurrence contains a
foreign_key for the Event.
In my template, I need to display the Event and Occurrences as such:

Event Title One
June 1, 2008 [times]
July 23, 2008 [times]

Event Title Two
August 25, 2008 [times]
September 1, 2008 [times]


But, I only want to display dates that are greater than, or equal to
today. In my view, I am selecting Events as such:

events_list =
events.filter(occurrence__date__gte=datetime.datetime.today())


Here's my template code:

{% for event in events_list %}
{{ event.title }}
  {% for occurrence in event.occurrence_set.all %}
  
  
  {{ occurrence.date }}
  
  
  {% endfor %}

{% endfor %}


Which is showing ALL of the occurrences, not just the ones with a date
greater than today. Given the sample data set above, it shouldn't
display the event for June. Can someone please help me out with this?
I'd really appreciate some advice.

TIA,
Brandon
--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Writing tests for views that use built-in decorators

2008-07-01 Thread Manoj Govindan

I routinely write views which use two built-in decorators, viz.,
login_required and transaction.commit_on_success. I am able to easily
write test cases for the former. A typical test case looks like this:

self.client.logout()

response = self.client.get(reverse('my_view'))
redirect_url = 

self.assertRedirects(response, redirect_url, status_code=302,
target_status_code=200)

Similarly is there is any way to write test cases for views that use
commit_on_success? I know that the decorator works as intended :) but
I would still like to write test cases if possible.

Regards,
Manoj
--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: memcache not used?

2008-07-01 Thread Brian Luft

In your settings file you have indicated that memcached is running on
port 112211 but your process listing shows it running on 11211.

-Brian

On Jul 1, 9:34 am, "Oscar Carlsson" <[EMAIL PROTECTED]> wrote:
> Hi!
>
> For some reason, django doesn't seem to add anything to my memcache - the
> process is using 0.2% RAM (seems to be the absolute minimum on my system,
> FreeBSD 7 with 512 MByte RAM) and never starts using more memory.
>
> Why is this? I have no idea where to begin debug this, nothing ever shows up
> in any logs :/
>
> This is how I've configured my django app (in settings.py):
>
> CACHE_BACKEND = 'memcached://127.0.0.1:112211/'
> CACHE_MIDDLEWARE_SECONDS = 60 * 60
> CACHE_MIDDLEWARE_KEY_PREFIX = ''
> CACHE_MIDDLEWARE_ANONYMOUS_ONLY = True
>
> From ps -aux:
> nobody     54585  0.0  0.2  3204  1240  ??  Ss    6:22PM   0:00.01
> /usr/local/bin/memcached -p 11211 -m 32 -l 127.0.0.1 -d -u nobody
>
> I'm using nginx as a frontend for a Apache 2.2 (with event-worker, not
> prefork etc) using mod_wsgi and a few virtual hosts (although it shouldn't
> matter?).
>
> I tried to use this:http://effbot.org/zone/django-memcached-view.htm, but
> I end up with a division by zero exception when the view tries to calculate
> the memory usage, which seems to be because memcache isn't caching anything.
>
> Anyone experienced this before, or know where to start debug?
>
> Oscar
--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: memcache not used?

2008-07-01 Thread Paolo Ambrosio

Hi,

just a quick note... the port (112211) wrong only on your email, or in
the settings file too?

> CACHE_BACKEND = 'memcached://127.0.0.1:112211/'

Paolo

--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Development File Structure

2008-07-01 Thread Brian Luft

Any 3rd-party Python package or module that you intend to use needs to
be on the Python path.

The Django documentation actually provides some instructions on how to
accomplish this:
http://www.djangoproject.com/documentation/install/#install-the-django-code

-Brian

On Jul 1, 8:53 am, [EMAIL PROTECTED] wrote:
> Hey,
>
> I downloaded Python 2.5.2, the most recent release of PostgreSQL, and
> Django 0.96. I've installed PostgreSQL and Python, as well as psycopg
> for PostgreSQL. I ran my Python command line and it can't find Django.
> Where do I need to put Django so that the Python can find it?
--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



memcache not used?

2008-07-01 Thread Oscar Carlsson
Hi!

For some reason, django doesn't seem to add anything to my memcache - the
process is using 0.2% RAM (seems to be the absolute minimum on my system,
FreeBSD 7 with 512 MByte RAM) and never starts using more memory.

Why is this? I have no idea where to begin debug this, nothing ever shows up
in any logs :/

This is how I've configured my django app (in settings.py):

CACHE_BACKEND = 'memcached://127.0.0.1:112211/'
CACHE_MIDDLEWARE_SECONDS = 60 * 60
CACHE_MIDDLEWARE_KEY_PREFIX = ''
CACHE_MIDDLEWARE_ANONYMOUS_ONLY = True

>From ps -aux:
nobody 54585  0.0  0.2  3204  1240  ??  Ss6:22PM   0:00.01
/usr/local/bin/memcached -p 11211 -m 32 -l 127.0.0.1 -d -u nobody

I'm using nginx as a frontend for a Apache 2.2 (with event-worker, not
prefork etc) using mod_wsgi and a few virtual hosts (although it shouldn't
matter?).

I tried to use this: http://effbot.org/zone/django-memcached-view.htm , but
I end up with a division by zero exception when the view tries to calculate
the memory usage, which seems to be because memcache isn't caching anything.

Anyone experienced this before, or know where to start debug?

Oscar

--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: dreaded FieldError (used to be KeyError) can only replicate on production, ugh!

2008-07-01 Thread Milan Andric



On Jul 1, 5:03 am, "Scott Moonen" <[EMAIL PROTECTED]> wrote:
> Milan, I took another look at the error and your template.  Judging from the
> error (it seems to be complaining about some access to the member object,
> rather than the project list), I think the reference to line 9 is a red
> herring.  In other words, the outermost tag that Django is rendering at the
> time is your outer for loop, but the real problem is occurring in the
> rendering of an inner loop.
>
> So I'd ignore the reference to line 9 and look further at the inner contents
> of that for loop.  I don't think the entire for loop is included in the
> dpaste traceback snippet, as I don't see its endfor.
>

The problem is with the {% for m in p.members.all %} line, where the
manytomanyfield members gets resolved.  When I comment out that for
loop things are fine.  I have no problem doing this in the django
shell:

>>> for p in Project.objects.all():
>>>   p.members.all()

But it causes a FieldError in the template only on production (apache/
mod_python) which is running MySQL4 while my dev has MySQL5.  I will
try a recent copy of the db to see if it's something in the db.  Also,
I made a UserProfile model change since I upgraded to queryset-
refactor/trunk which consisted of doing OneToOneField(User,
primary_key=True) ...

--
Milan


--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Inheriting from auth.models.User

2008-07-01 Thread Rob Hudson

On Jun 30, 9:43 pm, Michael Richardson
<[EMAIL PROTECTED]> wrote:
>
> There's a patch for this -http://code.djangoproject.com/ticket/3011

Dangit!  Michael beat me to it!  :)
--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: MySQL-python-1.2.2 install problems

2008-07-01 Thread [EMAIL PROTECTED]

This worked after running:

sudo port clean --work py25-hashlib
sudo port install py25-hashlib

Thanks,

Jason

On Jul 1, 7:50 am, "Adi J. Sieker" <[EMAIL PROTECTED]> wrote:
> On Tue, 01 Jul 2008 06:56:08 +0200, Malcolm Tredinnick
>
> <[EMAIL PROTECTED]> wrote:
> > On Mon, 2008-06-30 at 20:13 -0700, [EMAIL PROTECTED] wrote:
> >> Hello,
>
> >> I'm having problems installing MySQL-python-1.2.2. I've installed this
> >> on my iMac with no problems but can't figure out how to resolve this: no
>
> > Every now and again people report this. It means your Python
> > installation is somehow broken. The real test here is that "import
> > hashlib" probably won't work at the interactive Python prompt.
>
> > I don't know if this is a standard problem with the macports install or
> > just one particular version or what, but the problem is with your Python
> > installation and you should fix it before going any further.
>
> The MacPorts version of python doesn't install hashlib in the default
> install.
> You need to specifically install py25-hashlib.
> Seehttp://trac.macports.org/ticket/11931
>
> Regards,
> adi
--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Development File Structure

2008-07-01 Thread mccomas . chris

Hey,

I downloaded Python 2.5.2, the most recent release of PostgreSQL, and
Django 0.96. I've installed PostgreSQL and Python, as well as psycopg
for PostgreSQL. I ran my Python command line and it can't find Django.
Where do I need to put Django so that the Python can find it?


--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



CheckboxInput unchecked at formload

2008-07-01 Thread Bobby Roberts

Is there a way to make a CheckboxInput unchecked at formload... I can
only seem to get it to load in a checked state.
--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Regex assistance

2008-07-01 Thread mike171562

Gul,

   That was it, thx a bunch..

On Jul 1, 10:27 am, "Marty Alchin" <[EMAIL PROTECTED]> wrote:
> On Tue, Jul 1, 2008 at 11:15 AM, John Lenton <[EMAIL PROTECTED]> wrote:
> >> local numbers start with 281, 832, 713 , or 1281, 1832, or 1713, my
> >> regex which isnt working looks like this
>
> > in other words, local numbers match the regex
>
> >  r'^(?:281|832|713|1281|1832|1713)'
>
> Or, to simplify it even further, and make it easier to add new area
> codes later on, if any crop up:
>
> r'^1?(281|832|713)'
>
> -Gul
--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Regex assistance

2008-07-01 Thread Marty Alchin

On Tue, Jul 1, 2008 at 11:15 AM, John Lenton <[EMAIL PROTECTED]> wrote:
>> local numbers start with 281, 832, 713 , or 1281, 1832, or 1713, my
>> regex which isnt working looks like this
>
> in other words, local numbers match the regex
>
>  r'^(?:281|832|713|1281|1832|1713)'

Or, to simplify it even further, and make it easier to add new area
codes later on, if any crop up:

r'^1?(281|832|713)'

-Gul

--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Restriction of Model Inheritance - mixing multi table and abstract

2008-07-01 Thread zobbo

On Jul 1, 12:58 pm, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:

> I don't have time to look at this at the moment (I'm up to my armpits in
> somebody else's problem), but this looks like a bug. Would you mind to
> open a ticket and include your example so it doesn't get lost? You can
> probably leave out EditableItem, since an example that's as small as
> possible if preferable.

Many thanks for the quick reply. Have done - 
http://code.djangoproject.com/ticket/7588

Cheers

Ian
--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Missing traceback for 500 errors

2008-07-01 Thread ekellner
Thanks, indeed that is all I was missing.  I somehow managed to miss the
setting documentation and instead found some information on the 500 view.

On Tue, Jul 1, 2008 at 3:11 PM, Karen Tracey <[EMAIL PROTECTED]> wrote:

> On Tue, Jul 1, 2008 at 8:15 AM, Elizabeth Kellner <[EMAIL PROTECTED]>
> wrote:
>
>>
>> The full python traceback is missing from my apache logs.  In fact,
>> I've just seen that the only notification of a 500 error is in
>> access_log and the browser.  Can anyone suggest any place to look to
>> see why this is the case?
>>
>> Here is the python view that I am using to test...
>> def view500(request):
>>"Throws a server 500 error for testing"
>>
>>msg = "Test 500 error.  This is not a real malfunction"
>>logging.error(msg)
>>raise MyRequestException(msg)
>>
>> My apache error_log says...
>> [Tue Jul 01 14:01:33 2008] [notice] Apache/2.2.8 (Unix) mod_ssl/2.2.8
>> OpenSSL/0.9.7l mod_python/3.3.1 Python/2.5.1 configured -- resuming
>> normal operations
>> licenseserver: [2008-07-01 07:01:35,084 10.10.20.38 iAt9asypuEk root
>> ERROR] Test 500 error.  This is not a real malfunction
>>
>> I receive my rendered 500.html template in the browser.
>>
>> (One potentially funky thing I must mention is that I am using the
>> drlog middleware (http://www.fairviewcomputing.com/blog/2008/03/05/
>> django-request-logging/),
>> but I tried commenting it out from my
>> MIDDLEWARE_CLASSES, and the problem persists.  The log message changes
>> format, but still no traceback.  I doubt this is the cause.)
>>
>> I'm running Django trunk, revision 7629, on Mac OS X Leopard.
>
>
> I think this is normal.  The only time I recall seeing tracebacks in the
> Apache logs is for errors that Django didn't successfully "handle", that is
> things like a missing 500.html template -- stuff that causes an exception to
> get thrown out to mod_python/Apache and causes its error handling to get
> involved.  Django's method for 'recording' the traceback is to send it in an
> email to the IDs listed in ADMINS in settings.py,.
>
> Karen
>
>
> >
>

--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Regex assistance

2008-07-01 Thread John Lenton

On Tue, Jul 1, 2008 at 12:12, mike171562 <[EMAIL PROTECTED]> wrote:
>
> Hello,
>   I am trying to build a regex for a query that excludes local phone
> numbers from a list of calls thus leaving only long distance.  I dont
> have alot of experience with the "re" module
>
> local numbers start with 281, 832, 713 , or 1281, 1832, or 1713, my
> regex which isnt working looks like this

in other words, local numbers match the regex

  r'^(?:281|832|713|1281|1832|1713)'


-- 
John Lenton ([EMAIL PROTECTED]) -- Random fortune:
The trouble with a lot of self-made men is that they worship their creator.

--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Regex assistance

2008-07-01 Thread mike171562

Hello,
   I am trying to build a regex for a query that excludes local phone
numbers from a list of calls thus leaving only long distance.  I dont
have alot of experience with the "re" module

local numbers start with 281, 832, 713 , or 1281, 1832, or 1713, my
regex which isnt working looks like this


Calls.objects.exclude(dest_number__iregex=r'^1?(?=281)|^1?(?=713)|^1?(?
=832)')
--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: MySQL-python-1.2.2 install problems

2008-07-01 Thread Adi J. Sieker

On Tue, 01 Jul 2008 06:56:08 +0200, Malcolm Tredinnick  
<[EMAIL PROTECTED]> wrote:

> On Mon, 2008-06-30 at 20:13 -0700, [EMAIL PROTECTED] wrote:
>> Hello,
>>
>> I'm having problems installing MySQL-python-1.2.2. I've installed this
>> on my iMac with no problems but can't figure out how to resolve this: no
>
> Every now and again people report this. It means your Python
> installation is somehow broken. The real test here is that "import
> hashlib" probably won't work at the interactive Python prompt.
>
> I don't know if this is a standard problem with the macports install or
> just one particular version or what, but the problem is with your Python
> installation and you should fix it before going any further.
>

The MacPorts version of python doesn't install hashlib in the default  
install.
You need to specifically install py25-hashlib.
See http://trac.macports.org/ticket/11931


Regards,
adi

--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: combining unrelated tables

2008-07-01 Thread Shane McNamee
when i try doing that i get a really weird error, but i was doing it like
"render_to_response('Template.html', {'first_qs': Model1.objects.all()},
{'second_qs':Model2.objects.all()})", with the {} around each one, so
hopefully i just had wrong syntax. ill try it like u said. thanks for the
help

-Shane

On Tue, Jul 1, 2008 at 10:21 AM, Richard Dahl <[EMAIL PROTECTED]> wrote:

> Not sure exactly where you are going, but what do you mean by ' Inside
> views.py it only lets me send 1 queryset to the template'  why can't you do
> something like:
>
> render_to_response('Template.html', {'first_qs': Model1.objects.all(),
> 'second_qs':Model2.objects.all()})
>
> -richard
>
>
>
> On 7/1/08, Shane_McNamee <[EMAIL PROTECTED]> wrote:
>
>>
>> hey, i searched around this forum and found a lot of questions similar
>> to this, but i couldnt find an answer to my question.
>>
>> I need to send data to my templates that comes from multiple tables in
>> my database. Inside views.py it only lets me send 1 queryset to the
>> template, so i figured the only way to send data from more than 1
>> table was to join everything i needed into a single queryset. however
>> i cant figure out how to join tables within django. is there a way to
>> do this? and if not is there another way to solve my problem? thanks
>> in advance for any help
>>
>> -Shane
>> >>
>>

--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: url views problem

2008-07-01 Thread sebey

cool sorry i will try that out sorry for replying so late but I will
post what the results are

thanks again

On Jun 26, 9:23 pm, "Emil Styrke" <[EMAIL PROTECTED]> wrote:
> This line:
>
>    query = show.objects.filter(show_feed__contains="http://;)
>
> selects all shows that have a feed url(?) containing "http://;. The for loop
> then loops through these items and passes each one to feedparser. If you
> want to view only one show you have to change this to use the show ID you're
> passing in.  So maybe replacing the query line with
>
>   s = show.objects.get(pk=show_feed)
>
> and getting rid of the "for s in query" line might do the trick? Then you'll
> get only the feed for show 1 parsed when you go to /shows/1.
>
>   /Emil
>
> 2008/6/25 sebey <[EMAIL PROTECTED]>:
>
>
>
> > sorry but I do not want to limit the results as I am useing a parser
> > in the views.py but I want to get all of the urls and the first url
> > show/1, the second url I want to give shows/2 and so on and so on
> > On Jun 25, 1:48 pm, Jeff FW <[EMAIL PROTECTED]> wrote:
> > > You've now passed in the variable (which you can check by throwing a
> > > "print show_feed" at the top of the function), but now you actually
> > > need to *do* something with it.  I'm assuming (not really knowing what
> > > you want out of this) that you'd want to add an order_by clause to
> > > order your podcasts (?) by *something*, then do some slicing to limit
> > > the results.
>
> > > Read:
> >http://www.djangoproject.com/documentation/db-api/#limiting-querysets
>
> > > -Jeff
>
> > > On Jun 25, 4:58 am, sebey <[EMAIL PROTECTED]> wrote:
>
> > > > yes i have that set up it now looks like this
>
> > > > def show_page(request,show_feed):
> > > >     """this is where we take what we need form the rss feeds in the
> > > > data base"""
> > > >     query = show.objects.filter(show_feed__contains="http://;)
> > > >     for s in query:
> > > >         podcast = feedparser.parse(s.show_feed)
> > > >         if  podcast.entries:
> > > >             elements = {'show_about':
> > > > podcast.feed.summary,'show_latest_title':
> > > > podcast.entries[0].title,'show_latest': podcast.entries[0].summary}
> > > >     e = elements
> > > >     t = loader.get_template('shows/show_page_base.html')
> > > >     return  HttpResponse(t.render(Context(e)))
>
> > > > but it still in not working so help please thank you for trying
>
> > > > On Jun 24, 3:07 pm, phillc <[EMAIL PROTECTED]> wrote:
>
> > > > > you did not readhttp://
> >www.djangoproject.com/documentation/url_dispatch/
>
> > > > > your method, show_page, is now passed a parameter called show_feed.
> > > > > you need to use it accordingly
>
> > > > > On Jun 24, 10:02 am, sebey <[EMAIL PROTECTED]> wrote:
>
> > > > > > either way its still the same thanks though but it still is not
> > > > > > working
>
> > > > > > On Jun 24, 1:44 pm, Jeff FW <[EMAIL PROTECTED]> wrote:
>
> > > > > > > The regex you're using has a trailing /, so you need to have that
> > in
> > > > > > > your link as well:
> > > > > > > /shows/1/
>
> > > > > > > The other option is to make the trailing slash optional like so:
> > > > > > > r'^shows/(?P\d{1})[/]?$'
>
> > > > > > > On Jun 24, 7:09 am, sebey <[EMAIL PROTECTED]> wrote:
>
> > > > > > > > it works but  (thanks for the tips) it still is getting the
> > same feed
> > > > > > > > for local/shows/1/ and local/show/2 help please
>
> > > > > > > > everyone who has helped so far thank you
>
> > > > > > > > On Jun 24, 12:06 pm, sebey <[EMAIL PROTECTED]> wrote:
>
> > > > > > > > > ok fixed that yeah i saw that after I posted but here is what
> > it looks
> > > > > > > > > like now
>
> > > > > > > > > from django.conf.urls.defaults import *
>
> > > > > > > > > urlpatterns = patterns('',
> > > > > > > > >     # Example:
> > > > > > > > >     # (r'^ubermicro/', include('ubermicro.foo.urls')),
>
> > > > > > > > >     # Uncomment this for admin:
> > > > > > > > >     (r'^admin/', include('django.contrib.admin.urls')),
> > > > > > > > >     #temp only fo dev proposes
> > > > > > > > >     (r'^shows/(?p\d{1})/
> > > > > > > > > $','ubermicro.shows.views.show_page')
> > > > > > > > > )
>
> > > > > > > > > thanks some please
>
> > > > > > > > > On Jun 24, 11:46 am, Tye <[EMAIL PROTECTED]>
> > wrote:
>
> > > > > > > > > > Why does the /shows/ etc url string end with
>
> > > > > > > > > > /s'
>
> > > > > > > > > > ?
>
> > > > > > > > > > Typo?
>
> > > > > > > > > > Sent from my iPhone
>
> > > > > > > > > > On Jun 24, 2008, at 3:23, sebey <[EMAIL PROTECTED]> wrote:
>
> > > > > > > > > > > I have gotten this traceback
>
> > > > > > > > > > > Traceback (most recent call last):
> > > > > > > > > > > File
> > "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/
> > > > > > > > > > > site-packages/django/core/handlers/base.py" in
> > get_response
> > > > > > > > > > >  68. callback, callback_args, callback_kwargs =
> > > > > > > > > > > resolver.resolve(request.path)
> > > > > > > > > > > File
> > 

Re: combining unrelated tables

2008-07-01 Thread Richard Dahl
Not sure exactly where you are going, but what do you mean by ' Inside
views.py it only lets me send 1 queryset to the template'  why can't you do
something like:

render_to_response('Template.html', {'first_qs': Model1.objects.all(),
'second_qs':Model2.objects.all()})

-richard



On 7/1/08, Shane_McNamee <[EMAIL PROTECTED]> wrote:
>
>
> hey, i searched around this forum and found a lot of questions similar
> to this, but i couldnt find an answer to my question.
>
> I need to send data to my templates that comes from multiple tables in
> my database. Inside views.py it only lets me send 1 queryset to the
> template, so i figured the only way to send data from more than 1
> table was to join everything i needed into a single queryset. however
> i cant figure out how to join tables within django. is there a way to
> do this? and if not is there another way to solve my problem? thanks
> in advance for any help
>
> -Shane
>
> >
>

--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: testing login problem

2008-07-01 Thread [EMAIL PROTECTED]

> How do I create username and password for the test database.

What I do is either create a test user on SetUp(), or put that
username inside the "initial_data" fixture, which loads automatically
when Django creates the test DB...

HTH,

Carlos
--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



combining unrelated tables

2008-07-01 Thread Shane_McNamee

hey, i searched around this forum and found a lot of questions similar
to this, but i couldnt find an answer to my question.

I need to send data to my templates that comes from multiple tables in
my database. Inside views.py it only lets me send 1 queryset to the
template, so i figured the only way to send data from more than 1
table was to join everything i needed into a single queryset. however
i cant figure out how to join tables within django. is there a way to
do this? and if not is there another way to solve my problem? thanks
in advance for any help

-Shane

--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: MediaTemple Containers

2008-07-01 Thread joshuajonah

For expandability and dedicated memory you'd probably want a dedicated
or Dedicated grid machine.

I use a MediaTemple DV with python2.5 and django latest trunk, works
great, even for tons of video.

On Jul 1, 9:55 am, Niall McCormack <[EMAIL PROTECTED]>
wrote:
> They do look good, but I want some more bandwidth and hard disk space
> for that sorta price to be honest.
>
> I'm relaunching my site and have lots of video on it so I want to be
> covered if need be...
>
> On 1 Jul 2008, at 01:30, elithrar wrote:
>
>
>
> > Have you considered WebFaction at all, if you're after Django on
> > shared hosting?http://djangofriendly.com/hosts/has a listing of
> > hosts (shared & VPS) that do Django hosting - with comments about
> > them.
--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: MediaTemple Containers

2008-07-01 Thread Niall McCormack

They do look good, but I want some more bandwidth and hard disk space  
for that sorta price to be honest.

I'm relaunching my site and have lots of video on it so I want to be  
covered if need be...




On 1 Jul 2008, at 01:30, elithrar wrote:

>
> Have you considered WebFaction at all, if you're after Django on
> shared hosting? http://djangofriendly.com/hosts/ has a listing of
> hosts (shared & VPS) that do Django hosting - with comments about  
> them.
> >


--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Missing traceback for 500 errors

2008-07-01 Thread Karen Tracey
On Tue, Jul 1, 2008 at 8:15 AM, Elizabeth Kellner <[EMAIL PROTECTED]>
wrote:

>
> The full python traceback is missing from my apache logs.  In fact,
> I've just seen that the only notification of a 500 error is in
> access_log and the browser.  Can anyone suggest any place to look to
> see why this is the case?
>
> Here is the python view that I am using to test...
> def view500(request):
>"Throws a server 500 error for testing"
>
>msg = "Test 500 error.  This is not a real malfunction"
>logging.error(msg)
>raise MyRequestException(msg)
>
> My apache error_log says...
> [Tue Jul 01 14:01:33 2008] [notice] Apache/2.2.8 (Unix) mod_ssl/2.2.8
> OpenSSL/0.9.7l mod_python/3.3.1 Python/2.5.1 configured -- resuming
> normal operations
> licenseserver: [2008-07-01 07:01:35,084 10.10.20.38 iAt9asypuEk root
> ERROR] Test 500 error.  This is not a real malfunction
>
> I receive my rendered 500.html template in the browser.
>
> (One potentially funky thing I must mention is that I am using the
> drlog middleware (http://www.fairviewcomputing.com/blog/2008/03/05/
> django-request-logging/),
> but I tried commenting it out from my
> MIDDLEWARE_CLASSES, and the problem persists.  The log message changes
> format, but still no traceback.  I doubt this is the cause.)
>
> I'm running Django trunk, revision 7629, on Mac OS X Leopard.


I think this is normal.  The only time I recall seeing tracebacks in the
Apache logs is for errors that Django didn't successfully "handle", that is
things like a missing 500.html template -- stuff that causes an exception to
get thrown out to mod_python/Apache and causes its error handling to get
involved.  Django's method for 'recording' the traceback is to send it in an
email to the IDs listed in ADMINS in settings.py,.

Karen

--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



generating tables and forms at runtime with the django subsystem

2008-07-01 Thread José Moreira

hello,

i'm a recent django developer. Sometime soon i will have to develop a
module for a cms solution to allow the content publishers to design
custom forms (including form layout) for webpages and to store the
results of the data of those forms.

the most obvious solution is to keep the form fields properties
(fk_form_id, field_id, label, type, length, required, order) in a
table (form_field) and the input data (fk_form_id, field_id,
user_answer) in another (form_field_answer).

The form itself (html) would be generated at runtime in the
front-office based on the form field properties and an action would
valdiate and capture that data (the POST) and save it to the database.

All of this completly detattched from a data model. The only data
model would the one required to save the form properties and user
input for that form.

The downfall of this is that:
- server-side validation has to be done manually
- the form controls html have to be coded manually using if's (if
field type is BLAH then show html for a BLAH input)
- all the user inputs for all forms are kept in a single database
table that can grow exponentially.

What i'm thinking about, if possible, was to keep only the form_field
table and with that data, generate a data model object on-the-fly (for
each form of course, with TextField, CharField, ..., properties and so
on) and use the django sub-system to (like if it was hard-coded the
usual way) :

- generate the SQL for the form table
- present the CRUD in the backoffice
- validate the datamodel after POST
- use django-forms in the front-office to generate the controls html,
by replacing tags like {FIELD_LABEL:field name 1} and
{FIELD_INPUT:field name 1} in a template with django-form widgets and
showing the result


because in not yet acquainted with the django code base, i'm asking
for your opinion.

thanks


display the form in the front-office by merging


-- 
José Moreira
Vila Nova de Gaia
Portugal

--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Internal Redirects Limit

2008-07-01 Thread Gorm Lai



On Mon, 2008-06-30 at 19:26 +1000, Malcolm Tredinnick wrote:
> 
> 
> On Mon, 2008-06-30 at 10:03 +0200, Gorm Lai wrote:
> > Hey,
> > 
> > I now have our django project set up both locally and on our own remote
> > server. Everything works fine.
> > 
> > However, I still have trouble getting it up and running on the client's
> > site. It is a big broad casting company, so they won't let me mess with
> > their apache setup directly. They will change it, when I request it, but
> > the turnaround cycle is rather long, so I want to be sure I request the
> > right changes.
> > 
> > I know get this error in the apache logs, 
> > 
> > [Fri Jun 27 16:17:53 2008] [error] [client 130.226.238.69] Request
> > exceeded the limit of 10 internal redirects due to probable
> > configuration error. Use 'LimitInternalRecursion' to increase the limit
> > if necessary. Use 'LogLevel debug' to get a backtrace.
> > 
> > Please note that I do not have the power to set a LogLevel debug. Can
> > django indirectly cause an apache error like this?
> 
> >From memory, what this usually means is that something like Apache
> Rewrite rules have gotten mixed up and are doing internal calls to
> themselves. Note that this is an *internal* redirect, so it doesn't have
> anything to do with HTTP redirects. It also cannot be caused solely by
> Django. Rather, it's a problem in the Apache configuration and the
> result your are returning (or perhaps the resource that is being
> requested) is triggering the problem.
> 
> Without you (or your sysadmins) being able to turn on the debug-level
> logging for this, it's going to be fairly hard to resolve the problem.
> But it's certainly an Apache configuration problem, rather than
> something on the Django side (well, at least, the Apache configuration
> is contributing to it).
> 
> Regards,
> Malcolm
> 

Ok, so I now got the LogLevel debug output.

It says

[Tue Jul 01 07:39:08 2008] [debug] core.c(3027): [client 130.226.238.69]
r->uri = /php/drmu/sommerspil/login/
[Tue Jul 01 07:39:08 2008] [debug] core.c(3033): [client 130.226.238.69]
redirected from r->uri = /php/drmu/sommerspil/login/
[Tue Jul 01 07:39:08 2008] [debug] core.c(3033): [client 130.226.238.69]
redirected from r->uri = /php/drmu/sommerspil/login/

and so forth..

when I hit my url directly at http://77.66.32.232/php/drmu/sommerspil/ ,
I get the expected behaviour of no listing allowed, and I can also
directly access files in that directory that I know exists. So the
redirection is correct.

However, as soon as I try to hitting one of my methods, e.g. 
http://77.66.32.232/php/drmu/sommerspil/login/ then I got the
LimitInternalRecursion error. Please note, that I already tried setting
the limit higher, just in the unlikely case that I wasn't dealing with
infinite recursion.

The relevant section in my apache setup looks like

 
SetHandler python-program
PythonPath "sys.path +
['/home/dradmin/wwwroot/php/drmu']"
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE sommerspil.settings
PythonDebug On
 

And my urls file look like

from django.conf.urls.defaults import *
from sommerspil.spil.views import *

urlpatterns = patterns('',

(r'^/php/drmu/sommerspil/',include('normal.root.urls')),
   (r'^register/','sommerspil.spil.views.register'),

   (r'^setupdatabase/',
'sommerspil.spil.views.setupDatabase'),

   (r'^/php/drmu/sommerspil/login/', 
'sommerspil.spil.views.loginUser'),

   (r'^setroute/$',  
'sommerspil.spil.views.setRoute'),

   (r'^updatetonextday/$',  
'sommerspil.spil.views.updateToNextDay'),

   (r'^(?P.*)$', 'django.views.static.serve',
{'document_root': '/home/dradmin/wwwroot/'}),
   )

I really hope some one can help, as I seem to be running out leads.

- 
Cheers,
Gorm

Tel: (+45) 31 12 78 44
Co-Founder of 3 Lives Left
Blog: http://www.lai.as/index.php



--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Missing traceback for 500 errors

2008-07-01 Thread Elizabeth Kellner

The full python traceback is missing from my apache logs.  In fact,
I've just seen that the only notification of a 500 error is in
access_log and the browser.  Can anyone suggest any place to look to
see why this is the case?

Here is the python view that I am using to test...
def view500(request):
"Throws a server 500 error for testing"

msg = "Test 500 error.  This is not a real malfunction"
logging.error(msg)
raise MyRequestException(msg)

My apache error_log says...
[Tue Jul 01 14:01:33 2008] [notice] Apache/2.2.8 (Unix) mod_ssl/2.2.8
OpenSSL/0.9.7l mod_python/3.3.1 Python/2.5.1 configured -- resuming
normal operations
licenseserver: [2008-07-01 07:01:35,084 10.10.20.38 iAt9asypuEk root
ERROR] Test 500 error.  This is not a real malfunction

I receive my rendered 500.html template in the browser.

(One potentially funky thing I must mention is that I am using the
drlog middleware (http://www.fairviewcomputing.com/blog/2008/03/05/
django-request-logging/), but I tried commenting it out from my
MIDDLEWARE_CLASSES, and the problem persists.  The log message changes
format, but still no traceback.  I doubt this is the cause.)

I'm running Django trunk, revision 7629, on Mac OS X Leopard.

Thanks for your replies,
Elisabeth
--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Restriction of Model Inheritance - mixing multi table and abstract

2008-07-01 Thread Malcolm Tredinnick


On Tue, 2008-07-01 at 12:53 +0100, Ian J Cottee wrote:
> Take this simple models file. If I try and do 
> 
> pi = PlayableItem(funfactor=33,code='PS2',description='Play station
> 2')
> 
> I get 
> 
> "TypeError: 'code' is an invalid keyword argument for this function"
> 
> If PlayableItem inherits directly from Item, this does not happen. Is
> there some rule I'm breaking here?

I don't have time to look at this at the moment (I'm up to my armpits in
somebody else's problem), but this looks like a bug. Would you mind to
open a ticket and include your example so it doesn't get lost? You can
probably leave out EditableItem, since an example that's as small as
possible if preferable.

All the fields of all the ancestors should be available on any given
model, regardless of any mixing of abstract and non-abstract
inheritance.

Regards,
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Restriction of Model Inheritance - mixing multi table and abstract

2008-07-01 Thread Ian J Cottee
Take this simple models file. If I try and do

pi = PlayableItem(funfactor=33,code='PS2',description='Play station 2')

I get

"TypeError: 'code' is an invalid keyword argument for this function"

If PlayableItem inherits directly from Item, this does not happen. Is there
some rule I'm breaking here?

Cheers

Ian

--- Code follows ---

from django.db import models
import datetime
# Create your models here.

class BaseModel(models.Model):
"""Abstract class used for some common fields"""
created_at = models.DateTimeField(blank=True,
default=datetime.datetime.now)
modified_at = models.DateTimeField(blank=True,
default=datetime.datetime.now)

class Meta:
abstract = True

class Item(BaseModel):
"""Everything in the system"""

code = models.CharField(blank=True, max_length=15) # A shortname
description = models.CharField(blank=True, max_length=50)

class ValuedItem(Item):
"""This is an abstract base class for stuff with a value"""

value = models.FloatField(default=0.0)

class Meta:
abstract = True

class EdibleItem(ValuedItem):
"""Stuff we can eat"""
taste = models.CharField(blank=True, max_length=100)

class PlayableItem(ValuedItem):
"""Stuff we can play with"""
funfactor = models.IntegerField(blank=True, null=True) # Amount of fun
we get out of it

--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: a recent update broke form.save(commit=False) on FK fields

2008-07-01 Thread omat

I have submitted a ticket for the issue:
http://code.djangoproject.com/ticket/7585


Thanks...


On Jul 1, 12:51 pm, omat <[EMAIL PROTECTED]> wrote:
> More specifically, I think the problem is in
> ReverseSingleRelatedObjectDescriptor in related.py, where it does not
> check if commit=False at line 249:
>
> ...
> if value is None and self.field.null == False:
> raise ValueError('Cannot assign None: "%s.%s" does not
> allow null values.' %
> (instance._meta.object_name,
> self.field.name))
> ...
>
> On Jul 1, 12:30 pm, omat <[EMAIL PROTECTED]> wrote:
>
> > But it is raised at the line:
>
> > photo = form.save(commit=False)
>
> > On Jul 1, 12:26 pm, Malcolm Tredinnick <[EMAIL PROTECTED]>
> > wrote:
>
> > > On Tue, 2008-07-01 at 02:18 -0700, omat wrote:
> > > > Hi,
>
> > > > I updated Django to svn trunk v. 7811 from about a week old version.
>
> > > > When saving a form (ModelForm instance) with a foreign key to another
> > > > model, this used to work:
>
> > > > photo = form.save(commit=False)
> > > > photo.album = album
> > > > photo.save()
>
> > > > But now it raises a ValueError at the form.save(commit=False):
>
> > > > ValueError: Cannot assign None: "Photo.album" does not allow null
> > > > values.
>
> > > This error suggests the "album" is None. Django raises an error for that
> > > situation now (since it always was an error). So you need to investigate
> > > why "album" would be None there.
>
> > > That change was checked in on June 5 (it was r7574).
>
> > > Regards,
> > > 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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: User Authentication - index/base

2008-07-01 Thread Julien

Ok, then are you passing RequestContext to the template?
A possibility is that your 'user' variable is parasited by another one
in the context.
I guess 'request.user' would do the trick...

On Jul 1, 8:14 pm, Alfonso <[EMAIL PROTECTED]> wrote:
> Hi Julien,
>
> Thanks for that  but the auth processor is in place in settings, along
> with the debug and il8n processor obviously.
>
> Allan
>
> On Jul 1, 10:29 am, Julien <[EMAIL PROTECTED]> wrote:
>
> > Hi,
>
> > Have you tried adding the auth context processor in your settings?
> > "django.core.context_processors.auth"
>
> > Alfonso wrote:
> > > Hey,
>
> > > I've implemented a user login widget on my site.  A simple 'Sign in'
> > > at top of every page that turns into 'Welcome John, View your profile'
> > > following successful user authentication.  Works great - only issue
> > > I'm having is that on home page the text reverts to  'Sign In' even
> > > when user is logged in, only happens on this page.  Not sure why this
> > > is occurring.  Code below is sited in base.html.
>
> > > 
> > >                                    {% if user.is_authenticated %}
> > >                                            Welcome, {{ user.username }}. 
> > > Log
> > > Out | Your Profile | Blog | Promotions
> > >                                    {% else %}
> > >                                            Log 
> > > in | Blog > > a> | Promotions
> > >                                    {% endif %}
>
> > >                            
>
> > > Thanks in advance
>
> > > Allan
--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: testing login problem

2008-07-01 Thread laspal

How do I create username and password for the test database.


On Jul 1, 2:24 pm, Julien <[EMAIL PROTECTED]> wrote:
> Hi,
>
> If you're using the SVN version you can try:
>
> >>> c = Client()
> >>> c.login(username='fred', password='secret')
>
> More info here:http://www.djangoproject.com/documentation/testing/
>
> On Jul 1, 5:51 pm, laspal <[EMAIL PROTECTED]> wrote:
>
> > Hi,
>
> > I am writing the test case but I am getting errors.
>
> > Test case is as follows:
>
> > import unittest
>
> > from django.test.client import Client
> > from django.contrib.auth.models import User, Group
> > from ibm.crm.models import Industry
>
> > class IndustryTest(unittest.TestCase):
>
> > def setUp(self):
> > self.client = Client()
> > response =self.client.post('/ibm/login/',
> > {'username':'laspal', 'password':'abcd'})
> > print response
>
> > Getting error :
>
> > 
>
> >   Your username and password didn't match.
> > Please try again.
>
> >  > for="id_username">Username : > width="50%" class="loginbox"> > class="vTextField required" name="username" size="15" value="laspal"
> > maxlength="30" />
> >  > for="id_password">Password : > width="50%" class="loginbox"> > class="vPasswordField required" name="password" size="15" value="abcd"
> > maxlength="30" />
> >  > class="button" type="submit" value="login" />
>
> > 
>
> > So my problem is its not getting login.
> > with same username and login I am able to login in the UI.
> > Does I have to include anything??
>
> > Thanks
--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



GeoDjango/GoogleMaps: No support for points/markers

2008-07-01 Thread [EMAIL PROTECTED]

I  noticed that the automatic Google Map creation in the Django GIS
branch does not support the display of point features, only polylines
and polygons.

Unless there was a specific reason not to include this, I have a
patch  that will include points as GMarkers on maps, which I could
contribute.

Maybe the reason is that there is not consensus whether Google Maps
should be in the core Django offering?

Ludwig

--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: User Authentication - index/base

2008-07-01 Thread Alfonso

Hi Julien,

Thanks for that  but the auth processor is in place in settings, along
with the debug and il8n processor obviously.

Allan

On Jul 1, 10:29 am, Julien <[EMAIL PROTECTED]> wrote:
> Hi,
>
> Have you tried adding the auth context processor in your settings?
> "django.core.context_processors.auth"
>
> Alfonso wrote:
> > Hey,
>
> > I've implemented a user login widget on my site.  A simple 'Sign in'
> > at top of every page that turns into 'Welcome John, View your profile'
> > following successful user authentication.  Works great - only issue
> > I'm having is that on home page the text reverts to  'Sign In' even
> > when user is logged in, only happens on this page.  Not sure why this
> > is occurring.  Code below is sited in base.html.
>
> > 
> >                                    {% if user.is_authenticated %}
> >                                            Welcome, {{ user.username }}.  > href="/accounts/logout/">Log
> > Out | Your Profile | Blog | Promotions
> >                                    {% else %}
> >                                            Log 
> > in | Blog > a> | Promotions
> >                                    {% endif %}
>
> >                            
>
> > Thanks in advance
>
> > Allan
--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: dreaded FieldError (used to be KeyError) can only replicate on production, ugh!

2008-07-01 Thread Scott Moonen
Milan, I took another look at the error and your template.  Judging from the
error (it seems to be complaining about some access to the member object,
rather than the project list), I think the reference to line 9 is a red
herring.  In other words, the outermost tag that Django is rendering at the
time is your outer for loop, but the real problem is occurring in the
rendering of an inner loop.

So I'd ignore the reference to line 9 and look further at the inner contents
of that for loop.  I don't think the entire for loop is included in the
dpaste traceback snippet, as I don't see its endfor.

  -- Scott

On Mon, Jun 30, 2008 at 9:18 PM, Malcolm Tredinnick <
[EMAIL PROTECTED]> wrote:

>
>
> On Mon, 2008-06-30 at 16:53 -0700, Milan Andric wrote:
> >
> >
> > On Jun 30, 3:32 pm, Milan Andric <[EMAIL PROTECTED]> wrote:
> > > On Jun 30, 3:08 pm, "Scott Moonen" <[EMAIL PROTECTED]> wrote:
> > >
> > > > Hi Milan, would you mind posting the source for the object_list
> function as
> > > > well?
> > >
> > > I just imported object_list from django.views.generic.list_detail.
> > >
> >
> > One oddity I think I picked out of the html traceback was in
> > /foobar/django/db/models/query.py in filter
> > return self._filter_or_exclude(False, *args, **kwargs)
> >
> > self is a list of ALL the User objects.  Not sure what is causing all
> > that stuff to be pulled through a seemingly simple view.
>
> I haven't looked at this in detail yet, but I thought I'd head of any
> mid-diagnosis here. It looks more like "self" is a queryset. The debug
> view shows the repr() of each object and the repr() of a queryset if the
> list containing each object. So I'd guess "self" is something like
> User.objects.filter(...).
>
> Regards,
> Malcolm
>
>
>
> >
>


-- 
http://scott.andstuff.org/ | http://truthadorned.org/

--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: a recent update broke form.save(commit=False) on FK fields

2008-07-01 Thread omat

More specifically, I think the problem is in
ReverseSingleRelatedObjectDescriptor in related.py, where it does not
check if commit=False at line 249:

...
if value is None and self.field.null == False:
raise ValueError('Cannot assign None: "%s.%s" does not
allow null values.' %
(instance._meta.object_name,
self.field.name))
...




On Jul 1, 12:30 pm, omat <[EMAIL PROTECTED]> wrote:
> But it is raised at the line:
>
> photo = form.save(commit=False)
>
> On Jul 1, 12:26 pm, Malcolm Tredinnick <[EMAIL PROTECTED]>
> wrote:
>
> > On Tue, 2008-07-01 at 02:18 -0700, omat wrote:
> > > Hi,
>
> > > I updated Django to svn trunk v. 7811 from about a week old version.
>
> > > When saving a form (ModelForm instance) with a foreign key to another
> > > model, this used to work:
>
> > > photo = form.save(commit=False)
> > > photo.album = album
> > > photo.save()
>
> > > But now it raises a ValueError at the form.save(commit=False):
>
> > > ValueError: Cannot assign None: "Photo.album" does not allow null
> > > values.
>
> > This error suggests the "album" is None. Django raises an error for that
> > situation now (since it always was an error). So you need to investigate
> > why "album" would be None there.
>
> > That change was checked in on June 5 (it was r7574).
>
> > Regards,
> > 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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: a recent update broke form.save(commit=False) on FK fields

2008-07-01 Thread omat

But it is raised at the line:

photo = form.save(commit=False)



On Jul 1, 12:26 pm, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> On Tue, 2008-07-01 at 02:18 -0700, omat wrote:
> > Hi,
>
> > I updated Django to svn trunk v. 7811 from about a week old version.
>
> > When saving a form (ModelForm instance) with a foreign key to another
> > model, this used to work:
>
> > photo = form.save(commit=False)
> > photo.album = album
> > photo.save()
>
> > But now it raises a ValueError at the form.save(commit=False):
>
> > ValueError: Cannot assign None: "Photo.album" does not allow null
> > values.
>
> This error suggests the "album" is None. Django raises an error for that
> situation now (since it always was an error). So you need to investigate
> why "album" would be None there.
>
> That change was checked in on June 5 (it was r7574).
>
> Regards,
> 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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: requiring fields in the admin page

2008-07-01 Thread David Keegan

Awesome! thanks

On Jul 1, 2008, at 2:15 AM, Julien wrote:

>
> By default all items are required. To make a field optional you have
> to use blank=True.
> Some interesting reading here:
> http://www.b-list.org/weblog/2006/jun/28/django-tips-difference-between-blank-and-null/
>
> On Jul 1, 7:10 pm, keegan3d <[EMAIL PROTECTED]> wrote:
>> Hey guys,
>>
>> I am trying to make a couple of fields required in the admin page for
>> my app. I originally thought that core=True would do it but it makes
>> all the fields required, even ones that I did not specify core=True
>> for. After some further reading it seems like this is only used for
>> fields that are being edited in-line.
>>
>> Is there something I can set that will make the fields required  
>> before
>> the item will save?
>>
>> -Dave
> >


--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: User Authentication - index/base

2008-07-01 Thread Julien

Hi,

Have you tried adding the auth context processor in your settings?
"django.core.context_processors.auth"

Alfonso wrote:
> Hey,
>
> I've implemented a user login widget on my site.  A simple 'Sign in'
> at top of every page that turns into 'Welcome John, View your profile'
> following successful user authentication.  Works great - only issue
> I'm having is that on home page the text reverts to  'Sign In' even
> when user is logged in, only happens on this page.  Not sure why this
> is occurring.  Code below is sited in base.html.
>
> 
>   {% if user.is_authenticated %}
>   Welcome, {{ user.username }}. 
> Log
> Out | Your Profile | Blog | Promotions
>   {% else %}
>   Log 
> in | Blog a> | Promotions
>   {% endif %}
>
>   
>
> Thanks in advance
>
> Allan
--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: a recent update broke form.save(commit=False) on FK fields

2008-07-01 Thread Malcolm Tredinnick


On Tue, 2008-07-01 at 02:18 -0700, omat wrote:
> Hi,
> 
> I updated Django to svn trunk v. 7811 from about a week old version.
> 
> When saving a form (ModelForm instance) with a foreign key to another
> model, this used to work:
> 
> photo = form.save(commit=False)
> photo.album = album
> photo.save()
> 
> 
> But now it raises a ValueError at the form.save(commit=False):
> 
> ValueError: Cannot assign None: "Photo.album" does not allow null
> values.

This error suggests the "album" is None. Django raises an error for that
situation now (since it always was an error). So you need to investigate
why "album" would be None there.

That change was checked in on June 5 (it was r7574).

Regards,
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



XMLField not working

2008-07-01 Thread Alex Rades
Hi,
I'm trying to use an XMLField in latest nfa but it doesn't work at all (it
doesn't do the validation).
The code in validators.py/RelaxNGCompact is not executed at all, so this
field is pretty meaningless at the moment.
Do you know why this field is not working?

--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: testing login problem

2008-07-01 Thread Julien

Hi,

If you're using the SVN version you can try:
>>> c = Client()
>>> c.login(username='fred', password='secret')

More info here: http://www.djangoproject.com/documentation/testing/


On Jul 1, 5:51 pm, laspal <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I am writing the test case but I am getting errors.
>
> Test case is as follows:
>
> import unittest
>
> from django.test.client import Client
> from django.contrib.auth.models import User, Group
> from ibm.crm.models import Industry
>
> class IndustryTest(unittest.TestCase):
>
>     def setUp(self):
>         self.client = Client()
>         response =self.client.post('/ibm/login/',
> {'username':'laspal', 'password':'abcd'})
>         print response
>
> Getting error :
>
> 
>
>                       Your username and password didn't match.
> Please try again.
>
>  for="id_username">Username : width="50%" class="loginbox"> class="vTextField required" name="username" size="15" value="laspal"
> maxlength="30" />
>                  for="id_password">Password : width="50%" class="loginbox"> class="vPasswordField required" name="password" size="15" value="abcd"
> maxlength="30" />
>                  class="button" type="submit" value="login" />
>
> 
>
> So my problem is its not getting login.
> with same username and login I am able to login in the UI.
> Does I have to include anything??
>
> Thanks
--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



a recent update broke form.save(commit=False) on FK fields

2008-07-01 Thread omat

Hi,

I updated Django to svn trunk v. 7811 from about a week old version.

When saving a form (ModelForm instance) with a foreign key to another
model, this used to work:

photo = form.save(commit=False)
photo.album = album
photo.save()


But now it raises a ValueError at the form.save(commit=False):

ValueError: Cannot assign None: "Photo.album" does not allow null
values.


--
omat
--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: requiring fields in the admin page

2008-07-01 Thread Julien

By default all items are required. To make a field optional you have
to use blank=True.
Some interesting reading here:
http://www.b-list.org/weblog/2006/jun/28/django-tips-difference-between-blank-and-null/

On Jul 1, 7:10 pm, keegan3d <[EMAIL PROTECTED]> wrote:
> Hey guys,
>
> I am trying to make a couple of fields required in the admin page for
> my app. I originally thought that core=True would do it but it makes
> all the fields required, even ones that I did not specify core=True
> for. After some further reading it seems like this is only used for
> fields that are being edited in-line.
>
> Is there something I can set that will make the fields required before
> the item will save?
>
> -Dave
--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: a thread problem or my bad codes?

2008-07-01 Thread pength

sorry for the bad indent of the "#models.py" part. I post it again,
hope this time that part will be shown OK.

#models.py
class Apple_For_Sale(models.Model):
price = models.PositiveSmallIntegerField()
has_been_sold = models.BooleanField(default=False)

class People(models.Model):
money = models.PositiveSmallIntegerField()

def buy_apple(self,apple): #apple should be an instance of
Apple_For_Sale
if self.money >= apple.price and not apple.has_been_sold:
self.money -= apple.price
self.save()
apple.has_been_sold = True
apple.save()
Sale_Records.objects.create(apple=apple,people=self)

class Sale_Records(models.Model): #create one record when one people
buy
apple = models.ForeignKey(Apple_For_Sale)
people = models.ForeignKey(People)
dealt_date = models.DateTimeField(auto_now_add=True)

On Jul 1, 4:53 pm, pength <[EMAIL PROTECTED]> wrote:
> I am using Django0.96/apache2/mod_python(running prefork MPM) / mysql,
> for my Django project, a typical Django environment, I think. And
> usually there're more than 10 apache2 processes running on my site, as
> the online users is about 100+.
>
> I found a problem that sometimes if one user clicks a link several
> times very fast (means several identical requests are sent to the
> server), some error will happen. Although in my codes, I am tring to
> prevent such thing. Let me make a simple example to illustrate my
> problem.
>
> #models.py
> class Apple_For_Sale(models.Model):
> price = models.PositiveSmallIntegerField()
> has_been_sold = models.BooleanField(default=False)
>
> class People(models.Model):
> money = models.PositiveSmallIntegerField()
>
> def buy_apple(self,apple): #apple should be an instance of
> Apple_For_Sale
> if self.money >= apple.price and not apple.has_been_sold:
> self.money -= apple.price
> self.save()
> apple.has_been_sold = True
> apple.save()
>
> Sale_Records.objects.create(apple=apple,people=self)
>
> class Sale_Records(models.Model): #create one record when one people
> buy
> apple = models.ForeignKey(Apple_For_Sale)
> people = models.ForeignKey(People)
> dealt_date = models.DateTimeField(auto_now_add=True)
>
> #views.py
> def people_buy_apple(request,aid):
> "aid is the id of an apple_for_sale
> a = get_object_or_404(Apple_For_Sale, pk=aid)
> p = People.object.get(xxx) #get people...omitted here
> p.buy_apple(a)
> return 
>
> The logic is simple. If the people has enough money and the apples
> have not already been sold, then the "buy apple" will be successful.
>
> And in my site, I think 99% of such things happened correctly. But,
> very rarely, when one user clicks a link of "buy apple" several times
> fast, there'll be more than 1 records of Sale_Records created, for
> same "apple" and "people", and the people's money was minused several
> times for one identical apple. And if the network is laggy, it seems
> the frequency of such error occurs becomes higher.
>
> For my understanding, when the several "identical requests" are sent
> to my server, the requests are dispatched to different apache2
> processes, and nearly the same time, each process "think" the "buy
> apple" can happen successfully. sothe error comes out.
>
> In my actual site,  I have added some "unqiue = True" to avoid this
> kind of error, in DB level. For example:
> class Sale_Records(models.Model):
> apple = models.ForeignKey(Apple_For_Sale, unique=True)
>
> But really I doubt this is the right way to solve my problem.
>
> Can anyone help? Can I avoid such error by using "mod_wsgi in daemon
> mode with only 1
> thread " (ref. to 
> :http://groups.google.com/group/django-users/browse_thread/thread/5bd5...)
>
> Thanks a lot!
--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



  1   2   >