-
Notifications
You must be signed in to change notification settings - Fork 0
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
Groups implemented #25
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good, submission.group_id should indeed be not nullable but this works for now
Group_id was nullable so that a submission could be part of a student OR of a group, so one of the fields needed to be null. But in this version indeed, it can't be NULL. Migrating when removing the NULL constraction gives some problems considering the row now has missing values. But considering that we are working with an empty database we could use the trick of removing the auto-generated files in migrations (except |
-> the objects property makes it easy to get: - all values in table - filter values - count values ... - final_score field has been moved from group to project - Conditions model has been made to save requested conditions for a project, including 2 models for forbidden/allowed extension - Migrations have been reset to handle new models and constraints
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I get this error when executing migrate/makemigrations:
`System check identified some issues:
WARNINGS:
users.Student.id: (fields.W342) Setting unique=True on a ForeignKey has the same effect as using a OneToOneField.
HINT: ForeignKey(unique=True) is usually better served by a OneToOneField.
users.Teacher.id: (fields.W342) Setting unique=True on a ForeignKey has the same effect as using a OneToOneField.
HINT: ForeignKey(unique=True) is usually better served by a OneToOneField.
CommandError: Conflicting migrations detected; multiple leaf nodes in the migration graph: (0002_alter_submissions_file, 0002_alter_submissions_file_alter_submissions_output_test in submissions).
To fix them run 'python manage.py makemigrations --merge'`
what happens when you run python manage.py makemigrations --merge |
It made some new migration files, looks like it works. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be finished
Groups in now implemented in the models and I added some fields.
I am not sure if the migrations work.