I created a module that serves my own authentication system and users. This is a universal module that I use in different applications. This module describes the model User, for example:
class User(db.Model):
email = db.EmailProperty()
password = db.StringProperty()
role = db.StringProperty(default=roles.USER)
In any application in which I use this module, I would like to create an additional model that describes additional fields specific to this application, like this:
class UserProfile(db.Model):
first_name = db.StringProperty()
last_name = db.StringProperty()
company = db.StringProperty()
And I need to attach the model UserProfileto the model Userinside my new application. How can I do this without having to change the code inside the module, which is common to all applications?
source
share