What is the best way to extend BaseUser #420
Unanswered
jrocketdev
asked this question in
Q&A
Replies: 1 comment 2 replies
-
@rogersjw In my own apps I usually create a class Profile(Table):
user = ForeignKey(BaseUser)
phone_number = Varchar() There isn't an official way at the moment to add fields to the You could copy the entire user app (see source) from Piccolo, and create your own custom app based off it. If you're using Piccolo Admin, then I hope that's helpful. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hopefully the question is self-explanatory enough. I'm new to piccolo, coming from mainly using sqlalchemy previously. I love the 'battery included' BaseUser class and 'user' app. However, I'd like to build in multifactor authentication and would like to add a phone number column to the BaseUser class. What is the most appropriate way to do that while also still taking advantage of the nice 'user' app commands? I can't think of an elegant approach to make sure the migration get updated correctly and I don't break any of the user' app features. I've seen a suggestion to just create a new table with a foreign key but would rather modify the initial table instead for this other column that I will always consider mandatory. Thanks for any help!
Beta Was this translation helpful? Give feedback.
All reactions