Re: newforms-admin rev 6373 perhaps self-refrencing many2many broken? deepcopy ?

2007-09-18 Thread Dan Larkin

I think you're seeing the same problem I was when I submitted ticket
#5505 ( http://code.djangoproject.com/ticket/5505 ).  I guess the
problem isn't limited to self-referential foreignkeys though, like I
originally thought.

The patches db-models-fields-init.patch and newforms-forms.patch fix
the problem... for me at least.  Like malcom said in his comment
though, putting a __deepcopy__ method on Field is probably a bit
much.. it might be able to go on just the related objects.

Anyway, this patch is at most a temporary measure.. there's definitely
more that needs to be worked out with it.

Dan

On Sep 18, 8:47 am, kan <[EMAIL PROTECTED]> wrote:
> Ok Thank you andy
>
> I did scour through old messages for a other reports of this problem
> but did not find it earlier. Thank for the link.
>
> regards,
> suresh.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@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-developers?hl=en
-~--~~~~--~~--~--~---



Re: newforms-admin rev 6373 perhaps self-refrencing many2many broken? deepcopy ?

2007-09-18 Thread kan

Ok Thank you andy

I did scour through old messages for a other reports of this problem
but did not find it earlier. Thank for the link.

regards,
suresh.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@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-developers?hl=en
-~--~~~~--~~--~--~---



Re: newforms-admin rev 6373 perhaps self-refrencing many2many broken? deepcopy ?

2007-09-18 Thread andybak

It sounds related to this:
http://groups.google.com/group/django-developers/tree/browse_frm/thread/76e8b700b30b85ff/44359701d3b9be4c?rnum=1&_done=%2Fgroup%2Fdjango-developers%2Fbrowse_frm%2Fthread%2F76e8b700b30b85ff%3F#doc_5d6b304972a7cd5b

I think Joseph is looking into it. The current SVN version of newform-
admin is broken in several places as a result of this bug.

On Sep 18, 12:51 pm, kan <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I seem to have a problem with the newforms-admin revision 6373. When I
> have a recursive many2many it fails. The top of the call stack start
> at self.base_fields.copy() . For the simple example below when I click
> on the add keyword in the admin interface. I get the following stack.
>
> I also get the same error when I have related inline fields. I am new
> to this. Perhaps I am intruding on the developers-group. I think I
> really should raise something like a ticket. However I am posting here
> until I figure the ticket system out.
>
> Example:
>
> from django.db import models
> from django.contrib import admin
> from django import newforms as forms
>
> class Keyword(models.Model):
> """A tag on an item."""
> keyword =
> models.CharField(max_length=KEYWORD_MAX_LENGTH,unique=True)
> description = models.TextField(blank=True,null=True)
> thesarus=
> models.ManyToManyField('Keyword',blank=True,null=True)
>
> def __str__(self):
> return self.keyword
>
> class Admin:
> pass
>
> class KeywordOptions(admin.ModelAdmin):
> list_display = ('keyword','description')
>
> 
> TypeError at /admin/cms/keyword/add/
> instancemethod expected at least 2 arguments, got 0
> Request Method: GET
> Request URL:http://localhost:8000/admin/cms/keyword/add/
> Exception Type: TypeError
> Exception Value:instancemethod expected at least 2 arguments, got 0
> Exception Location: C:\Python25\lib\copy_reg.py in __newobj__, line
> 92
> Python Executable:  c:\python25\python.exe
> Python Version: 2.5.1
>
> ---
> Traceback (most recent call last):
> File "c:\python25\Lib\site-packages\django\core\handlers\base.py" in
> _real_get_response
>   81. response = callback(request, *callback_args, **callback_kwargs)
> File "c:\python25\Lib\site-packages\django\contrib\admin\sites.py" in
> root
>   136. return self.model_page(request, *url.split('/', 2))
> File "c:\python25\Lib\site-packages\django\contrib\admin\sites.py" in
> model_page
>   153. return admin_obj(request, rest_of_url)
> File "c:\python25\Lib\site-packages\django\contrib\admin\options.py"
> in __call__
>   245. return self.add_view(request)
> File "c:\python25\Lib\site-packages\django\contrib\admin\options.py"
> in add_view
>   474. form = ModelForm(initial=request.GET)
> File "c:\python25\lib\site-packages\django\newforms\forms.py" in
> __init__
>   84. self.fields = self.base_fields.copy()
> File "c:\python25\lib\site-packages\django\newforms\forms.py" in copy
>   36. return SortedDictFromList([(k, copy.deepcopy(v)) for k, v in
> self.items()])
> File "c:\python25\lib\copy.py" in deepcopy
>   173. y = copier(memo)
> File "c:\python25\Lib\site-packages\django\newforms\fields.py" in
> __deepcopy__
>   107. result.widget = copy.deepcopy(self.widget, memo)
> File "c:\python25\lib\copy.py" in deepcopy
>   189. y = _reconstruct(x, rv, 1, memo)
> File "c:\python25\lib\copy.py" in _reconstruct
>   337. state = deepcopy(state, memo)
> File "c:\python25\lib\copy.py" in deepcopy
>   162. y = copier(x, memo)
> File "c:\python25\lib\copy.py" in _deepcopy_dict
>   254. y[deepcopy(key, memo)] = deepcopy(value, memo)
> File "c:\python25\lib\copy.py" in deepcopy
>   189. y = _reconstruct(x, rv, 1, memo)
> File "c:\python25\lib\copy.py" in _reconstruct
>   337. state = deepcopy(state, memo)
> File "c:\python25\lib\copy.py" in deepcopy
>   162. y = copier(x, memo)
> File "c:\python25\lib\copy.py" in _deepcopy_dict
>   254. y[deepcopy(key, memo)] = deepcopy(value, memo)
> File "c:\python25\lib\copy.py" in deepcopy
>   189. y = _reconstruct(x, rv, 1, memo)
> File "c:\python25\lib\copy.py" in _reconstruct
>   322. y = callable(*args)
> File "C:\Python25\lib\copy_reg.py" in __newobj__
>   92. return cls.__new__(cls, *args)
>
>   TypeError at /admin/cms/keyword/add/
>   instancemethod expected at least 2 arguments, got 0


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@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-developers?hl=en
-~--~~~~--~~--~--~---



