maximum recursion depth exceeded

2021-02-10 Thread Frank Maruf
In signal i have been trying to doing this . i'm new at Django.

help me with this:

class Examiner(models.Model):

 #just think i have saved  (Primary School Certificate) in to my database.

examiner_title = models.CharField(max_length=150)
slug = models.SlugField(max_length=100, unique=True,blank=True)



Students Model:
Sd_Examiner=models.ForeignKey(Examiner,null=True
,on_delete=models.SET_NULL,blank=True)



and at Signal:

exam = Examiner.objects.get(examiner_title__contains="Primary")
exam_id = str(exam.id)
instance.Sd_Examiner_id=exam_id
instance.save()



i get maximum recursion depth exceeded

how can i get over with this?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/fbaff8ef-6223-42cf-add9-fb6aa79d9edfn%40googlegroups.com.


Re: RuntimeError: maximum recursion depth exceeded in cmp

2016-01-28 Thread palansh agarwal
Hey,
You may try to re-factor your code and turn it into an iterative one.
If that's not possible, try the following:

import  sys
> sys.setrecursionlimit(n)
>

Increase "n" as per your need.

Regards,

*Palansh Agarwal | +918239026608 <http://+918239026608>|+919461787317
<http://+919461787317/>*

*http://www.palanshagarwal.com/ <http://www.palanshagarwal.com/>*

