Giter VIP home page Giter VIP logo

Comments (3)

lorenzo-pasa avatar lorenzo-pasa commented on June 1, 2024

Ok, I tested the solution and it doesn't fully work.
It allows you to actually start the migration process, but errors are raised by the migration files (they all still use references to "auth.User").

A more deep code refactoring is needed to support Django custom User model...

from django-yarr.

radiac avatar radiac commented on June 1, 2024

Thanks for letting me know about this! I've not used custom user models before, but have had a read around the subject and it looks like your solution should work nicely.

However, you're quite right about the migrations not working with a custom model; this seems to be a problem with South, but it looks like a few people have come up with solutions which I'll try out as soon as I get the chance:

In the meantime, you could either try one of those solutions, or you could manually change yarr's migrations to use your custom user model, by changing orm['auth.User'] and the auth.User definition in the models dict (maybe copy it from a migration in another app).

from django-yarr.

radiac avatar radiac commented on June 1, 2024

I still haven't had a chance to set up a test project with a custom user model, but I have made some untested changes on an experimental branch, custom_user. This should add support to the model, migrations and import_opml management command.

I will test this when I get a chance, but I've pushed it here in case anyone is brave enough to give it a try. If anyone does, do let me know how you get on.

You can do a clean yarr install using it with:

pip install -e git+https://github.com/radiac/django-yarr.git@custom_user#egg=django-yarr

Or if you've already installed it, you could switch to your pip src dir, and pull and check out the new custom_user branch.

Once you've got this branch, make sure your settings.AUTH_USER_MODEL before you first run the migrations.

If you have already installed yarr and set up the database with auth.User, and now want to switch to a custom user model, you will probably need some custom migration voodoo to replace the fk field in Yarr's tables. Exercise left to reader.

from django-yarr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.