It almost comes down to a matter of personal preference and where you want 
your complexity.

One join more or less doesn't mean much.  But you will want to index your 
foreign key on the second table.  That will slow things a bit on inserts.  

You want to make sure your auth_user table has ON DELETE CASCADE set on. 
 That way you don't get orphan rows in the second table.

If some users won't have the attributes in the second table, it's more 
correct to use two tables.  Your database design should avoid empty table 
space.



On Wednesday, August 29, 2012 2:24:33 PM UTC-4, Alec Taylor wrote:
>
> I have been extending my auth_user table with a bunch of new options.
>
> When there's a 1:1 relation with the user, I'll store it in their profile.
>
> On 1:n, I'll keep them in separate tables.
>
> Now I am realising the problems with doing it this way. To make my 
> register form "nice" I have set almost all fields with readable=False and 
> writable=False.
>
> This means that I can no longer use the crud.create or crud.update form 
> creator helpers on those subset of a users' profile I want the form to 
> change for them.
>
> But it also has its advantage: no extra queries are required to grab all 
> the 1:1 fields of a users' profile after login.
>
> Is this enough of an advantage?
>
> Thanks for all suggestions,
>
> Alec Taylor
>

-- 



Reply via email to