Django

Code

Ticket #3894 (closed: duplicate)

Opened 1 year ago

Last modified 1 year ago

ManyToMany breaks in admin on python 2.3

Reported by: Øyvind Saltvik <oyvind.saltvik@gmail.com> Assigned to: adrian
Milestone: Component: Database wrapper
Version: SVN Keywords:
Cc: Triage Stage: Unreviewed
Has patch: 0 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

class Bug(models.Model):
    some_field = models.CharField(maxlength=30)
    belongs_to_sites = models.ManyToManyField(Site, null=True, blank=True)

    class Admin:
        pass

Testing the exact same model on python2.3, breaks with this error: "Cannot resolve keyword 'bug' into field."

get_all_related_many_to_many_objects seems to not add a RelatedObject? with this model to the list.

Attachments

Change History

04/01/07 12:24:26 changed by Øyvind Saltvik <oyvind.saltvik@gmail.com>

  • needs_better_patch changed.
  • needs_tests changed.
  • needs_docs changed.

Traceback

Traceback (most recent call last):
File "/var/www/vhosts/il-sverre.no/httpdocs/trunk/django/core/handlers/base.py" in get_response
  77. response = callback(request, *callback_args, **callback_kwargs)
File "/var/www/vhosts/il-sverre.no/httpdocs/trunk/django/contrib/admin/views/decorators.py" in _checklogin
  55. return view_func(request, *args, **kwargs)
File "/var/www/vhosts/il-sverre.no/httpdocs/trunk/django/views/decorators/cache.py" in _wrapped_view_func
  39. response = view_func(request, *args, **kwargs)
File "/var/www/vhosts/il-sverre.no/httpdocs/trunk/django/contrib/admin/views/main.py" in change_stage
  363. new_data = manipulator.flatten_data()
File "/var/www/vhosts/il-sverre.no/httpdocs/trunk/django/db/models/manipulators.py" in flatten_data
  248. new_data.update(f.flatten_data(fol, obj))
File "/var/www/vhosts/il-sverre.no/httpdocs/trunk/django/db/models/fields/related.py" in flatten_data
  700. instance_ids = [instance._get_pk_val() for instance in getattr(obj, self.name).all()]
File "/var/www/vhosts/il-sverre.no/httpdocs/trunk/django/db/models/query.py" in __iter__
  108. return iter(self._get_data())
File "/var/www/vhosts/il-sverre.no/httpdocs/trunk/django/db/models/query.py" in _get_data
  470. self._result_cache = list(self.iterator())
File "/var/www/vhosts/il-sverre.no/httpdocs/trunk/django/db/models/query.py" in iterator
  174. select, sql, params = self._get_sql_clause()
File "/var/www/vhosts/il-sverre.no/httpdocs/trunk/django/db/models/query.py" in _get_sql_clause
  484. joins2, where2, params2 = self._filters.get_sql(opts)
File "/var/www/vhosts/il-sverre.no/httpdocs/trunk/django/db/models/query.py" in get_sql
  648. joins2, where2, params2 = val.get_sql(opts)
File "/var/www/vhosts/il-sverre.no/httpdocs/trunk/django/db/models/query.py" in get_sql
  699. return parse_lookup(self.kwargs.items(), opts)
File "/var/www/vhosts/il-sverre.no/httpdocs/trunk/django/db/models/query.py" in parse_lookup
  831. joins2, where2, params2 = lookup_inner(path, lookup_type, value, opts, opts.db_table, None)
File "/var/www/vhosts/il-sverre.no/httpdocs/trunk/django/db/models/query.py" in lookup_inner
  938. raise TypeError, "Cannot resolve keyword '%s' into field" % name

  TypeError at /admin/bugtest/bug/
  Cannot resolve keyword 'bug' into field

04/01/07 18:22:44 changed by ubernostrum

  • status changed from new to closed.
  • resolution set to duplicate.

Duplicate of #1796.


Add/Change #3894 (ManyToMany breaks in admin on python 2.3)




Change Properties
Action