Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.

#1 Nov. 20, 2005 22:20:06

Adrian H.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

OneToOneField bug fixed


I've fixed the longstanding OneToOneField bug. If you're using
OneToOneFields, update your trunk code and let me know whether things
work for you!

Adrian

--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org

Offline

#2 Nov. 21, 2005 09:55:06

p.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

OneToOneField bug fixed


Seems like its become broken even more, as for me with the following
model

from django.core import meta
from django.models.auth import User

class PolicyCategory(meta.Model):
name = meta.CharField(maxlength=100);

def __repr__(self):
return self.name

class META:
db_table = 'intranet_policycategories'
module_name = 'policycategories'
verbose_name_plural = 'Policy Categories'

admin = meta.Admin(
search_fields = ,
)


class UserDetail(meta.Model):
user = meta.OneToOneField(User)
policy_categories = meta.ManyToManyField(PolicyCategory,
blank=True)

def __repr__(self):
return self.get_user().username

class META:
admin = meta.Admin(
search_fields = ,
)



I'm getting this error when opening user details list

Request Method: GET
Request URL:http://192.168.1.156:8000/admin/intranet/userdetails/Exception Type: ProgrammingError
Exception Value: ERROR: missing FROM-clause entry for table
"auth_users" SELECT "intranet_userdetails"."user_id" FROM
"intranet_userdetails" ORDER BY "auth_users"."username" DESC
Exception Location:
/usr/lib/python2.4/site-packages/django/core/db/base.py in execute,
line 9

And this page with user detail list worked before fix.

Offline

#3 Nov. 21, 2005 12:43:23

p.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

OneToOneField bug fixed


Also getting error when trying to get_list, details follow

model addition to posted above

class PolicyConfirmation(meta.Model):
policy = meta.ForeignKey(Policy)
userdetail = meta.ForeignKey(UserDetail)
date_added = meta.DateTimeField(default=meta.LazyDate())


code
from django.models.intranet import policyconfirmations
confirmed =
policyconfirmations.get_list(policy__id__exact=policy_id,

userdetail__user__id__exact=user.id)

error

Request Method: GET
Request URL:http://plisk.dev.reliableunit.com:8000/admin/intranet/policies/7/view/Exception Type: TypeError
Exception Value: got unexpected keyword argument
'userdetail__user__id__exact'
Exception Location:
/usr/lib/python2.4/site-packages/django/core/meta/__init__.py in
_throw_bad_kwarg_error, line 1243



This is as rev 1330.

Offline

Board footer

Moderator control

Enjoy the 27th of April
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support