Skip to content

Can't subclass the field in django 1.2 #11

@majdal

Description

@majdal

I try to subclass PickledObjectField to be able to specifiy the form field and widget to use with it while staying DRY, but i get this error when i try to syncdb. Note that identical code has been tested on django 1.4, and works as expected.

I know that this is an outdated version of the package, but @gintas 's branch does not have an issues section!

python manage.py syncdb --database=project
Traceback (most recent call last):
  File "manage.py", line 11, in <module>
    execute_manager(settings)
  File "/home/majd/virtualenvs/26_tea/lib/python2.6/site-packages/django/core/management/__init__.py", line 438, in execute_manager
    utility.execute()
  File "/home/majd/virtualenvs/26_tea/lib/python2.6/site-packages/django/core/management/__init__.py", line 379, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/majd/virtualenvs/26_tea/lib/python2.6/site-packages/django/core/management/base.py", line 191, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/home/majd/virtualenvs/26_tea/lib/python2.6/site-packages/django/core/management/base.py", line 219, in execute
    self.validate()
  File "/home/majd/virtualenvs/26_tea/lib/python2.6/site-packages/django/core/management/base.py", line 249, in validate
    num_errors = get_validation_errors(s, app)
  File "/home/majd/virtualenvs/26_tea/lib/python2.6/site-packages/django/core/management/validation.py", line 28, in get_validation_errors
    for (app_name, error) in get_app_errors().items():
  File "/home/majd/virtualenvs/26_tea/lib/python2.6/site-packages/django/db/models/loading.py", line 146, in get_app_errors
    self._populate()
  File "/home/majd/virtualenvs/26_tea/lib/python2.6/site-packages/django/db/models/loading.py", line 61, in _populate
    self.load_app(app_name, True)
  File "/home/majd/virtualenvs/26_tea/lib/python2.6/site-packages/django/db/models/loading.py", line 78, in load_app
    models = import_module('.models', app_name)
  File "/home/majd/virtualenvs/26_tea/lib/python2.6/site-packages/django/utils/importlib.py", line 35, in import_module
    __import__(name)
  File "/home/majd/workspace/TEABudgeting/budgeting/models.py", line 2, in <module>
    from app_models.budget import Budget, Budget_form, Budget_grid
  File "/home/majd/workspace/TEABudgeting/budgeting/app_models/budget.py", line 56, in <module>
    class Budget(model.Model):
  File "/home/majd/virtualenvs/26_tea/lib/python2.6/site-packages/django/db/models/base.py", line 92, in __new__
    new_class.add_to_class(obj_name, obj)
  File "/home/majd/virtualenvs/26_tea/lib/python2.6/site-packages/django/db/models/base.py", line 212, in add_to_class
    value.contribute_to_class(cls, name)
  File "/home/majd/virtualenvs/26_tea/lib/python2.6/site-packages/django/db/models/fields/subclassing.py", line 113, in contribute_to_class
    super(self.__class__, self).contribute_to_class(cls, name)

==================================================
many many many recursions of the same line later....
==================================================


  File "/home/majd/virtualenvs/26_tea/lib/python2.6/site-packages/django/db/models/fields/subclassing.py", line 113, in contribute_to_class
    super(self.__class__, self).contribute_to_class(cls, name)
RuntimeError: maximum recursion depth exceeded while calling a Python object

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions