3 ms·
1) Yes, it is possible to subclass the ModelBackend. That's not the only step involved in switching from username based logins to email based logins, however, s
by stevenwei 16y ago
1) Yes, it is possible to subclass the ModelBackend. That's not the only step involved in switching from username based logins to email based logins, however, since the default User definition has defined a required username CharField that takes some hackery to get around.
2) Symfony does the same thing with a one to one User <-> Profile relationship. I find this to be a silly hack in both frameworks that creates extra database JOINs for no reason. If I want to place a foreign key on the user table because multiple Users can belong to a single Account, I shouldn't have to go through an additional join table.
3) You can configure Doctrine to raise an exception if you try to save() a model object with invalid fields, and check if the fields are valid at any time with isValid(). It makes a lot more sense to me to do this at the model level since there are many scenarios where you still want validation and aren't actually using forms of any sort.