*CTO, Eventgraphia <http://eventgraphia.com/>, India*
Team Lead IDC, *GoMobileFirst, USA*
Pre Final Year, B.Tech
The LNM Institute of Information Technology, Jaipur, India
[image: https://www.facebook.com/palansh.agarwal]
<https://www.facebook.com/palansh.agarwal>
<https://in.linkedin.com/in/palansh>  <https://twitter.com/pyg33k>  [image:
https://github.com/py-geek] <https://github.com/py-geek>

On Thu, Jan 28, 2016 at 1:24 PM, Deepak Singh <ds1990si...@gmail.com> wrote:

> Hi,
>
> During (python manage.py runserver) command I am getting following error
>
>  File "C:\Python27\lib\functools.py", line 56, in 
> '__lt__': [('__gt__', lambda self, other: other < self),
>   File "C:\Python27\lib\functools.py", line 56, in 
> '__lt__': [('__gt__', lambda self, other: other < self),
>   File "C:\Python27\lib\functools.py", line 56, in 
> '__lt__': [('__gt__', lambda self, other: other < self),
> RuntimeError: maximum recursion depth exceeded in cmp
>
> Please guide me for neccessary step. I am running it first time.
>
> Thank You.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/d8d7d91d-d80a-457b-8e72-71a91e7238bc%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/d8d7d91d-d80a-457b-8e72-71a91e7238bc%40googlegroups.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPCyp%2B8E9%3DQ-Tie7javJaG5eS0DUmOR-SGoNNxry10TUifq4Dg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: RuntimeError: maximum recursion depth exceeded in cmp

2016-01-28 Thread Tim Graham
I've never seen that before. I think you'll need to provide a sample 
project that reproduces it so that someone can take a look.

On Thursday, January 28, 2016 at 7:45:31 AM UTC-5, Deepak Singh wrote:
>
> Hi,
>
> During (python manage.py runserver) command I am getting following error
>
>  File "C:\Python27\lib\functools.py", line 56, in 
> '__lt__': [('__gt__', lambda self, other: other < self),
>   File "C:\Python27\lib\functools.py", line 56, in 
> '__lt__': [('__gt__', lambda self, other: other < self),
>   File "C:\Python27\lib\functools.py", line 56, in 
> '__lt__': [('__gt__', lambda self, other: other < self),
> RuntimeError: maximum recursion depth exceeded in cmp
>
> Please guide me for neccessary step. I am running it first time.
>
> Thank You.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/6dd721ad-6106-4f39-aff3-9e42bff4f9bf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


RuntimeError: maximum recursion depth exceeded in cmp

2016-01-28 Thread Deepak Singh
Hi,
   
During (python manage.py runserver) command I am getting following error

 File "C:\Python27\lib\functools.py", line 56, in 
'__lt__': [('__gt__', lambda self, other: other < self),
  File "C:\Python27\lib\functools.py", line 56, in 
'__lt__': [('__gt__', lambda self, other: other < self),
  File "C:\Python27\lib\functools.py", line 56, in 
'__lt__': [('__gt__', lambda self, other: other < self),
RuntimeError: maximum recursion depth exceeded in cmp

Please guide me for neccessary step. I am running it first time.

Thank You.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d8d7d91d-d80a-457b-8e72-71a91e7238bc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: RuntimeError: maximum recursion depth exceeded in cmp

2013-03-24 Thread Vernon D. Cole
You have an error in your "models.py" file.  Note that the last message was 
"Validataing models...".

Is there anything in models.py?  In your sample script you never modify it.

On Friday, March 22, 2013 1:23:46 PM UTC-6, tarik setia wrote:
>
>
> <https://lh6.googleusercontent.com/-4e6B6aQD5hc/UUyvjDV5mrI/ADY/uWA1cgfM07M/s1600/Untitled.tiff>
> I was following the very first tutorial on django website. When i started 
> the server i got an error "RuntimeError: maximum recursion depth exceeded 
> in cmp" as shown in image
> Please help.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




RuntimeError: maximum recursion depth exceeded in cmp

2013-03-22 Thread tarik setia


<https://lh6.googleusercontent.com/-4e6B6aQD5hc/UUyvjDV5mrI/ADY/uWA1cgfM07M/s1600/Untitled.tiff>
I was following the very first tutorial on django website. When i started 
the server i got an error "RuntimeError: maximum recursion depth exceeded 
in cmp" as shown in image
Please help.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: loaddata deserializationerror: maximum recursion depth exceeded while calling a Python object

2012-12-30 Thread donarb
At this point, I would just skip trying to load the data through Django and 
write a quick Python script to load the data using INSERT statements or create 
a bulk data file to load it directly into MySQL. I'm not as familiar with MySQL 
as I am with Postgres, but Postgres can swallow a whole data file and rollback 
the transaction should it find invalid data in a row. I'm guessing MySQL can do 
something similar.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/B4RwpUtco8wJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: loaddata deserializationerror: maximum recursion depth exceeded while calling a Python object

2012-12-30 Thread Sam Raker
I've also tried changing the charset and collation options in my MySQL 
tables. Still no good. I'm so stumped. Can anyone help me, please?

On Sunday, December 30, 2012 8:54:44 PM UTC-5, Sam Raker wrote:
>
> I tried changing my backend to django-mysql-pymysql (
> http://pypi.python.org/pypi/django-mysql-pymysql/0.1), and that didn't 
> work either. I'm really at my wits' end. Can anyone help?
>
> On Sunday, December 30, 2012 4:21:57 PM UTC-5, Sam Raker wrote:
>>
>> I just tried both of those things, and the YAML data loaded fine, and 
>> validate said I had 0 errors.
>>
>> Any other suggestions? I'm really stumped here.
>>
>> On Sun, Dec 30, 2012 at 3:35 PM, donarb <don...@nwlink.com> wrote:
>>
>>>
>>>
>>> On Sunday, December 30, 2012 11:58:46 AM UTC-8, Sam Raker wrote:
>>>>
>>>> So I upped the verbosity like you said, and basically all it got me was 
>>>> a bunch of text telling me all the places Django didn't find my fixture 
>>>> before it finally did, and then the same error. Here's the full text of 
>>>> the 
>>>> error:
>>>>
>>>> Traceback (most recent call last):
>>>>   File "/home/menusadmin/.pythonbrew/**pythons/Python-2.7.3/lib/**
>>>> python2.7/site-packages/**django/core/management/**commands/loaddata.py", 
>>>> line 190, in handle
>>>> for obj in objects:
>>>>   File "/home/menusadmin/.pythonbrew/**pythons/Python-2.7.3/lib/**
>>>> python2.7/site-packages/**django/core/serializers/**pyyaml.py", line 
>>>> 62, in Deserializer
>>>> raise DeserializationError(e)
>>>> DeserializationError: maximum recursion depth exceeded while calling a 
>>>> Python object
>>>>
>>>> I tried changing commit to False in loaddata.py, I tried adding a 
>>>> manager class to the one model I have that another model refers to with a 
>>>> natural key (e.g., 'name,' a CharField, as opposed to the primary key). I 
>>>> read something about loaddata having some unicode-related problems, so I 
>>>> added custom Manager classes for all my models that coerce appropriate 
>>>> fields to strings, e.g.:
>>>>
>>>> class MenuManager(models.Manager):
>>>> def create_Menu(self,restaurant,**year,location,status,pk,**
>>>> period,language):
>>>> menu = self.create(restaurant=str(**restaurant),year=int(year),**
>>>> location=str(location),status=**str(status),pk=int(pk),period=**
>>>> str(period),language=str(**language))
>>>>  return menu
>>>>
>>>> I'm still getting the exact same error. Help?
>>>>
>>>  
>>> Then the next thing I'd do is to test the yml data itself, separate from 
>>> Django to make sure that the data is not corrupted in any way. Run a script 
>>> like this, if it passes, then you probably have some sort of error in your 
>>> models that is recursive.
>>>
>>> *#!/usr/bin/env python*
>>> *
>>> *
>>> *import yaml*
>>> *
>>> *
>>> *stream = open("test.yml", "r")*
>>> *print yaml.load(stream)*
>>>
>>>
>>> Finally, I'd run
>>>
>>> *./manage.py validate*
>>>
>>>
>>> to make sure that all of your models are valid.
>>>
>>>  
>>>
>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Django users" group.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msg/django-users/-/WoMoRX8i3DsJ.
>>>
>>> To post to this group, send email to django-users@googlegroups.com.
>>> To unsubscribe from this group, send email to 
>>> django-users+unsubscr...@googlegroups.com.
>>> For more options, visit this group at 
>>> http://groups.google.com/group/django-users?hl=en.
>>>
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/hTw0AXF02WEJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: loaddata deserializationerror: maximum recursion depth exceeded while calling a Python object

2012-12-30 Thread Sam Raker
I tried changing my backend to django-mysql-pymysql 
(http://pypi.python.org/pypi/django-mysql-pymysql/0.1), and that didn't 
work either. I'm really at my wits' end. Can anyone help?

On Sunday, December 30, 2012 4:21:57 PM UTC-5, Sam Raker wrote:
>
> I just tried both of those things, and the YAML data loaded fine, and 
> validate said I had 0 errors.
>
> Any other suggestions? I'm really stumped here.
>
> On Sun, Dec 30, 2012 at 3:35 PM, donarb <don...@nwlink.com> wrote:
>
>>
>>
>> On Sunday, December 30, 2012 11:58:46 AM UTC-8, Sam Raker wrote:
>>>
>>> So I upped the verbosity like you said, and basically all it got me was 
>>> a bunch of text telling me all the places Django didn't find my fixture 
>>> before it finally did, and then the same error. Here's the full text of the 
>>> error:
>>>
>>> Traceback (most recent call last):
>>>   File "/home/menusadmin/.pythonbrew/**pythons/Python-2.7.3/lib/**
>>> python2.7/site-packages/**django/core/management/**commands/loaddata.py", 
>>> line 190, in handle
>>> for obj in objects:
>>>   File "/home/menusadmin/.pythonbrew/**pythons/Python-2.7.3/lib/**
>>> python2.7/site-packages/**django/core/serializers/**pyyaml.py", line 
>>> 62, in Deserializer
>>> raise DeserializationError(e)
>>> DeserializationError: maximum recursion depth exceeded while calling a 
>>> Python object
>>>
>>> I tried changing commit to False in loaddata.py, I tried adding a 
>>> manager class to the one model I have that another model refers to with a 
>>> natural key (e.g., 'name,' a CharField, as opposed to the primary key). I 
>>> read something about loaddata having some unicode-related problems, so I 
>>> added custom Manager classes for all my models that coerce appropriate 
>>> fields to strings, e.g.:
>>>
>>> class MenuManager(models.Manager):
>>> def create_Menu(self,restaurant,**year,location,status,pk,**
>>> period,language):
>>> menu = self.create(restaurant=str(**restaurant),year=int(year),**
>>> location=str(location),status=**str(status),pk=int(pk),period=**
>>> str(period),language=str(**language))
>>>  return menu
>>>
>>> I'm still getting the exact same error. Help?
>>>
>>  
>> Then the next thing I'd do is to test the yml data itself, separate from 
>> Django to make sure that the data is not corrupted in any way. Run a script 
>> like this, if it passes, then you probably have some sort of error in your 
>> models that is recursive.
>>
>> *#!/usr/bin/env python*
>> *
>> *
>> *import yaml*
>> *
>> *
>> *stream = open("test.yml", "r")*
>> *print yaml.load(stream)*
>>
>>
>> Finally, I'd run
>>
>> *./manage.py validate*
>>
>>
>> to make sure that all of your models are valid.
>>
>>  
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msg/django-users/-/WoMoRX8i3DsJ.
>>
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to 
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at 
>> http://groups.google.com/group/django-users?hl=en.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/f9YJ8yh-F0IJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: loaddata deserializationerror: maximum recursion depth exceeded while calling a Python object

2012-12-30 Thread Sam Raker
I just tried both of those things, and the YAML data loaded fine, and
validate said I had 0 errors.

Any other suggestions? I'm really stumped here.

On Sun, Dec 30, 2012 at 3:35 PM, donarb <don...@nwlink.com> wrote:

>
>
> On Sunday, December 30, 2012 11:58:46 AM UTC-8, Sam Raker wrote:
>>
>> So I upped the verbosity like you said, and basically all it got me was a
>> bunch of text telling me all the places Django didn't find my fixture
>> before it finally did, and then the same error. Here's the full text of the
>> error:
>>
>> Traceback (most recent call last):
>>   File "/home/menusadmin/.pythonbrew/**pythons/Python-2.7.3/lib/**
>> python2.7/site-packages/**django/core/management/**commands/loaddata.py",
>> line 190, in handle
>> for obj in objects:
>>   File "/home/menusadmin/.pythonbrew/**pythons/Python-2.7.3/lib/**
>> python2.7/site-packages/**django/core/serializers/**pyyaml.py", line 62,
>> in Deserializer
>> raise DeserializationError(e)
>> DeserializationError: maximum recursion depth exceeded while calling a
>> Python object
>>
>> I tried changing commit to False in loaddata.py, I tried adding a manager
>> class to the one model I have that another model refers to with a natural
>> key (e.g., 'name,' a CharField, as opposed to the primary key). I read
>> something about loaddata having some unicode-related problems, so I added
>> custom Manager classes for all my models that coerce appropriate fields to
>> strings, e.g.:
>>
>> class MenuManager(models.Manager):
>> def create_Menu(self,restaurant,**year,location,status,pk,**
>> period,language):
>> menu = self.create(restaurant=str(**restaurant),year=int(year),**
>> location=str(location),status=**str(status),pk=int(pk),period=**
>> str(period),language=str(**language))
>>  return menu
>>
>> I'm still getting the exact same error. Help?
>>
>
> Then the next thing I'd do is to test the yml data itself, separate from
> Django to make sure that the data is not corrupted in any way. Run a script
> like this, if it passes, then you probably have some sort of error in your
> models that is recursive.
>
> *#!/usr/bin/env python*
> *
> *
> *import yaml*
> *
> *
> *stream = open("test.yml", "r")*
> *print yaml.load(stream)*
>
>
> Finally, I'd run
>
> *./manage.py validate*
>
>
> to make sure that all of your models are valid.
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/WoMoRX8i3DsJ.
>
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: loaddata deserializationerror: maximum recursion depth exceeded while calling a Python object

2012-12-30 Thread donarb


On Sunday, December 30, 2012 11:58:46 AM UTC-8, Sam Raker wrote:
>
> So I upped the verbosity like you said, and basically all it got me was a 
> bunch of text telling me all the places Django didn't find my fixture 
> before it finally did, and then the same error. Here's the full text of the 
> error:
>
> Traceback (most recent call last):
>   File 
> "/home/menusadmin/.pythonbrew/pythons/Python-2.7.3/lib/python2.7/site-packages/django/core/management/commands/loaddata.py",
>  
> line 190, in handle
> for obj in objects:
>   File 
> "/home/menusadmin/.pythonbrew/pythons/Python-2.7.3/lib/python2.7/site-packages/django/core/serializers/pyyaml.py",
>  
> line 62, in Deserializer
> raise DeserializationError(e)
> DeserializationError: maximum recursion depth exceeded while calling a 
> Python object
>
> I tried changing commit to False in loaddata.py, I tried adding a manager 
> class to the one model I have that another model refers to with a natural 
> key (e.g., 'name,' a CharField, as opposed to the primary key). I read 
> something about loaddata having some unicode-related problems, so I added 
> custom Manager classes for all my models that coerce appropriate fields to 
> strings, e.g.:
>
> class MenuManager(models.Manager):
> def create_Menu(self,restaurant,year,location,status,pk,period,language):
> menu = 
> self.create(restaurant=str(restaurant),year=int(year),location=str(location),status=str(status),pk=int(pk),period=str(period),language=str(language))
>  return menu
>
> I'm still getting the exact same error. Help?
>
 
Then the next thing I'd do is to test the yml data itself, separate from 
Django to make sure that the data is not corrupted in any way. Run a script 
like this, if it passes, then you probably have some sort of error in your 
models that is recursive.

*#!/usr/bin/env python*
*
*
*import yaml*
*
*
*stream = open("test.yml", "r")*
*print yaml.load(stream)*


Finally, I'd run

*./manage.py validate*


to make sure that all of your models are valid.

 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/WoMoRX8i3DsJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: loaddata deserializationerror: maximum recursion depth exceeded while calling a Python object

2012-12-30 Thread Sam Raker
So I upped the verbosity like you said, and basically all it got me was a
bunch of text telling me all the places Django didn't find my fixture
before it finally did, and then the same error. Here's the full text of the
error:

Traceback (most recent call last):
  File
"/home/menusadmin/.pythonbrew/pythons/Python-2.7.3/lib/python2.7/site-packages/django/core/management/commands/loaddata.py",
line 190, in handle
for obj in objects:
  File
"/home/menusadmin/.pythonbrew/pythons/Python-2.7.3/lib/python2.7/site-packages/django/core/serializers/pyyaml.py",
line 62, in Deserializer
raise DeserializationError(e)
DeserializationError: maximum recursion depth exceeded while calling a
Python object

I tried changing commit to False in loaddata.py, I tried adding a manager
class to the one model I have that another model refers to with a natural
key (e.g., 'name,' a CharField, as opposed to the primary key). I read
something about loaddata having some unicode-related problems, so I added
custom Manager classes for all my models that coerce appropriate fields to
strings, e.g.:

class MenuManager(models.Manager):
def create_Menu(self,restaurant,year,location,status,pk,period,language):
menu =
self.create(restaurant=str(restaurant),year=int(year),location=str(location),status=str(status),pk=int(pk),period=str(period),language=str(language))
return menu

I'm still getting the exact same error. Help?
On Sun, Dec 30, 2012 at 1:28 PM, donarb <don...@nwlink.com> wrote:

> On Sunday, December 30, 2012 9:54:45 AM UTC-8, Sam Raker wrote:
>>
>> Thanks for your suggestions.
>>
>> I eliminated the underscores and got rid of the __unicode__ methods
>> entirely, cleaned up my except statement, and changed the order of stuff
>> such that all of each model's fields are defined before any methods. (As
>> for the pk field: The csvs I'm using are actually dumps from another
>> database, so everything has its own primary key already, and I realized
>> it's way easier to just leave them alone rather than waste the processing
>> time and memory reconnecting everything via Python.)
>>
>> I'm still having the same problem. I don't think it's related to the
>> length of the files or something in simplejson, as even a dozen-line yaml
>> file gives me the same exception when I try to load it with loaddata.
>>
>> Any more ideas?
>>
>
>
> Next, I would post the stack trace, there's probably something in there
> that points to the problem, if the yaml parser thinks there is recursion in
> the data. And up the verbosity when running the loaddata command:
>
> --verbosity 3
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/pq_mI5E031EJ.
>
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: loaddata deserializationerror: maximum recursion depth exceeded while calling a Python object

2012-12-30 Thread donarb
On Sunday, December 30, 2012 9:54:45 AM UTC-8, Sam Raker wrote:
>
> Thanks for your suggestions.
>
> I eliminated the underscores and got rid of the __unicode__ methods 
> entirely, cleaned up my except statement, and changed the order of stuff 
> such that all of each model's fields are defined before any methods. (As 
> for the pk field: The csvs I'm using are actually dumps from another 
> database, so everything has its own primary key already, and I realized 
> it's way easier to just leave them alone rather than waste the processing 
> time and memory reconnecting everything via Python.) 
>
> I'm still having the same problem. I don't think it's related to the 
> length of the files or something in simplejson, as even a dozen-line yaml 
> file gives me the same exception when I try to load it with loaddata. 
>
> Any more ideas?
>

 
Next, I would post the stack trace, there's probably something in there 
that points to the problem, if the yaml parser thinks there is recursion in 
the data. And up the verbosity when running the loaddata command:

--verbosity 3

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/pq_mI5E031EJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: loaddata deserializationerror: maximum recursion depth exceeded while calling a Python object

2012-12-30 Thread Sam Raker
Thanks for your suggestions.

I eliminated the underscores and got rid of the __unicode__ methods
entirely, cleaned up my except statement, and changed the order of stuff
such that all of each model's fields are defined before any methods. (As
for the pk field: The csvs I'm using are actually dumps from another
database, so everything has its own primary key already, and I realized
it's way easier to just leave them alone rather than waste the processing
time and memory reconnecting everything via Python.)

I'm still having the same problem. I don't think it's related to the length
of the files or something in simplejson, as even a dozen-line yaml file
gives me the same exception when I try to load it with loaddata.

Any more ideas?

On Sun, Dec 30, 2012 at 12:18 PM, Amirouche wrote:

>
>
> On Saturday, December 29, 2012 9:42:50 PM UTC+1, Sam Raker wrote:
>>
>> Here's the truncated version I tried to load in case the problem was the
>> length of the file:
>> - fields: {location: ST. DENNIS HOTEL, restaurant: Veterans American
>> Guard, status: complete,
>> year: 1900}
>>   model: dishes.menu
>>   pk: 12495
>> - fields: {location: BOSTON, restaurant: New England Shorthand Reporter's
>> Association,
>> status: complete, year: 1900}
>>   model: dishes.menu
>>   pk: 12563
>> - fields: {location: RMS LUCANIA, restaurant: Cunard Line, status: under
>> review, year: 1900}
>>   model: dishes.menu
>>   pk: 12749
>> - fields: {location: IROQUOIS, restaurant: Alumni Association
>> University Of Buffalo,
>> status: complete, year: 1900}
>>   model: dishes.menu
>>   pk: 12826
>> - fields: {location: '[CHICAGO', restaurant: Chicago Bar Association,
>> status: complete,
>> year: 1900}
>>   model: dishes.menu
>>   pk: 12836
>> - fields: {location: NEW YORK, restaurant: Hotel Marlborough, status:
>> under review,
>> year: 1900}
>>   model: dishes.menu
>>   pk: 12841
>> - fields: {location: NEW YORK, restaurant: Hotel Marlborough, status:
>> complete, year: 1900}
>>   model: dishes.menu
>>   pk: 12960
>> - fields: {location: HOTEL MARLBOROUGH, restaurant: District No.3
>> Catholic Benevolent
>>   Legion, status: under review, year: 1900}
>>   model: dishes.menu
>>   pk: 13076
>> - fields: {location: 9 & 10 BATTERY PL. NY, restaurant: Castle Garden
>> Hotel, status: complete,
>> year: 1900}
>>   model: dishes.menu
>>   pk: 13117
>>
>> Here's the model:
>> class Menu(models.Model):
>> restaurant=models.TextField(**unique=False)
>> year=models.IntegerField(**unique=False,null=True)
>> location=models.TextField(**unique=False)
>> status=models.CharField(**unique=False,max_length=20)
>> pk=models.IntegerField(**primary_key=True)
>> def __unicode__(self):
>> return restaurant
>> def __period__(self):#adapted from http://stackoverflow.com/**
>> questions/2272149/round-to-**5or-other-number-in-python
>> try:
>> p=int(10*round(float(self.**year)/10))
>> if p < self.year:
>> return "%s-%s"%(p,p+5)
>> else:
>> return "%s-%s"%(p-5,p)
>> except:
>> return ""
>> period=property(__period__)
>> language = models.CharField(unique=False,**max_length=30)
>>
>>
> Some recommandations:
>
> - I never defined __XYZ__ except to look elite ;)
> - how «return restaurant» in __unicode__ can possibly work ?
> - unique default value = False, no need to repeat it if is not something
> else
> - according to Django codings standards you should not inter-mix model
> fields with plain properties or methods
> - pk=models.IntegerField(**primary_key=True) What is it useful for ?
> - according to pep8 «except:» should never be used instead use the «except
> MyException» or «except MyException, e» this prevents bugs [2]
>
>> I've got a very tight deadline, and I'm encountering a very frustrating
>>> problem. Every time I try to use loaddata to load my data into my database,
>>> I get the loaddata error in the subject. I've tried YAML, I've tried JSON,
>>> I've tried excerpting only a few lines of each, all to no avail. I'm really
>>> at my rope's end. I don't think my models are flawed in any significant
>>> way--each refers to only one field in one other model (the primary key in
>>> four out of five of them).
>>>
>>> How big is the json file ? Which library do you use ? If you use
> simplejson it's probably that see:
> https://github.com/simplejson/simplejson/issues/28 This relates to a
> hierarchical data structure where your datastructure at least the one you
> pasted is not, I already had troubles with big JSON files and simplejson, I
> have no metrics sorry.
>
> Can you use SQL ? Maybe you will need to consider spliting the json file
> into several file.
>
> Regards,
>
> Amirouche
>
> [1]
> https://docs.djangoproject.com/en/dev/internals/contributing/writing-code/coding-style/#model-style
> [2] http://peps.io/8/#programming-recommendations
>
> --
> You received this message because you are subscribed to the Google 

Re: loaddata deserializationerror: maximum recursion depth exceeded while calling a Python object

2012-12-30 Thread Amirouche


On Saturday, December 29, 2012 9:42:50 PM UTC+1, Sam Raker wrote:
>
> Here's the truncated version I tried to load in case the problem was the 
> length of the file:
> - fields: {location: ST. DENNIS HOTEL, restaurant: Veterans American 
> Guard, status: complete,
> year: 1900}
>   model: dishes.menu
>   pk: 12495
> - fields: {location: BOSTON, restaurant: New England Shorthand Reporter's 
> Association,
> status: complete, year: 1900}
>   model: dishes.menu
>   pk: 12563
> - fields: {location: RMS LUCANIA, restaurant: Cunard Line, status: under 
> review, year: 1900}
>   model: dishes.menu
>   pk: 12749
> - fields: {location: IROQUOIS, restaurant: Alumni Association   University 
> Of Buffalo,
> status: complete, year: 1900}
>   model: dishes.menu
>   pk: 12826
> - fields: {location: '[CHICAGO', restaurant: Chicago Bar Association, 
> status: complete,
> year: 1900}
>   model: dishes.menu
>   pk: 12836
> - fields: {location: NEW YORK, restaurant: Hotel Marlborough, status: 
> under review,
> year: 1900}
>   model: dishes.menu
>   pk: 12841
> - fields: {location: NEW YORK, restaurant: Hotel Marlborough, status: 
> complete, year: 1900}
>   model: dishes.menu
>   pk: 12960
> - fields: {location: HOTEL MARLBOROUGH, restaurant: District No.3 Catholic 
> Benevolent
>   Legion, status: under review, year: 1900}
>   model: dishes.menu
>   pk: 13076
> - fields: {location: 9 & 10 BATTERY PL. NY, restaurant: Castle Garden 
> Hotel, status: complete,
> year: 1900}
>   model: dishes.menu
>   pk: 13117
>
> Here's the model:
> class Menu(models.Model):
> restaurant=models.TextField(unique=False)
> year=models.IntegerField(unique=False,null=True)
> location=models.TextField(unique=False)
> status=models.CharField(unique=False,max_length=20)
> pk=models.IntegerField(primary_key=True)
> def __unicode__(self):
> return restaurant
> def __period__(self):#adapted from 
> http://stackoverflow.com/questions/2272149/round-to-5or-other-number-in-python
> try:
> p=int(10*round(float(self.year)/10))
> if p < self.year:
> return "%s-%s"%(p,p+5)
> else:
> return "%s-%s"%(p-5,p)
> except:
> return ""
> period=property(__period__) 
> language = models.CharField(unique=False,max_length=30)
>
>
Some recommandations:

- I never defined __XYZ__ except to look elite ;)
- how «return restaurant» in __unicode__ can possibly work ?
- unique default value = False, no need to repeat it if is not something 
else
- according to Django codings standards you should not inter-mix model 
fields with plain properties or methods
- pk=models.IntegerField(primary_key=True) What is it useful for ?
- according to pep8 «except:» should never be used instead use the «except 
MyException» or «except MyException, e» this prevents bugs [2]

> I've got a very tight deadline, and I'm encountering a very frustrating 
>> problem. Every time I try to use loaddata to load my data into my database, 
>> I get the loaddata error in the subject. I've tried YAML, I've tried JSON, 
>> I've tried excerpting only a few lines of each, all to no avail. I'm really 
>> at my rope's end. I don't think my models are flawed in any significant 
>> way--each refers to only one field in one other model (the primary key in 
>> four out of five of them).
>>
>> How big is the json file ? Which library do you use ? If you use 
simplejson it's probably that see: 
https://github.com/simplejson/simplejson/issues/28 This relates to a 
hierarchical data structure where your datastructure at least the one you 
pasted is not, I already had troubles with big JSON files and simplejson, I 
have no metrics sorry.

Can you use SQL ? Maybe you will need to consider spliting the json file 
into several file.

Regards,

Amirouche

[1] 
https://docs.djangoproject.com/en/dev/internals/contributing/writing-code/coding-style/#model-style
[2] http://peps.io/8/#programming-recommendations

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/FCFXKNxtvAIJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: loaddata deserializationerror: maximum recursion depth exceeded while calling a Python object

2012-12-29 Thread donarb
And your __unicode__ method is incorrect as well. You should be returning 
self.restaurant.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/bsJoTGDbveYJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: loaddata deserializationerror: maximum recursion depth exceeded while calling a Python object

2012-12-29 Thread donarb
Not sure if it's related to your problem, but you should never create function 
names like __period__. Names such as those are reserved for Python internals.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/BeMmAD5_nfgJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: loaddata deserializationerror: maximum recursion depth exceeded while calling a Python object

2012-12-29 Thread Sam Raker
Here's the truncated version I tried to load in case the problem was the 
length of the file:
- fields: {location: ST. DENNIS HOTEL, restaurant: Veterans American Guard, 
status: complete,
year: 1900}
  model: dishes.menu
  pk: 12495
- fields: {location: BOSTON, restaurant: New England Shorthand Reporter's 
Association,
status: complete, year: 1900}
  model: dishes.menu
  pk: 12563
- fields: {location: RMS LUCANIA, restaurant: Cunard Line, status: under 
review, year: 1900}
  model: dishes.menu
  pk: 12749
- fields: {location: IROQUOIS, restaurant: Alumni Association   University 
Of Buffalo,
status: complete, year: 1900}
  model: dishes.menu
  pk: 12826
- fields: {location: '[CHICAGO', restaurant: Chicago Bar Association, 
status: complete,
year: 1900}
  model: dishes.menu
  pk: 12836
- fields: {location: NEW YORK, restaurant: Hotel Marlborough, status: under 
review,
year: 1900}
  model: dishes.menu
  pk: 12841
- fields: {location: NEW YORK, restaurant: Hotel Marlborough, status: 
complete, year: 1900}
  model: dishes.menu
  pk: 12960
- fields: {location: HOTEL MARLBOROUGH, restaurant: District No.3 Catholic 
Benevolent
  Legion, status: under review, year: 1900}
  model: dishes.menu
  pk: 13076
- fields: {location: 9 & 10 BATTERY PL. NY, restaurant: Castle Garden 
Hotel, status: complete,
year: 1900}
  model: dishes.menu
  pk: 13117

Here's the model:
class Menu(models.Model):
restaurant=models.TextField(unique=False)
year=models.IntegerField(unique=False,null=True)
location=models.TextField(unique=False)
status=models.CharField(unique=False,max_length=20)
pk=models.IntegerField(primary_key=True)
def __unicode__(self):
return restaurant
def __period__(self):#adapted from 
http://stackoverflow.com/questions/2272149/round-to-5or-other-number-in-python
try:
p=int(10*round(float(self.year)/10))
if p < self.year:
return "%s-%s"%(p,p+5)
else:
return "%s-%s"%(p-5,p)
except:
return ""
period=property(__period__) 
language = models.CharField(unique=False,max_length=30)

I'd really appreciate any help on this.

On Saturday, December 29, 2012 3:28:34 PM UTC-5, Ryan Blunden wrote:
>
> Can you provide a single example of one of the fixture objects you're 
> trying to import, as well as the model it corresponds to?
>
> On 29/12/2012, at 11:34 AM, Sam Raker  
> wrote:
>
> Hello,
> I've got a very tight deadline, and I'm encountering a very frustrating 
> problem. Every time I try to use loaddata to load my data into my database, 
> I get the loaddata error in the subject. I've tried YAML, I've tried JSON, 
> I've tried excerpting only a few lines of each, all to no avail. I'm really 
> at my rope's end. I don't think my models are flawed in any significant 
> way--each refers to only one field in one other model (the primary key in 
> four out of five of them). 
>
> I need to get this working by the 2nd, and I've looked all over the 
> internet and posted a question at Stackoverflow and still can't figure it 
> out. I really need some help.
>
> Thanks,
> -sam
>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To view this discussion on the web visit 
> https://groups.google.com/d/msg/django-users/-/WLBxL9nsC1IJ.
> To post to this group, send email to django...@googlegroups.com
> .
> To unsubscribe from this group, send email to 
> django-users...@googlegroups.com .
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/fI4rtItIhGIJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: loaddata deserializationerror: maximum recursion depth exceeded while calling a Python object

2012-12-29 Thread Ryan Blunden
Can you provide a single example of one of the fixture objects you're trying to 
import, as well as the model it corresponds to?

On 29/12/2012, at 11:34 AM, Sam Raker  wrote:

> Hello,
> I've got a very tight deadline, and I'm encountering a very frustrating 
> problem. Every time I try to use loaddata to load my data into my database, I 
> get the loaddata error in the subject. I've tried YAML, I've tried JSON, I've 
> tried excerpting only a few lines of each, all to no avail. I'm really at my 
> rope's end. I don't think my models are flawed in any significant way--each 
> refers to only one field in one other model (the primary key in four out of 
> five of them). 
> 
> I need to get this working by the 2nd, and I've looked all over the internet 
> and posted a question at Stackoverflow and still can't figure it out. I 
> really need some help.
> 
> Thanks,
> -sam
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To view this discussion on the web visit 
> https://groups.google.com/d/msg/django-users/-/WLBxL9nsC1IJ.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



loaddata deserializationerror: maximum recursion depth exceeded while calling a Python object

2012-12-29 Thread Sam Raker
Hello,
I've got a very tight deadline, and I'm encountering a very frustrating 
problem. Every time I try to use loaddata to load my data into my database, 
I get the loaddata error in the subject. I've tried YAML, I've tried JSON, 
I've tried excerpting only a few lines of each, all to no avail. I'm really 
at my rope's end. I don't think my models are flawed in any significant 
way--each refers to only one field in one other model (the primary key in 
four out of five of them). 

I need to get this working by the 2nd, and I've looked all over the 
internet and posted a question at Stackoverflow and still can't figure it 
out. I really need some help.

Thanks,
-sam

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/WLBxL9nsC1IJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: making instance of auth User results in: maximum recursion depth exceeded while calling a Python object

2011-06-22 Thread Karen Tracey
No, you're not stupid. The only reason I could guess what the problem was is
I've seen it done many times. Many languages would complain about the
"redefinition"; Python just quietly does what you tell it and re-binds the
name to a new value. That can actually be a very useful feature, but it also
lets you shoot yourself in the foot when it's not really what you intended
to do.

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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: making instance of auth User results in: maximum recursion depth exceeded while calling a Python object

2011-06-22 Thread T'mas
Thank you very much, you helped me out.

I found how stupid I am :). I was calling login() django function from
view function called login().

Next time I will post my code. Thanks for advice

T.

On Jun 22, 1:05 pm, Karen Tracey <kmtra...@gmail.com> wrote:
> On Tue, Jun 21, 2011 at 12:34 PM, T'mas <tomas.deb...@gmail.com> wrote:
> > sorry. Problem is not User object but login from django.contrib.auth.
>
> > login(request,user)
>
> You've haven't included any of the traceback from the maximum recursion
> depth exceeded, nor any of your code, so all anyone can do to help is guess.
> I'd guess you've defined your own login function, inside of which you are
> trying to call the django.contrib.auth login that you presumably imported
> earlier in your code. But since you have subsequently defined your own
> login, that name is now bound to your new function, not djano.contrib.auth
> login. Your function's call to login calls itself, which calls itself, which
> calls itself, etc. until finally Python says enough.
>
> If that's not exactly what is happening then please try examining the
> traceback to see what's happening in the code: it's showing you exactly
> what's getting called from where, and the source of the infinite recursion
> will be evident in that traceback. If it is not, post at least a portion of
> the traceback to give people who might help something to work with.
>
> Karen
> --http://tracey.org/kmt/

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: making instance of auth User results in: maximum recursion depth exceeded while calling a Python object

2011-06-22 Thread Karen Tracey
On Tue, Jun 21, 2011 at 12:34 PM, T'mas <tomas.deb...@gmail.com> wrote:

> sorry. Problem is not User object but login from django.contrib.auth.
>
> login(request,user)
>
>
You've haven't included any of the traceback from the maximum recursion
depth exceeded, nor any of your code, so all anyone can do to help is guess.
I'd guess you've defined your own login function, inside of which you are
trying to call the django.contrib.auth login that you presumably imported
earlier in your code. But since you have subsequently defined your own
login, that name is now bound to your new function, not djano.contrib.auth
login. Your function's call to login calls itself, which calls itself, which
calls itself, etc. until finally Python says enough.

If that's not exactly what is happening then please try examining the
traceback to see what's happening in the code: it's showing you exactly
what's getting called from where, and the source of the infinite recursion
will be evident in that traceback. If it is not, post at least a portion of
the traceback to give people who might help something to work with.

Karen
-- 
http://tracey.org/kmt/

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: making instance of auth User results in: maximum recursion depth exceeded while calling a Python object

2011-06-21 Thread T'mas
sorry. Problem is not User object but login from django.contrib.auth.

login(request,user)

On Jun 21, 6:21 pm, "T'mas" <tomas.deb...@gmail.com> wrote:
> Hi there,
>
> I am having problem with User model from django.contrib.auth.models.
> When making instance in view:
>
> user = User.objects.get(username='tmas')
>
> it results in error: maximum recursion depth exceeded while calling a
> Python object
>
> I am running Xubuntu 11.04, python 2.7.1+ and django 1.3.
> Running it on development server, didn't use on apache.
>
> regards,
>
> Tomas Debnar

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



making instance of auth User results in: maximum recursion depth exceeded while calling a Python object

2011-06-21 Thread T'mas
Hi there,

I am having problem with User model from django.contrib.auth.models.
When making instance in view:

user = User.objects.get(username='tmas')

it results in error: maximum recursion depth exceeded while calling a
Python object

I am running Xubuntu 11.04, python 2.7.1+ and django 1.3.
Running it on development server, didn't use on apache.


regards,

Tomas Debnar

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Runtime Error: maximum recursion depth exceeded while calling Python object

2011-01-24 Thread Derek
Just for the record.  This issue was not solved; appears to be
happening on a SUSE Linux Enterprise Server.  Does not happen on an
Ubuntu server (which I have switched to).  There might be some issue
with the particular version of Python that was installed on it.

On 13 January 2011 13:44, Derek <gamesb...@gmail.com> wrote:
>
> I have now installed Apache + mod_wsgi locally and run the app.  I do not get 
> the recursion error that is happening on the server.  I'd welcome any 
> suggestions as to how to go about solving this.
>
> Thanks
> Derek
>
>
> On 13 January 2011 08:48, Derek <gamesb...@gmail.com> wrote:
>>
>> Still not working, but I suspect a recent upgrade to Django 1.2.4
>> might be the cause.
>>
>> Does anyone know (or have experience) of this kind of error when
>> upgrading?
>>
>> On Jan 12, 9:38 am, Derek <gamesb...@gmail.com> wrote:
>> > Working with Django 1.2.3
>> >
>> > I had an application that was running well.  However, some recent changes
>> > (not to the models themselves) have caused the "Runtime Error: maximum
>> > recursion depth exceeded while calling Python object" to start showing up
>> > everywhere; typically in conjunction with the def __unicode__(self)
>> > function.  The only major change I have made recently to the system is the
>> > enabling of flatpages, but i cannot see that this is likely to relate to 
>> > the
>> > model's __unicode__ functions...
>> >
>> > I realize that this is a very "sloppy" error report, but I am wondering if
>> > anyone else has encountered this type of problem (code for models working
>> > and then suddenly generating numbers of the same type of error) and can 
>> > give
>> > some general pointers on how to solve this (short of ripping out all the
>> > recent changes)?
>> >
>> > Thanks
>> > Derek
>>
>> --
>> 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 
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at 
>> http://groups.google.com/group/django-users?hl=en.
>>
>

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Runtime Error: maximum recursion depth exceeded while calling Python object

2011-01-13 Thread Derek
I have now installed Apache + mod_wsgi locally and run the app.  I do not
get the recursion error that is happening on the server.  I'd welcome any
suggestions as to how to go about solving this.

Thanks
Derek


On 13 January 2011 08:48, Derek <gamesb...@gmail.com> wrote:

> Still not working, but I suspect a recent upgrade to Django 1.2.4
> might be the cause.
>
> Does anyone know (or have experience) of this kind of error when
> upgrading?
>
> On Jan 12, 9:38 am, Derek <gamesb...@gmail.com> wrote:
> > Working with Django 1.2.3
> >
> > I had an application that was running well.  However, some recent changes
> > (not to the models themselves) have caused the "Runtime Error: maximum
> > recursion depth exceeded while calling Python object" to start showing up
> > everywhere; typically in conjunction with the def __unicode__(self)
> > function.  The only major change I have made recently to the system is
> the
> > enabling of flatpages, but i cannot see that this is likely to relate to
> the
> > model's __unicode__ functions...
> >
> > I realize that this is a very "sloppy" error report, but I am wondering
> if
> > anyone else has encountered this type of problem (code for models working
> > and then suddenly generating numbers of the same type of error) and can
> give
> > some general pointers on how to solve this (short of ripping out all the
> > recent changes)?
> >
> > Thanks
> > Derek
>
> --
> 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
> django-users+unsubscr...@googlegroups.com<django-users%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Runtime Error: maximum recursion depth exceeded while calling Python object

2011-01-12 Thread Derek
Still not working, but I suspect a recent upgrade to Django 1.2.4
might be the cause.

Does anyone know (or have experience) of this kind of error when
upgrading?

On Jan 12, 9:38 am, Derek <gamesb...@gmail.com> wrote:
> Working with Django 1.2.3
>
> I had an application that was running well.  However, some recent changes
> (not to the models themselves) have caused the "Runtime Error: maximum
> recursion depth exceeded while calling Python object" to start showing up
> everywhere; typically in conjunction with the def __unicode__(self)
> function.  The only major change I have made recently to the system is the
> enabling of flatpages, but i cannot see that this is likely to relate to the
> model's __unicode__ functions...
>
> I realize that this is a very "sloppy" error report, but I am wondering if
> anyone else has encountered this type of problem (code for models working
> and then suddenly generating numbers of the same type of error) and can give
> some general pointers on how to solve this (short of ripping out all the
> recent changes)?
>
> Thanks
> Derek

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Runtime Error: maximum recursion depth exceeded while calling Python object

2011-01-11 Thread Derek
Working with Django 1.2.3

I had an application that was running well.  However, some recent changes
(not to the models themselves) have caused the "Runtime Error: maximum
recursion depth exceeded while calling Python object" to start showing up
everywhere; typically in conjunction with the def __unicode__(self)
function.  The only major change I have made recently to the system is the
enabling of flatpages, but i cannot see that this is likely to relate to the
model's __unicode__ functions...

I realize that this is a very "sloppy" error report, but I am wondering if
anyone else has encountered this type of problem (code for models working
and then suddenly generating numbers of the same type of error) and can give
some general pointers on how to solve this (short of ripping out all the
recent changes)?

Thanks
Derek

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: overriding change_list.html causes 'maximum recursion depth exceeded' exception

2009-05-14 Thread Margie

Thanks for confirming it Nick.  I saw it also on 1.0.2. I went ahead
and created a ticket, it's ticket 5.

Margie

On May 13, 1:32 pm, NickPresta <nick1pre...@gmail.com> wrote:
> I can confirm this happens with 1.0.2 Final.
>
> On May 7, 2:44 pm, Margie <margierogin...@yahoo.com> wrote:
>
> > I am trying to override the admin sites' change_list.html, following
> > the example at:
>
> >http://docs.djangoproject.com/en/dev/ref/contrib/admin/#overriding-ad...
>
> > If I create templates/admin/myapp/change_list.html and just put this
> > in it (and nothing else):
>
> > {% extends "admin/change_list.html" %}
>
> > I get
>
> > Request Method:         GET
> > Request URL:    http://172.16.84.5:8042/admin/taskmanager/task/
> > Exception Type:         TemplateSyntaxError
> > Exception Value:
>
> > Caught an exception while rendering: maximum recursion depth exceeded
> > in cmp
>
> > Original Traceback (most recent call last):
> >   File "/tools/aticad/1.0/external/python-2.5.1/lib/python2.5/site-
> > packages/django/template/debug.py", line 71, in render_node
> >     result = node.render(context)
> >   File "/tools/aticad/1.0/external/python-2.5.1/lib/python2.5/site-
> > packages/django/template/loader_tags.py", line 71, in render
> >     compiled_parent = self.get_parent(context)
> >   File "/tools/aticad/1.0/external/python-2.5.1/lib/python2.5/site-
> > packages/django/template/loader_tags.py", line 64, in get_parent
> >     source, origin = find_template_source(parent, self.template_dirs)
> >   File "/tools/aticad/1.0/external/python-2.5.1/lib/python2.5/site-
> > packages/django/template/loader.py", line 70, in find_template_source
> >     source, display_name = loader(name, dirs)
> >   File "/tools/aticad/1.0/external/python-2.5.1/lib/python2.5/site-
> > packages/django/template/loaders/filesystem.py", line 31, in
> > load_template_source
> >     for filepath in get_template_sources(template_name,
> > template_dirs):
> >   File "/tools/aticad/1.0/external/python-2.5.1/lib/python2.5/site-
> > packages/django/template/loaders/filesystem.py", line 16, in
> > get_template_sources
> >     template_dirs = settings.TEMPLATE_DIRS
> >   File "/tools/aticad/1.0/external/python-2.5.1/lib/python2.5/site-
> > packages/django/utils/functional.py", line 270, in __getattr__
> >     if name == "__members__":
> > RuntimeError: maximum recursion depth exceeded in cmp
>
> > Exception Location:     /tools/aticad/1.0/external/python-2.5.1/lib/
> > python2.5/site-packages/django/template/debug.py in render_node, line
> > 81
>
> > I'm using the beta:>>> django.VERSION
>
> > (1, 1, 0, 'beta', 1)
>
> > Is this something I should post as a real bug?  If so, could someone
> > point me at the appropriate site for posting a bug?
>
> > Margie
>
>
--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: overriding change_list.html causes 'maximum recursion depth exceeded' exception

2009-05-13 Thread NickPresta

I can confirm this happens with 1.0.2 Final.

On May 7, 2:44 pm, Margie <margierogin...@yahoo.com> wrote:
> I am trying to override the admin sites' change_list.html, following
> the example at:
>
> http://docs.djangoproject.com/en/dev/ref/contrib/admin/#overriding-ad...
>
> If I create templates/admin/myapp/change_list.html and just put this
> in it (and nothing else):
>
> {% extends "admin/change_list.html" %}
>
> I get
>
> Request Method:         GET
> Request URL:    http://172.16.84.5:8042/admin/taskmanager/task/
> Exception Type:         TemplateSyntaxError
> Exception Value:
>
> Caught an exception while rendering: maximum recursion depth exceeded
> in cmp
>
> Original Traceback (most recent call last):
>   File "/tools/aticad/1.0/external/python-2.5.1/lib/python2.5/site-
> packages/django/template/debug.py", line 71, in render_node
>     result = node.render(context)
>   File "/tools/aticad/1.0/external/python-2.5.1/lib/python2.5/site-
> packages/django/template/loader_tags.py", line 71, in render
>     compiled_parent = self.get_parent(context)
>   File "/tools/aticad/1.0/external/python-2.5.1/lib/python2.5/site-
> packages/django/template/loader_tags.py", line 64, in get_parent
>     source, origin = find_template_source(parent, self.template_dirs)
>   File "/tools/aticad/1.0/external/python-2.5.1/lib/python2.5/site-
> packages/django/template/loader.py", line 70, in find_template_source
>     source, display_name = loader(name, dirs)
>   File "/tools/aticad/1.0/external/python-2.5.1/lib/python2.5/site-
> packages/django/template/loaders/filesystem.py", line 31, in
> load_template_source
>     for filepath in get_template_sources(template_name,
> template_dirs):
>   File "/tools/aticad/1.0/external/python-2.5.1/lib/python2.5/site-
> packages/django/template/loaders/filesystem.py", line 16, in
> get_template_sources
>     template_dirs = settings.TEMPLATE_DIRS
>   File "/tools/aticad/1.0/external/python-2.5.1/lib/python2.5/site-
> packages/django/utils/functional.py", line 270, in __getattr__
>     if name == "__members__":
> RuntimeError: maximum recursion depth exceeded in cmp
>
> Exception Location:     /tools/aticad/1.0/external/python-2.5.1/lib/
> python2.5/site-packages/django/template/debug.py in render_node, line
> 81
>
> I'm using the beta:>>> django.VERSION
>
> (1, 1, 0, 'beta', 1)
>
> Is this something I should post as a real bug?  If so, could someone
> point me at the appropriate site for posting a bug?
>
> Margie
--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



overriding change_list.html causes 'maximum recursion depth exceeded' exception

2009-05-07 Thread Margie

I am trying to override the admin sites' change_list.html, following
the example at:

http://docs.djangoproject.com/en/dev/ref/contrib/admin/#overriding-admin-templates

If I create templates/admin/myapp/change_list.html and just put this
in it (and nothing else):

{% extends "admin/change_list.html" %}

I get

Request Method: GET
Request URL:http://172.16.84.5:8042/admin/taskmanager/task/
Exception Type: TemplateSyntaxError
Exception Value:

Caught an exception while rendering: maximum recursion depth exceeded
in cmp

Original Traceback (most recent call last):
  File "/tools/aticad/1.0/external/python-2.5.1/lib/python2.5/site-
packages/django/template/debug.py", line 71, in render_node
result = node.render(context)
  File "/tools/aticad/1.0/external/python-2.5.1/lib/python2.5/site-
packages/django/template/loader_tags.py", line 71, in render
compiled_parent = self.get_parent(context)
  File "/tools/aticad/1.0/external/python-2.5.1/lib/python2.5/site-
packages/django/template/loader_tags.py", line 64, in get_parent
source, origin = find_template_source(parent, self.template_dirs)
  File "/tools/aticad/1.0/external/python-2.5.1/lib/python2.5/site-
packages/django/template/loader.py", line 70, in find_template_source
source, display_name = loader(name, dirs)
  File "/tools/aticad/1.0/external/python-2.5.1/lib/python2.5/site-
packages/django/template/loaders/filesystem.py", line 31, in
load_template_source
for filepath in get_template_sources(template_name,
template_dirs):
  File "/tools/aticad/1.0/external/python-2.5.1/lib/python2.5/site-
packages/django/template/loaders/filesystem.py", line 16, in
get_template_sources
template_dirs = settings.TEMPLATE_DIRS
  File "/tools/aticad/1.0/external/python-2.5.1/lib/python2.5/site-
packages/django/utils/functional.py", line 270, in __getattr__
if name == "__members__":
RuntimeError: maximum recursion depth exceeded in cmp

Exception Location: /tools/aticad/1.0/external/python-2.5.1/lib/
python2.5/site-packages/django/template/debug.py in render_node, line
81

I'm using the beta:
>>> django.VERSION
(1, 1, 0, 'beta', 1)

Is this something I should post as a real bug?  If so, could someone
point me at the appropriate site for posting a bug?

Margie
--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Nosetests. maximum recursion depth exceeded

2009-02-03 Thread Oleg Oltar
Well seems I found the solution. I just moved the project folder in my repo
(so now we have repo->myproject), so the name myproject will not change
after cloning, and now it all works

Any idea why?

On Tue, Feb 3, 2009 at 9:05 PM, Oleg Oltar <oltarase...@gmail.com> wrote:

> Seems no :(
> I tried to manually specify correct path
> os.environ['DJANGO_SETTINGS_MODULE'] = 'db_settings.settings'
> but have same issue :(
>
> (NOTE, i didn't create it with startpoject command, I just cloned project
> from repo. May it help to understand the issue?)
>
>
> On Tue, Feb 3, 2009 at 8:59 PM, Oleg Oltar <oltarase...@gmail.com> wrote:
>
>> Why it worked before I tried to change settings.py? Why actually site
>> works?
>> Maybe something is in my tests?
>>
>> Btw, my code organized this way:
>>
>> /proj
>>urls.py
>>settings
>>   ./app
>>   tests.py
>>   urls.py
>>
>>
>> As I changed the project name I also hacked the tests file so now it
>> contains following:
>> import os
>> import re
>>
>>
>>
>> os.environ['PYTHNONPATH'] = '$PYTHONPATH:$PWD'
>> os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'  # Is this correct?
>>
>>
>> I presume that the second line is incorrect. Where it looks for the
>> settings?
>>
>> On Tue, Feb 3, 2009 at 7:08 PM, Steve Holden <holden...@gmail.com> wrote:
>>
>>>
>>> Oleg Oltar wrote:
>>> [...]
>>> >
>>> > sub_match = pattern.resolve(new_path)
>>> >   File "/Library/Python/2.5/site-packages/django/core/urlresolvers.py",
>>> > line 181, in resolve
>>> > sub_match = pattern.resolve(new_path)
>>> >   File "/Library/Python/2.5/site-packages/django/core/urlresolvers.py",
>>> > line 181, in resolve
>>> > sub_match = pattern.resolve(new_path)
>>> >   File "/Library/Python/2.5/site-packages/django/core/urlresolvers.py",
>>> > line 179, in resolve
>>> > for pattern in self.urlconf_module.urlpatterns:
>>> > RuntimeError: maximum recursion depth exceeded
>>> >
>>> > (I use: beryl:db_settings oleg$ nosetests --cover-package=loginreg
>>> > --with-coverageto run tests)
>>> >
>>> >
>>> >
>>> > Could anyone suggest why I am getting it?
>>> >
>>> Is something doing a 301 redirection to itself, possibly?
>>>
>>> regards
>>>  Steve
>>> --
>>> Steve Holden+1 571 484 6266   +1 800 494 3119
>>> Holden Web LLC  http://www.holdenweb.com/
>>>
>>> >>>
>>>
>>
>

--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Nosetests. maximum recursion depth exceeded

2009-02-03 Thread Oleg Oltar
Seems no :(
I tried to manually specify correct path
os.environ['DJANGO_SETTINGS_MODULE'] = 'db_settings.settings'
but have same issue :(

(NOTE, i didn't create it with startpoject command, I just cloned project
from repo. May it help to understand the issue?)

On Tue, Feb 3, 2009 at 8:59 PM, Oleg Oltar <oltarase...@gmail.com> wrote:

> Why it worked before I tried to change settings.py? Why actually site
> works?
> Maybe something is in my tests?
>
> Btw, my code organized this way:
>
> /proj
>urls.py
>settings
>   ./app
>   tests.py
>   urls.py
>
>
> As I changed the project name I also hacked the tests file so now it
> contains following:
> import os
> import re
>
>
>
> os.environ['PYTHNONPATH'] = '$PYTHONPATH:$PWD'
> os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'  # Is this correct?
>
>
> I presume that the second line is incorrect. Where it looks for the
> settings?
>
> On Tue, Feb 3, 2009 at 7:08 PM, Steve Holden <holden...@gmail.com> wrote:
>
>>
>> Oleg Oltar wrote:
>> [...]
>> >
>> > sub_match = pattern.resolve(new_path)
>> >   File "/Library/Python/2.5/site-packages/django/core/urlresolvers.py",
>> > line 181, in resolve
>> > sub_match = pattern.resolve(new_path)
>> >   File "/Library/Python/2.5/site-packages/django/core/urlresolvers.py",
>> > line 181, in resolve
>> > sub_match = pattern.resolve(new_path)
>> >   File "/Library/Python/2.5/site-packages/django/core/urlresolvers.py",
>> > line 179, in resolve
>> > for pattern in self.urlconf_module.urlpatterns:
>> > RuntimeError: maximum recursion depth exceeded
>> >
>> > (I use: beryl:db_settings oleg$ nosetests --cover-package=loginreg
>> > --with-coverageto run tests)
>> >
>> >
>> >
>> > Could anyone suggest why I am getting it?
>> >
>> Is something doing a 301 redirection to itself, possibly?
>>
>> regards
>>  Steve
>> --
>> Steve Holden+1 571 484 6266   +1 800 494 3119
>> Holden Web LLC  http://www.holdenweb.com/
>>
>> >>
>>
>

--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Nosetests. maximum recursion depth exceeded

2009-02-03 Thread Oleg Oltar
Why it worked before I tried to change settings.py? Why actually site works?
Maybe something is in my tests?

Btw, my code organized this way:

/proj
   urls.py
   settings
  ./app
  tests.py
  urls.py


As I changed the project name I also hacked the tests file so now it
contains following:
import os
import re



os.environ['PYTHNONPATH'] = '$PYTHONPATH:$PWD'
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'  # Is this correct?


I presume that the second line is incorrect. Where it looks for the
settings?

On Tue, Feb 3, 2009 at 7:08 PM, Steve Holden <holden...@gmail.com> wrote:

>
> Oleg Oltar wrote:
> [...]
> >
> > sub_match = pattern.resolve(new_path)
> >   File "/Library/Python/2.5/site-packages/django/core/urlresolvers.py",
> > line 181, in resolve
> > sub_match = pattern.resolve(new_path)
> >   File "/Library/Python/2.5/site-packages/django/core/urlresolvers.py",
> > line 181, in resolve
> > sub_match = pattern.resolve(new_path)
> >   File "/Library/Python/2.5/site-packages/django/core/urlresolvers.py",
> > line 179, in resolve
> > for pattern in self.urlconf_module.urlpatterns:
> > RuntimeError: maximum recursion depth exceeded
> >
> > (I use: beryl:db_settings oleg$ nosetests --cover-package=loginreg
> > --with-coverageto run tests)
> >
> >
> >
> > Could anyone suggest why I am getting it?
> >
> Is something doing a 301 redirection to itself, possibly?
>
> regards
>  Steve
> --
> Steve Holden+1 571 484 6266   +1 800 494 3119
> Holden Web LLC  http://www.holdenweb.com/
>
> >
>

--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Nosetests. maximum recursion depth exceeded

2009-02-03 Thread Steve Holden

Oleg Oltar wrote:
[...]
> 
> sub_match = pattern.resolve(new_path)
>   File "/Library/Python/2.5/site-packages/django/core/urlresolvers.py",
> line 181, in resolve
> sub_match = pattern.resolve(new_path)
>   File "/Library/Python/2.5/site-packages/django/core/urlresolvers.py",
> line 181, in resolve
> sub_match = pattern.resolve(new_path)
>   File "/Library/Python/2.5/site-packages/django/core/urlresolvers.py",
> line 179, in resolve
> for pattern in self.urlconf_module.urlpatterns:
> RuntimeError: maximum recursion depth exceeded
> 
> (I use: beryl:db_settings oleg$ nosetests --cover-package=loginreg
> --with-coverageto run tests)
> 
> 
> 
> Could anyone suggest why I am getting it?
> 
Is something doing a 301 redirection to itself, possibly?

regards
 Steve
-- 
Steve Holden+1 571 484 6266   +1 800 494 3119
Holden Web LLC  http://www.holdenweb.com/

--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Nosetests. maximum recursion depth exceeded

2009-02-03 Thread Oleg Oltar
Hi!
I am creating one of my firsts django projects. I created nose tests to
cover my application and got 100% code coverage

My repo is git://github.com/oltarasenko/usermanaging.git

Now I am trying to modify my project to make settings be platform
independent. So I added following lines
to my settings.py:

# Django settings for loginregister project.
import os.path
import sys

PROJECT_ROOT = os.path.normpath(os.path.dirname(__file__))

DATABASE_NAME = os.path.join(PROJECT_ROOT, 'users.db')  # Or path to
database file if using sqlite3.

ROOT_URLCONF = 'urls'

TEMPLATE_DIRS = (
# Put strings here, like "/home/html/django_templates" or
"C:/www/django/templates".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
os.path.join(PROJECT_ROOT, 'templates')
)

INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.admin',
'django.contrib.sessions',
'django.contrib.sites',
'loginreg'
)

Now when I run my application everything seems to work! Everything but my
nosetests which returns long trace for me
which contains one line (displayed many times):

sub_match = pattern.resolve(new_path)
  File "/Library/Python/2.5/site-packages/django/core/urlresolvers.py", line
181, in resolve
sub_match = pattern.resolve(new_path)
  File "/Library/Python/2.5/site-packages/django/core/urlresolvers.py", line
181, in resolve
sub_match = pattern.resolve(new_path)
  File "/Library/Python/2.5/site-packages/django/core/urlresolvers.py", line
179, in resolve
for pattern in self.urlconf_module.urlpatterns:
RuntimeError: maximum recursion depth exceeded

(I use: beryl:db_settings oleg$ nosetests --cover-package=loginreg
--with-coverageto run tests)



Could anyone suggest why I am getting it?


Thanks,
Oleg

--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: maximum recursion depth exceeded ???

2008-10-20 Thread Thomas Guettler

kele schrieb:
> i just try to make my first authenticate codes . but while in the
> line
> '  login(request, v) '   , i got this  runtime error  , and
> 'maximum recursion depth exceeded'.
>
> but i do not have any loop there  . why ??? help .
>
>   
you call login() inside login():

> def login(request ,template_name):
>   
...

> login(request, v)
>   

I guess you mean user.login()

HTH,
  Thomas


-- 
Thomas Guettler, http://www.thomas-guettler.de/
E-Mail: guettli (*) thomas-guettler + de


--~--~-~--~~~---~--~~
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: maximum recursion depth exceeded ???

2008-10-20 Thread kele

sorry . i blow myself up ! i redefine the  login function . ignore
me  .

On Oct 20, 7:41 pm, kele <[EMAIL PROTECTED]> wrote:
> i just try to make my first authenticate codes . but while in the
> line
> '      login(request, v) '   , i got this  runtime error  , and
> 'maximum recursion depth exceeded'.
>
> but i do not have any loop there  . why ??? help .
>
> my codes r shown as below :
>
> def login(request ,template_name):
>
>         from django.contrib.auth.models import User
>         if request.method== 'POST':
>                 form = LoginForm(request.POST)
>                 if form.is_valid():
>                         user = form.cleaned_data['username']
>                         password = form.cleaned_data['password']
>                         v = authenticate(username=user,
> password=password)
>                         if v is not None:
>                                 if v.is_active:
>                                         login(request, v)
>                                         return HttpResponse("good to
> meet u")
>                                 else:
>                                         return HttpResponse("u r in a
> frozen level")
>                         else:
>                                 return HttpResponse("OPS")
>
>         form = LoginForm()
>         return render_to_response(template_name, locals())
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



maximum recursion depth exceeded ???

2008-10-20 Thread kele

i just try to make my first authenticate codes . but while in the
line
'  login(request, v) '   , i got this  runtime error  , and
'maximum recursion depth exceeded'.

but i do not have any loop there  . why ??? help .

my codes r shown as below :

def login(request ,template_name):

from django.contrib.auth.models import User
if request.method== 'POST':
form = LoginForm(request.POST)
if form.is_valid():
user = form.cleaned_data['username']
password = form.cleaned_data['password']
v = authenticate(username=user,
password=password)
if v is not None:
if v.is_active:
login(request, v)
return HttpResponse("good to
meet u")
else:
return HttpResponse("u r in a
frozen level")
else:
return HttpResponse("OPS")

form = LoginForm()
return render_to_response(template_name, locals())
--~--~-~--~~~---~--~~
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: QS-RF: maximum recursion depth exceeded in cmp

2008-04-16 Thread sector119

Thanks, Malcolm, everything works fine now, I just remove 'parent'
from ordering! I know about django-mptt, but I do not need tree
actually, I just want to view relations... With plain ordering...
--~--~-~--~~~---~--~~
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: QS-RF: maximum recursion depth exceeded in cmp

2008-04-16 Thread sector119

> One more thing: What are you doing with class Import? That doesn't make any
> sense like that to me.

It's for my own purposes. I use it to show that data can be imported
into this model and to define clean methods like in newforms to clean
and normalise imported data :)

class Import:
@staticmethod
def clean_last_name(value):
"""In general, any cleaning method can raise
ValidationError if
there is a problem with the data it is processing, passing
the
relevant error message to the ValidationError constructor.
If no
ValidationError is raised, the method should return the
cleaned
(normalised) data as a Python dict object with field name
as key
and field value as value."""

# Split last_name to first_name, last_name, middle_name
import re

pattern = r'(?P[-\w]+) +(?P\w)
[. ]*(?P\w?)'
regexp = re.compile(pattern, re.U)
match = regexp.match(value)

if match:
last_name, first_name, middle_name = match.groups()
return dict(first_name=first_name,
last_name=last_name, middle_name=middle_name)
else:
return dict(last_name=value)

@staticmethod
def clean_comment(value):
"""Remove leading '{{' and trailing '}}' chars from
comment."""
return dict(comment=value.strip('{}'))

--~--~-~--~~~---~--~~
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: QS-RF: maximum recursion depth exceeded in cmp

2008-04-15 Thread Malcolm Tredinnick


On Tue, 2008-04-15 at 07:59 -0700, sector119 wrote:
> Template error
> 
> In template /home/sector119/devel/eps_src/eps/templates/base.html,
> error at line 23
> Caught an exception while rendering: maximum recursion depth exceeded
> in cmp
> 
> 23{{ user.office.location.get_type_display }}.
> 24{{ user.office.location.name }},
> 25{{ user.office.name }},
> 
> --
> 
> class Location(models.Model):
> id = models.IntegerField(_('Id'), primary_key=True)
> parent = models.ForeignKey('self', verbose_name=_('Location parent
> id:'), null=True, blank=True,  related_name='child_set')
> name = models.CharField(_('Location'), help_text=_('Office or
> person location.'), max_length=32)
> type = models.PositiveSmallIntegerField(_('Location type'),
> choices=LOCATION_TYPE_CHOICES)

[...]
> class Meta:
> verbose_name = _('Location')
> verbose_name_plural = _('Locations')
> ordering = ['parent', 'id']

This is a combination of a bug in your code and a bug in
queryset-refactor. It is also something that is specific to
queryset-refactor because it fixes a bug in trunk, as noted below. The
queryset-refactor bug is now fixed, as of [7429], but all that does is
change the error you get. Now it will report that there is an infinite
ordering loop in the Location model (it already did this in most cases,
but I'd somehow broken the "related to 'self'" case and hadn't realised
it was behaving differently).

This is a case where queryset-refactor fixes a bug that exists in trunk
and thus the results change slightly, but only because trunk was doing
it wrong. The problem is that to order by the 'parent' model properly,
we need to order those parents by their own parents (since that is the
ordering on the parent model as well), which means we need to know how
to order the grandparents and then the great-grandparents and so on. And
what we don't know until we examine the data is how many levels of
ordering are involved here. In short, there is no way to construct an
SQL query that will correctly order by parents based on this data
structure. Django trunk just orders by the immediate parent, which, as I
said, doesn't raise an error, but it also isn't really correct or
intuitive.

Django queryset-refactor detects the infinite loop problem and reports
it as an error.

What you can do is order by 'parent_id', which is equivalent to the
current trunk behaviour, although it might not really be what you want.
That doesn't require joining Location to itself multiple times at the
SQL level, since the parent_id value is part of the Location table. But
you have to specify that manually, since ordering by ForeignKeys is
quite possible, providing there is not an infinite loop and it would be
lots of extra work for Django to work out the loop and then change the
meaning of the ordering field each time. So you need to get the right in
your own code.

Alternatively, you need to change your tree-like structure to include a
bit more additional information so that ordering of nodes in the tree
can be done. This is what django-mptt does and there are also lots of
articles around on the Web and in books about how to store tree-like
data structures in SQL.

Regards,
Malcolm

-- 
Honk if you love peace and quiet. 
http://www.pointy-stick.com/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: QS-RF: maximum recursion depth exceeded in cmp

2008-04-15 Thread Michael
What I am trying to do is reproduce your problem. So I laid out two simple
classes:

CHOICES = (
(1,'Choice 1'),
(2, 'Choice 2')
)

class FirstClass(models.Model):
parent = models.ForeignKey('self', blank=True, null=True)
choicelist = models.PositiveSmallIntegerField(choices=CHOICES)

class SecondClass(models.Model):
parent = models.ForeignKey('self', blank=True, null=True)
choice = models.ForeignKey(FirstClass)

in which I am trying to get to the problem. In the shell I am able to see
what is going on:

>>> a = FirstClass(choicelist=1)
>>> a.save()
>>> b = SecondClass(choice=a)
>>> b.save()
>>> b.choice.get_choicelist_display()
u'Choice 1'

This test does exactly what it is supposed to do.

I still am missing what is causing this error. It is most likely happening
in a loop of some sort, which is somewhere else in your template. Is there a
loop in you template? Go into the shell and try to extract the data from the
user object like above. My bet is that that api works exactly like you
expect it to. There is something else. Is there anymore traceback? Try to
reproduce in the shell, that will help us pinpoint exactly where the error
is coming from.

One more thing: What are you doing with class Import? That doesn't make any
sense like that to me.

Also, I realize that the fact that you are using the QS-RF branch is
important for us to know what base code you are working from, but this is
the second post you have posted that doesn't really have anything specific
to that branch. You will get more people to help you out if you leave that
out of the subject and mention it inside the body of the message where it
becomes apparent that the problem is not QS-RF specific.




On Tue, Apr 15, 2008 at 10:59 AM, sector119 <[EMAIL PROTECTED]> wrote:

>
> Template error
>
> In template /home/sector119/devel/eps_src/eps/templates/base.html,
> error at line 23
> Caught an exception while rendering: maximum recursion depth exceeded
> in cmp
>
> 23  {{ user.office.location.get_type_display }}.
> 24  {{ user.office.location.name }},
> 25  {{ user.office.name }},
>
> --
>
> class Location(models.Model):
>id = models.IntegerField(_('Id'), primary_key=True)
>parent = models.ForeignKey('self', verbose_name=_('Location parent
> id:'), null=True, blank=True,  related_name='child_set')
>name = models.CharField(_('Location'), help_text=_('Office or
> person location.'), max_length=32)
>type = models.PositiveSmallIntegerField(_('Location type'),
> choices=LOCATION_TYPE_CHOICES)
>
>def __unicode__(self):
>return self.name
>
>class Import:
>pass
>
>class Meta:
>verbose_name = _('Location')
>verbose_name_plural = _('Locations')
>ordering = ['parent', 'id']
>
>class Admin:
>pass
>
>
> --
>
> class OrganizationOffice(models.Model):
>parent = models.ForeignKey('self', verbose_name=_('Parent
> office:'), null=True, blank=True)
>location = models.ForeignKey(Location,
> verbose_name=_('Location:'))
>name = models.CharField(_('Office'), max_length=50)
>bank = models.CharField(_('Bank'), max_length=50, null=True,
> blank=True)
>account = fields.PositiveBigIntegerField(_('Account'), null=True,
> blank=True)
>bic = models.PositiveIntegerField(_('BIC'), help_text=_('Bank
> identifier code.'), null=True, blank=True)
>code = models.PositiveIntegerField(_('Code'),
> help_text=_('Enterprise code.'), null=True, blank=True)
>in_testmode = models.BooleanField(_('Office is in test mode'),
> default=False)
>day_is_open = models.BooleanField(_('Transaction day is open'),
> default=False)
>
>def __unicode__(self):
>return self.name
>
>class Import:
>pass
>
>class Meta:
>verbose_name = _('Office')
>verbose_name_plural = _('Offices')
>ordering = ['location', 'parent', 'id']
>
>class Admin:
>search_fields = ('^id', '^location__name', 'name')
>
> >
>

--~--~-~--~~~---~--~~
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: QS-RF: maximum recursion depth exceeded in cmp

2008-04-15 Thread sector119

Template error

In template /home/sector119/devel/eps_src/eps/templates/base.html,
error at line 23
Caught an exception while rendering: maximum recursion depth exceeded
in cmp

23  {{ user.office.location.get_type_display }}.
24  {{ user.office.location.name }},
25  {{ user.office.name }},

--

class Location(models.Model):
id = models.IntegerField(_('Id'), primary_key=True)
parent = models.ForeignKey('self', verbose_name=_('Location parent
id:'), null=True, blank=True,  related_name='child_set')
name = models.CharField(_('Location'), help_text=_('Office or
person location.'), max_length=32)
type = models.PositiveSmallIntegerField(_('Location type'),
choices=LOCATION_TYPE_CHOICES)

def __unicode__(self):
return self.name

class Import:
pass

class Meta:
verbose_name = _('Location')
verbose_name_plural = _('Locations')
ordering = ['parent', 'id']

class Admin:
pass


--

class OrganizationOffice(models.Model):
parent = models.ForeignKey('self', verbose_name=_('Parent
office:'), null=True, blank=True)
location = models.ForeignKey(Location,
verbose_name=_('Location:'))
name = models.CharField(_('Office'), max_length=50)
bank = models.CharField(_('Bank'), max_length=50, null=True,
blank=True)
account = fields.PositiveBigIntegerField(_('Account'), null=True,
blank=True)
bic = models.PositiveIntegerField(_('BIC'), help_text=_('Bank
identifier code.'), null=True, blank=True)
code = models.PositiveIntegerField(_('Code'),
help_text=_('Enterprise code.'), null=True, blank=True)
in_testmode = models.BooleanField(_('Office is in test mode'),
default=False)
day_is_open = models.BooleanField(_('Transaction day is open'),
default=False)

def __unicode__(self):
return self.name

class Import:
pass

class Meta:
verbose_name = _('Office')
verbose_name_plural = _('Offices')
ordering = ['location', 'parent', 'id']

class Admin:
search_fields = ('^id', '^location__name', 'name')

--~--~-~--~~~---~--~~
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: QS-RF: maximum recursion depth exceeded in cmp

2008-04-15 Thread Michael
Could you post your models code somewhere for us to take a look at? Also
could you separate each variable in you template to a different line so we
know what exactly was causing the error?

I think I have an idea of what is going on here, but I want to try to
reproduce it with as few lines as possible.

On Tue, Apr 15, 2008 at 10:16 AM, sector119 <[EMAIL PROTECTED]> wrote:

>
> I begin testing qs-rf branch and get this exception, why?
> May be because Office model is tree - has parent =
> models.ForeignKey('self') field?
>
> Exception Type: RuntimeError
> Exception Value:    maximum recursion depth exceeded in cmp
> Exception Location: /home/sector119/devel/django_src/django/db/models/
> sql/query.py in join, line 734
> Python Executable:  /usr/bin/python2.5
>
>
> Template error
>
> In template /home/sector119/devel/eps_src/eps/templates/base.html,
> error at line 23
> Caught an exception while rendering: maximum recursion depth exceeded
> in cmp
>
> 23  {{ user.office.location.get_type_display }}.
> {{ user.office.location.name }}, {{ user.office.name }}, {% firstof
> user.get_full_name user.username %} | {% block userlinks %} href="">{% trans 'Help' %} | {% trans 'Sign out' %}{%
> endblock %}
> >
>

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



QS-RF: maximum recursion depth exceeded in cmp

2008-04-15 Thread sector119

I begin testing qs-rf branch and get this exception, why?
May be because Office model is tree - has parent =
models.ForeignKey('self') field?

Exception Type: RuntimeError
Exception Value:maximum recursion depth exceeded in cmp
Exception Location: /home/sector119/devel/django_src/django/db/models/
sql/query.py in join, line 734
Python Executable:  /usr/bin/python2.5


Template error

In template /home/sector119/devel/eps_src/eps/templates/base.html,
error at line 23
Caught an exception while rendering: maximum recursion depth exceeded
in cmp

23  {{ user.office.location.get_type_display }}.
{{ user.office.location.name }}, {{ user.office.name }}, {% firstof
user.get_full_name user.username %} | {% block userlinks %}{% trans 'Help' %} | {% trans 'Sign out' %}{%
endblock %}
--~--~-~--~~~---~--~~
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: Logout method returning "maximum recursion depth exceeded" - Help!

2006-10-27 Thread Merric Mercer

Thanks for all your points.  I'm having real problems with Google 
groups.  I figured out what was wrong - but was not able to post in.  
Now, these posts are obviously coming in - 24 late.

MerMer
>
> Karen
>
> p.s. Is google groups acting up?  I just got a bunch of old mails 
> (like this one), and my first attempt to post this via the groups 
> page gave me an "oops, we're sorry, can't do, please try again later" 
> kind of message?  (Gah, as did my 2ndI'll try again with real mail...)
>
> At 06:24 AM 10/26/2006, you wrote:
>
>   
>> I am trying to get the Logout Method to work, but I keep
>> getting"Exception Value:maximum recursion depth exceeded!".
>>
>> The view is very straightforward, so I can't understand where I'm going
>> wrong.
>>
>> 
> >from django.contrib.auth import logout, authenticate, login
>   
>> def logout(request):
>> logout(request)  # debug shows it fails on this line
>> return render_to_response('promotions.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
-~--~~~~--~~--~--~---



Re: Logout method returning "maximum recursion depth exceeded" - Help!

2006-10-27 Thread Karen Tracey

Yeah, you've got infinite recursion in the first line of your logout 
function: it calls itself.  I'm not sure why you are even defining 
your own logout view?  I have my urls.py map my logout url to 
django.contrib.auth.views.logout, and supply a context that includes 
template_name to display my own logout template.  Specifically, my 
urls.py includes this line:

 (r'accounts/logout/$', 'django.contrib.auth.views.logout', 
{'template_name': 'cdbauth/logged_out.tmpl'}),

Given you don't do anything extra in your logout view, I think you 
could do the same, just replace the first parameter with your own 
chosen logout url and the last one with your template name?

Karen

p.s. Is google groups acting up?  I just got a bunch of old mails 
(like this one), and my first attempt to post this via the groups 
page gave me an "oops, we're sorry, can't do, please try again later" 
kind of message?  (Gah, as did my 2ndI'll try again with real mail...)

At 06:24 AM 10/26/2006, you wrote:

>I am trying to get the Logout Method to work, but I keep
>getting"Exception Value:    maximum recursion depth exceeded!".
>
>The view is very straightforward, so I can't understand where I'm going
>wrong.
>
>from django.contrib.auth import logout, authenticate, login
>
>def logout(request):
> logout(request)  # debug shows it fails on this line
> return render_to_response('promotions.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
-~--~~~~--~~--~--~---



Re: Logout method returning "maximum recursion depth exceeded" - Help!

2006-10-27 Thread Don Arbow
On Oct 26, 2006, at 3:24 AM, MerMer wrote:I am trying to get the Logout Method to work, but I keepgetting"Exception Value:  	maximum recursion depth exceeded!".The view is very straightforward, so I can't understand where I'm goingwrong.from django.contrib.auth import logout, authenticate, logindef logout(request):    logout(request)  # debug shows it fails on this line    return render_to_response('promotions.html')Probably because python is calling the wrong logout method (yours and not django's). I would instead qualify the logout method you are calling like this:from django.contrib import authdef logout(request):	auth.logout(request)	...or you could rename your logout method to something else, like log_me_out(), which should prevent the recursion.Don
--~--~-~--~~~---~--~~
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  -~--~~~~--~~--~--~---



Logout method returning "maximum recursion depth exceeded" - Help!

2006-10-27 Thread MerMer

I am trying to get the Logout Method to work, but I keep
getting"Exception Value:    maximum recursion depth exceeded!".

The view is very straightforward, so I can't understand where I'm going
wrong.

from django.contrib.auth import logout, authenticate, login

def logout(request):
logout(request)  # debug shows it fails on this line
return render_to_response('promotions.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
-~--~~~~--~~--~--~---