swe574-spring23 / SWE574

BOUN Spring 574 Project
MIT License
0 stars 0 forks source link

DEV | Post to different Spaces #55

Closed sehmuzc closed 1 year ago

sehmuzc commented 1 year ago

Description

1-Spaces field added to post creation form. Users can now post to spaces they select in the post creation form. 2-PostEdit HTML inside the spaces part has been updated as it is being used currently. 3-Post New view updated to give the spaces that user can post to the html part. (Duplicate spaces are being reduced into distinct spaces in first part of the code.) 4-Urls.py part has been cleaned to remove macroeconomy equity parts. 5-Space Owner should not need to join his own space, the if condition is updated. 6-Unit Tests have been added.

ceydaduzgec commented 1 year ago

Why does it have migrations even though models are not changed?

sehmuzc commented 1 year ago

@ceydaduzgec The migrations were automatically generated by Django. Django creates migrations even if the model is not updated because migrations are a way for Django to keep track of changes to the database schema. Even if you haven't made any changes to the model, other changes to your Django project may require a migration to be created. For example, changes to your settings file, installed apps, or dependencies can all trigger the creation of a new migration.

ceydaduzgec commented 1 year ago

@sehmuzc As far as I know migrations are only created when models are updated as it is written in the documentation: https://docs.djangoproject.com/en/4.1/topics/migrations/

Migrations are Django’s way of propagating changes you make to your models (adding a field, deleting a model, etc.) into your database schema. They’re designed to be mostly automatic, but you’ll need to know when to make migrations, when to run them, and the common problems you might run into.

I will search this further cause I don't understand why we have extra migrations.