Python论坛  - 讨论区

标题:[python-chinese] [Django]扩展auth模块产生用户上下级关系

2008年01月13日 星期日 19:18

Gawain Bai wike1985在gmail.com
星期日 一月 13 19:18:08 HKT 2008

如何把auth模块中的User扩展产生上下级关系?

我新建了 一个model是这样写的,老是报错。
from django.contrib.auth.models import User
class UserRelation(models.Model):
    User = models.ForeignKey(User)
    Superior = models.ForeignKey(User)

-- 
#~~~~
class khsing:
    def __init__(self):
        self.name='Gawain Bai'
        self.blog='http://blog.khsing.net'
        self.home='Jail'
#coding... ...

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2008年01月13日 星期日 20:01

@@ askfor在gmail.com
星期日 一月 13 20:01:29 HKT 2008

¶à¸öFKÖ¸Ïòͬһ¸ö±íÓ¦¸ÃÒªÖƶ¨Ò»¸öÃû×Ö°É

On Jan 13, 2008 7:18 PM, Gawain Bai <wike1985在gmail.com> wrote:

> ÈçºÎ°ÑauthÄ£¿éÖеÄUserÀ©Õ¹²úÉúÉÏϼ¶¹Øϵ£¿
>
> ÎÒн¨ÁË Ò»¸ömodelÊÇÕâÑùдµÄ£¬ÀÏÊDZ¨´í¡£
> from django.contrib.auth.models import User
> class UserRelation(models.Model):
>    User = models.ForeignKey(User)
>    Superior = models.ForeignKey(User)
>
> --
> #~~~~
> class khsing:
>    def __init__(self):
>        self.name='Gawain Bai'
>        self.blog='http://blog.khsing.net'
>        self.home='Jail'
> #coding... ...
> _______________________________________________
> python-chinese
> Post: send python-chinese在lists.python.cn
> Subscribe: send subscribe to python-chinese-request在lists.python.cn
> Unsubscribe: send unsubscribe to  python-chinese-request在lists.python.cn
> Detail Info: http://python.cn/mailman/listinfo/python-chinese
-------------- 下一部分 --------------
Ò»¸öHTML¸½¼þ±»ÒƳý...
URL: http://python.cn/pipermail/python-chinese/attachments/20080113/3b39805f/attachment.html 

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2008年01月13日 星期日 23:28

leopay leopay在gmail.com
星期日 一月 13 23:28:05 HKT 2008

ÒªÖ¸Ã÷related name

On 1/13/08, @@ <askfor在gmail.com> wrote:
>
> ¶à¸öFKÖ¸Ïòͬһ¸ö±íÓ¦¸ÃÒªÖƶ¨Ò»¸öÃû×Ö°É
>
> On Jan 13, 2008 7:18 PM, Gawain Bai <wike1985在gmail.com> wrote:
>
> > ÈçºÎ°ÑauthÄ£¿éÖеÄUserÀ©Õ¹²úÉúÉÏϼ¶¹Øϵ£¿
> >
> > ÎÒн¨ÁË Ò»¸ömodelÊÇÕâÑùдµÄ£¬ÀÏÊDZ¨´í¡£
> > from django.contrib.auth.models import User
> > class UserRelation(models.Model):
> >    User = models.ForeignKey(User)
> >    Superior = models.ForeignKey(User)
> >
> > --
> > #~~~~
> > class khsing:
> >    def __init__(self):
> >        self.name='Gawain Bai'
> >         self.blog='http://blog.khsing.net'
> >        self.home='Jail'
> > #coding... ...
> > _______________________________________________
> > python-chinese
> > Post: send python-chinese在lists.python.cn
> > Subscribe: send subscribe to python-chinese-request在lists.python.cn
> > Unsubscribe: send unsubscribe to  python-chinese-request在lists.python.cn
> > Detail Info: http://python.cn/mailman/listinfo/python-chinese
>
>
>
> _______________________________________________
> python-chinese
> Post: send python-chinese在lists.python.cn
> Subscribe: send subscribe to python-chinese-request在lists.python.cn
> Unsubscribe: send unsubscribe to  python-chinese-request在lists.python.cn
> Detail Info: http://python.cn/mailman/listinfo/python-chinese
>
-------------- 下一部分 --------------
Ò»¸öHTML¸½¼þ±»ÒƳý...
URL: http://python.cn/pipermail/python-chinese/attachments/20080113/a1d4f80d/attachment.htm 

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

如下红色区域有误,请重新填写。

    你的回复:

    请 登录 后回复。还没有在Zeuux哲思注册吗?现在 注册 !

    Zeuux © 2024

    京ICP备05028076号