Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

INTR-305 - Move the events models/code into the content app - Step 1 #756

Draft
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

david-okeke1337
Copy link
Contributor

@david-okeke1337 david-okeke1337 commented Sep 26, 2024

Incoming Changes:

  • Moved events app models into a new events.py file in the content app.
  • Split out the content/models.py file into base_content.py, blog.py and search.py

Todo:

Checklist:

  • JIRA ticket referenced in title
  • Title is clear and concise
  • Description gives any relevant detail
  • Tests are up to date
  • Documentation is up to date

@david-okeke1337 david-okeke1337 requested a review from a team as a code owner September 26, 2024 10:15
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently, Django is looking in the models.py file to find the model definitions. If we delete this file and rename the directory from model to models then Django will look in the models/__init__.py file for the definitions.

We can update the __init__.py file to import the models defined in each of the new files

@@ -0,0 +1,148 @@
from datetime import datetime as dt
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once the changes from the previous message have been made, you can run ./manage.py makemigrations which will create the event models in the content app.

When these models have been created, we can create a data migration to copy the data from the events app to the content app.

@CamLamb CamLamb marked this pull request as draft October 17, 2024 11:18
@CamLamb
Copy link
Contributor

CamLamb commented Oct 17, 2024

Marked this PR as a draft as it is being actively worked on and is not ready for review/merging

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants