Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7917985
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T15:21:02+00:00 2026-06-03T15:21:02+00:00

I am using Django Non-rel and Django-MongoDB ORM for my project with MongoDB Nosql

  • 0

I am using “Django Non-rel” and Django-MongoDB ORM” for my project with MongoDB Nosql database. I need to change one of my model and add a ForeignKey field to it.I thought that South would help in data migration but i got to know that South doesnot support MongoDB.My model is like this:

class Projects(models.Model):
    projectName =models.CharField(max_length = 100,unique=True,db_index=True)
    projectManager = models.ForeignKey('auth.User')

I need to add states = models.ForeignKey('States') to my model.But i have no idea how to do this without south so that it doesnot create problem in my existing database.Please help guys 🙁

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T15:21:04+00:00Added an answer on June 3, 2026 at 3:21 pm

    I’m using django non-rel on appengine, this might not translate perfectly to MongoDB, but I suspect it’s the same.

    I’ve been doing the following, it takes a few steps.

    1. Updated your model with null=True:
      projectManager = models.ForeignKey(‘auth.User’, null=True)

    This ensures that your existing models in the database are not going to cause Django to throw exceptions.

    1. Write a script that will query all Projects and update their projectManager fields

    2. Update the model again with null=False
      projectManager = models.ForeignKey(‘auth.User’)

    Now that none of the objects in the DB have a null field for projectManager, it’s ok to remove the null flag.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using the Django ORM in a non-Django application and would like to turn
I'm using django non-rel ( http://www.allbuttonspressed.com/projects/django-nonrel ) and am trying to delete all the
My application uses Django non-rel . I don't have access to model. I have
I'm using django-non rel for the first time. I already had a simple django
I am using django-nonrel and django-mongodb-engine I have a Django model stored on PostgreSQL
By using django ORM: How to match the result in database is NOT null?
I'm developing an application on Google App Engine using the current django non-rel and
I'm using the django-mongodb-engine, django-nonrel, djangotoolbox projects / packages to get django talking with
using django 1.4 I have a model with a datetimefield. I imported django.utils.timezone to
I using Django tagging project. That is was very stable project. Working on django

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.