#internet management system tips django

11 messages · Page 1 of 1 (latest)

severe bough
#

Hi i will create a soft for my isp i would like to use django . i have one question i need some tips:
my db is mysql

  1. i got a clients table, that table have like 15 custom fields
  2. i got admin table
  3. app will have admin dashboard and another for client like /admin and /client

should i use only one 'users' table? and got another like user_details(table will have the 15 custom fields of clients) linked to user_id ? whats the best approach for me?

thank you

azure mason
#

I don't see any details to give a recommendations

#

there are 2 basic approaches - custom user model or one-to-one extension with "profile" model.
You can also use both at same time.
Either is pretty much fine

severe bough
#

so you think is better one user table? for both admin client?

azure mason
#

I have no details what are admin and client. I named general approach on users

severe bough
#

i have administrators in one table they login to /admin, i got clients in another table and they will be in /clients dashboard, the thing is clients got 15 custom fields, not sure if i need two user model or something else

azure mason
#

django doesn't really support multiple user models

severe bough
#

ok

azure mason
#

If you have two roles for users - permissions or groups might be fine to separate them
If one needs additional fields - either add a o2o model for them, or add it to base user model and just not fill when not needed

#

I prefer not to use o2o when there is no other reasons for it - because then you need to keep in check when it exists or needs creation. But basically either works

severe bough
#

Yea thats what i thought. I created two groups admin and client and in the user model created all custom fields and two separated pages. One to list admin without custom fields and another for client