Giter VIP home page Giter VIP logo

Comments (3)

nineaiyu avatar nineaiyu commented on August 25, 2024

用户设置多个部门 这个可能会出现数据归属问题,正在考虑实现方案, 如果你有好的方案,也可以在此讨论

from xadmin-server.

trajectoryend avatar trajectoryend commented on August 25, 2024

大佬,看下这个方案是否可行:
UserInfo.dept换成下面这个表:


 class UserInfoToDeptInfo(DbAuditModel):
     to_user_info = models.ForeignKey(to='UserInfo', on_delete=models.CASCADE, verbose_name="用户信息")
     to_dept_info = models.ForeignKey(to='DeptInfo', on_delete=models.CASCADE, verbose_name="部门信息")
     is_master = models.BooleanField(verbose_name="是否主部门", default=False)
     is_active = models.BooleanField(verbose_name="是否启用", default=True)

     class Meta:
         verbose_name = "用户所属部门"
         verbose_name_plural = "用户所属部门"
         ordering = ("-date_joined",)
         unique_together = ('to_user_info', 'to_dept_info', 'is_master')

然后数据归属方面:匹配数据的所属部门是否in用户所属的所有部门

from xadmin-server.

nineaiyu avatar nineaiyu commented on August 25, 2024

多部门有点问题,后期再考虑开发,你可以参考 这个分支 https://github.com/nineaiyu/xadmin-server/tree/new-dept

from xadmin-server.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.