-
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
Add feedback model #111
Add feedback model #111
Conversation
Migrations for 'mod_app': mod_app/migrations/0023_alter_bibliographyitem_full_citation_and_more.py - Alter field full_citation on bibliographyitem - Alter field short_citation on bibliographyitem - Alter field format_type on film - Alter field bibliography on projectnote - Create model Feedback
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 thought there were some unnecessary migrations but looking more closely they all seem to make sense (except the changes to the Film model but that's related to #112 )
migrations.AlterField( | ||
model_name="bibliographyitem", | ||
name="full_citation", | ||
field=ckeditor.fields.RichTextField( | ||
help_text="Please use Harvard reference list style. Examples: Author surname, initial. (year). 'Title of article/book/website/photograph'. Available at: URL or DOI where applicable (date accessed). Please note that the website or photo title should be italicised. For more detailed information and examples visit: https://www5.open.ac.uk/library/referencing-and-plagiarism/quick-guide-to-harvard-referencing-cite-them-right", | ||
null=True, | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="bibliographyitem", | ||
name="short_citation", | ||
field=models.CharField( | ||
help_text="Please use Harvard in-text citation style. Examples: (Author surname, year), or in the case of up to 3 authors: (Author 1 surname, Author 2 surname, Author 3 surname, year), or in the case or more than 3 authors: (Author 1 surname, et al., year) ", | ||
max_length=200, | ||
null=True, | ||
), | ||
), |
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.
these look the same as
migrations.AlterField( | |
model_name="bibliographyitem", | |
name="full_citation", | |
field=ckeditor.fields.RichTextField( | |
help_text="Please use Harvard reference list style. Examples: Author surname, initial. (year). 'Title of article/book/website/photograph'. Available at: URL or DOI where applicable (date accessed). Please note that the website or photo title should be italicised. For more detailed information and examples visit: https://www5.open.ac.uk/library/referencing-and-plagiarism/quick-guide-to-harvard-referencing-cite-them-right", | |
null=True, | |
), | |
), | |
migrations.AlterField( | |
model_name="bibliographyitem", | |
name="short_citation", | |
field=models.CharField( | |
help_text="Please use Harvard in-text citation style. Examples: (Author surname, year), or in the case of up to 3 authors: (Author 1 surname, Author 2 surname, Author 3 surname, year), or in the case or more than 3 authors: (Author 1 surname, et al., year) ", | |
max_length=200, | |
null=True, | |
), | |
), |
However, the previous migrations include two spaces after full stops whereas the new migrations have a single space
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.
Ah we might need to do something with linting then? We have some set up but maybe they need to be more strict
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.
We could add a check in CI to make sure there are no missing migrations:
python manage.py makemigrations --check --dry-run --no-input
which I think would fail if there are any migrations missing. If this runs on every PR then it should help avoid merging anything with missing migrations
migrations.AlterField( | ||
model_name="projectnote", | ||
name="bibliography", | ||
field=models.ManyToManyField( | ||
blank=True, | ||
help_text="This field updates on save, and some items may not be visible immediately", | ||
related_name="project_notes", | ||
to="mod_app.bibliographyitem", | ||
), | ||
), |
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.
this looks similar to the migration from when the model was created:
museum_of_dreams/mod_app/migrations/0021_add_project_notes_model.py
Lines 33 to 41 in 90db50e
( | |
"bibliography", | |
models.ManyToManyField( | |
blank=True, | |
help_text="This field updates on save, and some items may not be visible immediately", | |
related_name="project_note", | |
to="mod_app.bibliographyitem", | |
), | |
), |
but the
related_name
has changed from project_note
to project_notes
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.
Ah, the model definition and the migration differ, I've pushed a fix to change the version on the model since that's more straightforward than fixing previous migrations
migrations.AlterField( | ||
model_name="film", | ||
name="format_type", | ||
field=models.CharField( | ||
choices=[ | ||
("16", "16 mm"), | ||
("70", "70 mm"), | ||
("other", "Other"), | ||
("9.5", "9.5 mm"), | ||
("35", "35 mm"), | ||
], | ||
default="35", | ||
max_length=5, | ||
verbose_name="format", | ||
), | ||
), |
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.
this field changes every time python manage.py makemigrations
is ran. I've opened an issue (#112) and will submit a PR to fix it once this is merged
to="mod_app.bibliographyitem", | ||
), | ||
), | ||
migrations.CreateModel( |
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.
Everything before this in the operations should probably be deleted since they should've been covered in earlier migrations, unsure why it keeps doing this.
Should probably rename the file to something like "0023_add_feedback_model.py"
Otherwise all looks good
migrations.AlterField( | ||
model_name="bibliographyitem", | ||
name="full_citation", | ||
field=ckeditor.fields.RichTextField( | ||
help_text="Please use Harvard reference list style. Examples: Author surname, initial. (year). 'Title of article/book/website/photograph'. Available at: URL or DOI where applicable (date accessed). Please note that the website or photo title should be italicised. For more detailed information and examples visit: https://www5.open.ac.uk/library/referencing-and-plagiarism/quick-guide-to-harvard-referencing-cite-them-right", | ||
null=True, | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="bibliographyitem", | ||
name="short_citation", | ||
field=models.CharField( | ||
help_text="Please use Harvard in-text citation style. Examples: (Author surname, year), or in the case of up to 3 authors: (Author 1 surname, Author 2 surname, Author 3 surname, year), or in the case or more than 3 authors: (Author 1 surname, et al., year) ", | ||
max_length=200, | ||
null=True, | ||
), | ||
), |
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.
Ah we might need to do something with linting then? We have some set up but maybe they need to be more strict
migrations.AlterField( | ||
model_name="projectnote", | ||
name="bibliography", | ||
field=models.ManyToManyField( | ||
blank=True, | ||
help_text="This field updates on save, and some items may not be visible immediately", | ||
related_name="project_notes", | ||
to="mod_app.bibliographyitem", | ||
), | ||
), |
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.
Ah, the model definition and the migration differ, I've pushed a fix to change the version on the model since that's more straightforward than fixing previous migrations
dashboard.py
Outdated
@@ -53,6 +53,7 @@ def init_with_context(self, context): | |||
"mod_app.models.teaching_analysis_models.*", | |||
"mod_app.models.bibliography_model.*", | |||
"mod_app.models.project_note_model.ProjectNote", | |||
"mod_app.models.feedback_model.Feedback", |
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.
this should be under the "Extras" section. It also doesn't show up since we do actually have to register it in the admin (I was wrong)
You can add it to admin/note_admin.py
and use the ProjectNoteAdmin
as a template
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.
oh I see, thanks!
Resolves #107
Feedback
modelThere seem to be some migrations unrelated to the new model for some reasonFeedback
model to the admin view