Django design question: extending User to make users that can't log in
Posted
by jobrahms
on Stack Overflow
See other posts from Stack Overflow
or by jobrahms
Published on 2010-05-01T20:23:51Z
Indexed on
2010/05/01
20:27 UTC
Read the original article
Hit count: 234
The site I'm working on involves teachers creating student objects. The teacher can choose to make it possible for a student to log into the site (to check calendars, etc) OR the teacher can choose to use the student object only for record keeping and not allow the student to log in. In the student creation form, if the teacher supplies a username and a password, it should create an object of the first kind - one that can log in, i.e. a regular User object. If the teacher does not supply a username/password, it should create the second type. The other requirement is that the teacher should be able to go in later and change a non-logging-in student to the other kind. What's the best way to design for this scenario? Subclass User and make username and password not required? What else would this affect?
© Stack Overflow or respective owner