google-code-export / django-page-cms

Automatically exported from code.google.com/p/django-page-cms
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

'PageAdmin.fieldsets[1][1]['fields']' refers to field 'tags' that is missing from the form. #26

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Get code from svn repository
2. Run syncdb, runserver, Page already registered error
3. Comment out mptt.register() (Why do I need to do this? Is something
wrong at this step itself?) in model, then get this error

+ If I comment out admin.autodiscover() in my urls.py then things work of
course, but nothing to do in Admin then :(

What is the expected output? What do you see instead?
+ Working admin, but get this error

What version of the product are you using? On what operating system?
+ Trunk, Mac OSX, with Django 1.0.1

Please provide any additional information below.
----------------
From settings.py
----------------
sys.path.append(os.path.join(__dirname__, 'lib/rc_cms/'))
PAGE_TAGGING = True
LANGUAGES = (
    ('en', 'English'),
)
DEFAULT_PAGE_TEMPLATE = 'tivix_com/resourcecenter.html'

-------------
ERROR
-------------
Environment:

Request Method: GET
Request URL: http://localhost:8000/pages/
Django Version: 1.0.1 final
Python Version: 2.5.1
Installed Applications:
['django.contrib.auth',
 'django.contrib.humanize',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.admin',
 'registration',
 'tivix_com',
 'accounts',
 'apps.box_net',
 'apps.paypal',
 'apps.paypal',
 'apps.crm',
 'lib.rc_cms.pages']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.middleware.transaction.TransactionMiddleware',
 'accounts.middleware.AssociatedAccountMiddleWare')

Traceback:
File "/Library/Python/2.5/site-packages/django/core/handlers/base.py" in
get_response
  77.                     request.path_info)
File "/Library/Python/2.5/site-packages/django/core/urlresolvers.py" in resolve
  179.             for pattern in self.urlconf_module.urlpatterns:
File "/Library/Python/2.5/site-packages/django/core/urlresolvers.py" in
_get_urlconf_module
  198.             self._urlconf_module = __import__(self.urlconf_name, {},
{}, [''])
File "/Users/chachra/Dropbox/tivix/code/dev/tivix/urls.py" in <module>
  8. admin.autodiscover()
File "/Library/Python/2.5/site-packages/django/contrib/admin/__init__.py"
in autodiscover
  40.         __import__("%s.admin" % app)
File
"/Users/chachra/Dropbox/tivix/code/dev/tivix/lib/rc_cms/pages/admin/__init__.py"
in <module>
  19. from pages.admin import widgets
File
"/Users/chachra/Dropbox/tivix/code/dev/tivix/lib/rc_cms/pages/admin/__init__.py"
in <module>
  277. admin.site.register(Page, PageAdmin)
File "/Library/Python/2.5/site-packages/django/contrib/admin/sites.py" in
register
  76.             validate(admin_class, model)
File "/Library/Python/2.5/site-packages/django/contrib/admin/validation.py"
in validate
  25.     validate_base(cls, model)
File "/Library/Python/2.5/site-packages/django/contrib/admin/validation.py"
in validate_base
  179.             check_formfield(cls, model, opts,
"fieldsets[%d][1]['fields']" % idx, field)
File "/Library/Python/2.5/site-packages/django/contrib/admin/validation.py"
in check_formfield
  254.                 "is missing from the form." % (cls.__name__, label,
field))

Exception Type: ImproperlyConfigured at /pages/
Exception Value: 'PageAdmin.fieldsets[1][1]['fields']' refers to field
'tags' that is missing from the form.

Original issue reported on code.google.com by sumit.ch...@gmail.com on 19 Nov 2008 at 2:53

GoogleCodeExporter commented 9 years ago
Try to update to the last revision. This problem should be fixed.

Original comment by batiste....@gmail.com on 19 Nov 2008 at 9:43

GoogleCodeExporter commented 9 years ago

Original comment by batiste....@gmail.com on 19 Nov 2008 at 3:40

GoogleCodeExporter commented 9 years ago
What does latest revision mean?? I got the code from svn trunk, isn't that the 
latest?

Original comment by sumit.ch...@gmail.com on 19 Nov 2008 at 6:02

GoogleCodeExporter commented 9 years ago
You require mptt.register() you commented out in step 3.

