Think about how many users and how much extra space those fields will really take in the auth_user table vs. both the complexity and inefficiency of having to do joins whenever you need the extra fields if you keep them in a separate table. You might also consider keeping some of the extra data in a single JSON field if you don't need to search/sort based on the data.
Anthony On Wednesday, December 21, 2016 at 11:13:09 PM UTC-5, Andrew Toole wrote: > > I am quite new to web2py. I am attempting to build an app that will use > Auth to control log-in and membership for access to various parts of the > app. > > I will have different types of users. Some will just come to get info and > leave and we don't need to know much about them. Others will be employees > and will have a bunch of info associated with them that will be used in > various parts of the app. > > My question is how is the best way to link this employee information to > the users? > > E.G. > User 1 is an employee and has "next of kin" and a "charge out rate" (and > lots more info). > > If the current user enters hours worked in a timesheet table, I will need > to associate the current user with their "charge out rate" (knowing the > current user is User1 in the other table). > > One option is as additional fields in Auth, but my concern is that I am > adding a lot of fields which will be empty for most users. Is this the best > approach or is there another approach? > > Are there more advanced example applications available somewhere? > > Thanks, > Andrew > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.