On Tue, Jun 25, 2013 at 7:58 AM, Victor Rajewski <askvic...@gmail.com>wrote:

> I agree that none of these suggestions are particularly onerous, and I
> have implemented a suitable work-around for my project.
>
> However, looking at the bigger picture:
>
>    - In django <= 1.4, all user objects had a username field, which many
>    apps came to rely on as a human-readable unique identifier of the user
>    - As of django >= 1.5, user objects are no longer guaranteed this
>    field, breaking those apps. However a constant USERNAME_FIELD is defined as
>    the field which contains what would once have qualified as a username
>    - Rather than force those developers to re-write those apps, would it
>    not make sense to implement an alias-type field in BaseAbstractUser model
>    (or via its Manager and Queryset)?
>
> What would be the pros vs cons of this approach?
>

Pros - some code would continue to work without alteration.

Cons - some code would work without alteration, giving the impression that
*all* code might continue to work.

In short, what you're proposing is a solution that partially fixes some of
the problem.

Django 1.5 introduced a new feature. If you don't use that new feature,
your old apps will continue to work. However, you can't claim to have a
fully 1.5 compliant app unless you've done some update work.

The developers don't need to *rewrite* their apps. They need to update
them. And in the grand scheme of things, the updates aren't that
significant -- they all revolve around making your app aware that you need
to start being actively aware of the "user" contract that you are
enforcing. Change some foreign keys. Update some queries. Make sure you're
using using attributes that are guaranteed to exist, or document your user
model requirements. And your'e done.

As far as I can make out, you're proposing a change that will wallpaper
over one very small wart, in a way that is either:

 1) trivial (if you're just proposing a property that aliases username to
the USERNAME_FIELD), or

 2) hideously complex (if you're proposing making username a true alias
that would continue to work throughout the query infrastructure).

in order to save some app developers a very small amount of effort updating
their apps. I'm -1 on this idea.

Yours,
Russ Magee %-)

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to