#1796: [patch] "Cannot resolve keyword ___ into field" error when working with
ManyToMany relation
-------------------------+--------------------------------------------------
Reporter: anonymous | Owner: mtredinnick
Status: reopened | Component: Database wrapper
Version: SVN | Resolution:
Keywords: | Stage: Accepted
Has_patch: 1 | Needs_docs: 0
Needs_tests: 0 | Needs_better_patch: 0
-------------------------+--------------------------------------------------
Comment (by [EMAIL PROTECTED]):
Here's a simple example that returns the TypeError. Also my python -v
says:
Python 2.4.3 (#1, Oct 18 2006, 15:01:36)
[GCC 4.0.1 (Apple Computer, Inc. build 5250)] on darwin
I also asked axiak on IRC to try it and the test passed for him. He's on
x86_64 though.
Thanks for all the hard work, hope this helps.
from django.contrib.auth.models import User,Group
import datetime, random, sha
import unittest
class ProfileTest(unittest.TestCase):
""" Used as a test case for what appears as this bug :
http://code.djangoproject.com/ticket/1796
"""
def setUp(self):
self.salt = sha.new(str(random.random())).hexdigest()[:5]
def testAcctCreate(self):
self.u=User(
first_name='bob',
last_name='jones',
username='bjones',
email='[EMAIL PROTECTED]',
# is_staff=True,
)
self.u.set_password('[EMAIL PROTECTED]')
self.u.save()
self.group=Group(name='Test Group')
self.group.save()
self.u.groups.add(self.group)
self.assertEquals(User.objects.get(username='bjones'), self.u)
self.assertEquals(Group.objects.get(name='Test Group'),
self.group)
print self.u.__dict__
print self.u.groups.all()
--
Ticket URL: <http://code.djangoproject.com/ticket/1796#comment:66>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" 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-updates?hl=en
-~----------~----~----~----~------~----~------~--~---