That's a function of django-mptt that is used by page-cms. See 
http://code.google.com/p/django-mptt/ for 
more information.

Original comment by leidel on 19 Nov 2008 at 7:57

GoogleCodeExporter commented 9 years ago
Well if I leave the register there then I am getting "The model Page has 
already been
registered" error. Not sure why thats happening.

Is this code supposed to work with Django 1.0+ ??

Detailed error:

Environment:

Request Method: GET
Request URL: http://localhost:8000/
Django Version: 1.0.2 final
Python Version: 2.5.1
Installed Applications:
['django.contrib.auth',
 'django.contrib.humanize',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.admin',
 'registration',
 'tivix_com',
 'accounts',
 'apps.box_net',
 'apps.paypal',
 'apps.paypal',
 'apps.crm',
 'lib.rc_cms.pages']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.middleware.transaction.TransactionMiddleware',
 'accounts.middleware.AssociatedAccountMiddleWare',
 'django.middleware.locale.LocaleMiddleware')

Traceback:
File "/Library/Python/2.5/site-packages/django/core/handlers/base.py" in 
get_response
  77.                     request.path_info)
File "/Library/Python/2.5/site-packages/django/core/urlresolvers.py" in resolve
  179.             for pattern in self.urlconf_module.urlpatterns:
File "/Library/Python/2.5/site-packages/django/core/urlresolvers.py" in
_get_urlconf_module
  198.             self._urlconf_module = __import__(self.urlconf_name, {}, {}, [''])
File "/Users/chachra/Dropbox/tivix/code/dev/tivix/urls.py" in <module>
  8. admin.autodiscover()
File "/Library/Python/2.5/site-packages/django/contrib/admin/__init__.py" in 
autodiscover
  40.         __import__("%s.admin" % app)
File 
"/Users/chachra/Dropbox/tivix/code/dev/tivix/lib/rc_cms/pages/admin/__init__.py"
in <module>
  14. from pages.models import Page, Content, tagging
File "/Users/chachra/Dropbox/tivix/code/dev/tivix/lib/rc_cms/pages/models.py" 
in <module>
  164. mptt.register(Page)
File "/Users/chachra/Dropbox/tivix/code/dev/tivix/lib/rc_cms/mptt/__init__.py" 
in
register
  34.             _('The model %s has already been registered.') % model.__name__)

Exception Type: AlreadyRegistered at /
Exception Value: The model Page has already been registered.

Original comment by sumit.ch...@gmail.com on 19 Nov 2008 at 8:01

GoogleCodeExporter commented 9 years ago
FYI, standalone it seems to run just fine!! I would rather have everything run 
within
my old code-base, although running 2 django apps on same db may be a 
possibility.

What in my current app is causing this, any idea? admin.autodiscover() called 
from
many points in the code ? How can I fix this by making minimal changes to the 
source,
and/or if i can contribute a patch to fix this since others seem to be facing 
similar
issues.

Original comment by sumit.ch...@gmail.com on 19 Nov 2008 at 8:34

GoogleCodeExporter commented 9 years ago

Original comment by batiste....@gmail.com on 19 Nov 2008 at 9:47

GoogleCodeExporter commented 9 years ago
"What in my current app is causing this, any idea?"

It's hard to tell without knowing your code.

Original comment by batiste....@gmail.com on 20 Nov 2008 at 10:39

GoogleCodeExporter commented 9 years ago
Yes, page-cms works on Django 1.0+

As Batiste said, it's hard to tell without knowing the structure of your Django 
project. I added a simple exception 
handling in r221 to handle that situation. It's most likely caused by different 
import paths, e.g. having pages in a 
project namespace 'myproject.pages' while pages uses the plain 'pages' 
namespace.

Original comment by leidel on 23 Nov 2008 at 11:18

GoogleCodeExporter commented 9 years ago
@sumit.chachra: Does it work for you now?

Original comment by leidel on 27 Nov 2008 at 11:39

GoogleCodeExporter commented 9 years ago
Haven't had time to re-try. Will do and post here!

Original comment by sumit.ch...@gmail.com on 27 Nov 2008 at 1:25

GoogleCodeExporter commented 9 years ago
Without anymore news from sumit.chachra, I decide to close this bug for now.

Original comment by batiste....@gmail.com on 20 Feb 2009 at 8:09