On Thu, Jan 23, 2014 at 11:25 PM, Carl Meyer <[email protected]> wrote:
> Hi Ryan, > > On 01/23/2014 09:50 PM, Ryan Hiebert wrote: > > Assuming that the changes from the deprecation policy are in trunk now > > that the alpha has landed, any use of the AUTH_PROFILE_MODULE must be > > eliminated _before_ moving to 1.7, since they are not just deprecated, > > but _removed_ in 1.7. Migrating to 1.7 will _break_ code that uses it. > > This is normal and expected. > > > > Since the new migration system lands in 1.7, and AUTH_PROFILE_MODULE is > > removed in 1.7, then it is clear that it won't be possible to use the > > new migration system to do the custom migrations that may be required to > > stop using the AUTH_PROFILE_MODULE. > > I think this is the point of confusion. No migrations are required to > stop using AUTH_PROFILE_MODULE, since the AUTH_PROFILE_MODULE feature > does not affect the database in any way, it simply changes (very > slightly) the code you use to access the database. > > If you have a Profile model in an "accounts" app, and you have > AUTH_PROFILE_MODULE set to "accounts.Profile", here are the sum total of > steps needed to stop using AUTH_PROFILE_MODULE: > > 1. Remove the AUTH_PROFILE_MODULE setting. > > 2. Replace occurrences of "user.get_profile()" in your code with > "user.profile". > > Note the lack of any database migrations in those steps. > > > Allowing one more release before AUTH_PROFILE_MODULE is removed would > > allow him to use the new migration system to create a custom migration > > to migrate away from using the profiles. Otherwise, he'd need to use > > South or go through two code change cycles. > > You are correct that _if_ you should happen to _also_ want to move the > data you are storing in the Profile table to somewhere else, you won't > be able to do that using a Django 1.7 migration at the exact same time > as you remove the occurrences of "user.get_profile()" in your code. But > there's no particular reason the removal of AUTH_PROFILE_MODULE should > make you want to move data out of the Profile table, unless it just > happened to remind you that you'd been wanting to do that anyway. > > So I think in a sense you and Russell are both right :-) But I don't > think there's a strong enough case here to justify extending the > lifetime of AUTH_PROFILE_MODULE. There's no harm in changing > "user.get_profile()" to "user.profile" right now, and then waiting until > 1.7 to do your migration. Or if you really want to do them in a single > change to your codebase, you just do it now under Django 1.5 or 1.6 > using South. > Thanks Carl. I suspected that the code migration is seen as a small enough issue not to warrant keeping get_profile() around, thanks for understanding and answering that specifically. I think that's what the OP was all about, and I wanted to make sure we all understood the tradeoff. I personally use South, so this is not any issue for me, but I understand the use case being presented. -- You received this message because you are subscribed to the Google Groups "Django developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/django-developers. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CABpHFHSjS8S85e12kayTVmc-Jz2H9x0hVo4EgnkmOTqF7J5gRg%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.
