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 [email protected]
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to