newforms-admin rev 6373 perhaps self-refrencing many2many broken? deepcopy ?

2007-09-18 Thread kan

Hello,

I seem to have a problem with the newforms-admin revision 6373. When I
have a recursive many2many it fails. The top of the call stack start
at self.base_fields.copy() . For the simple example below when I click
on the add keyword in the admin interface. I get the following stack.

I also get the same error when I have related inline fields. I am new
to this. Perhaps I am intruding on the developers-group. I think I
really should raise something like a ticket. However I am posting here
until I figure the ticket system out.

Example:

from django.db import models
from django.contrib import admin
from django import newforms as forms

class Keyword(models.Model):
"""A tag on an item."""
keyword =
models.CharField(max_length=KEYWORD_MAX_LENGTH,unique=True)
description = models.TextField(blank=True,null=True)
thesarus=
models.ManyToManyField('Keyword',blank=True,null=True)

def __str__(self):
return self.keyword

class Admin:
pass

class KeywordOptions(admin.ModelAdmin):
list_display = ('keyword','description')



TypeError at /admin/cms/keyword/add/
instancemethod expected at least 2 arguments, got 0
Request Method: GET
Request URL:http://localhost:8000/admin/cms/keyword/add/
Exception Type: TypeError
Exception Value:instancemethod expected at least 2 arguments, got 0
Exception Location: C:\Python25\lib\copy_reg.py in __newobj__, line
92
Python Executable:  c:\python25\python.exe
Python Version: 2.5.1

---
Traceback (most recent call last):
File "c:\python25\Lib\site-packages\django\core\handlers\base.py" in
_real_get_response
  81. response = callback(request, *callback_args, **callback_kwargs)
File "c:\python25\Lib\site-packages\django\contrib\admin\sites.py" in
root
  136. return self.model_page(request, *url.split('/', 2))
File "c:\python25\Lib\site-packages\django\contrib\admin\sites.py" in
model_page
  153. return admin_obj(request, rest_of_url)
File "c:\python25\Lib\site-packages\django\contrib\admin\options.py"
in __call__
  245. return self.add_view(request)
File "c:\python25\Lib\site-packages\django\contrib\admin\options.py"
in add_view
  474. form = ModelForm(initial=request.GET)
File "c:\python25\lib\site-packages\django\newforms\forms.py" in
__init__
  84. self.fields = self.base_fields.copy()
File "c:\python25\lib\site-packages\django\newforms\forms.py" in copy
  36. return SortedDictFromList([(k, copy.deepcopy(v)) for k, v in
self.items()])
File "c:\python25\lib\copy.py" in deepcopy
  173. y = copier(memo)
File "c:\python25\Lib\site-packages\django\newforms\fields.py" in
__deepcopy__
  107. result.widget = copy.deepcopy(self.widget, memo)
File "c:\python25\lib\copy.py" in deepcopy
  189. y = _reconstruct(x, rv, 1, memo)
File "c:\python25\lib\copy.py" in _reconstruct
  337. state = deepcopy(state, memo)
File "c:\python25\lib\copy.py" in deepcopy
  162. y = copier(x, memo)
File "c:\python25\lib\copy.py" in _deepcopy_dict
  254. y[deepcopy(key, memo)] = deepcopy(value, memo)
File "c:\python25\lib\copy.py" in deepcopy
  189. y = _reconstruct(x, rv, 1, memo)
File "c:\python25\lib\copy.py" in _reconstruct
  337. state = deepcopy(state, memo)
File "c:\python25\lib\copy.py" in deepcopy
  162. y = copier(x, memo)
File "c:\python25\lib\copy.py" in _deepcopy_dict
  254. y[deepcopy(key, memo)] = deepcopy(value, memo)
File "c:\python25\lib\copy.py" in deepcopy
  189. y = _reconstruct(x, rv, 1, memo)
File "c:\python25\lib\copy.py" in _reconstruct
  322. y = callable(*args)
File "C:\Python25\lib\copy_reg.py" in __newobj__
  92. return cls.__new__(cls, *args)

  TypeError at /admin/cms/keyword/add/
  instancemethod expected at least 2 arguments, got 0


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@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-developers?hl=en
-~--~~~~--~~--~--~---