Giter Club home page Giter Club logo

course-pick's People

Contributors

dsdshcym avatar

Stargazers

 avatar

Watchers

 avatar  avatar

course-pick's Issues

关于多用户类型的问题

您好:

我在用 django 做一个lab面试预约系统,但是关于多用户类型的问题一直没有解决。搜了很长时间,终于找到了您的项目。非常感谢!

有几个小问题:

class Assistant(models.Model):
    user = models.OneToOneField(User)
    name = models.CharField(max_length=50)
    id = models.CharField(max_length=30, primary_key=True)
    user_type = 'assistant'

    def __str__(self):
        return self.name

如果像这样设置的话,整个验证系统仍然采用系统自带的User 对吧?我看到您在 https://www.v2ex.com/t/187480 提到 考虑过 用 groups 来实现。请问 Group 是如何使用呢...? (实在没有找到明确的文档)

如果不用 group,则您是如何实现的呢?

我看到在 https://github.com/dsdshcym/course-pick/blob/master/course_pick/views.py 里,
您使用:

    user = request.user
    if user.is_authenticated():
        try:
            if user.student:
                return redirect('/courses/student/')
        except:
            pass

请问 user.student 是 怎么来的呀?

您的回答会对我非常有帮助,谢谢~

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.