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

add curriculum models #750

Merged
merged 1 commit into from
Feb 6, 2018
Merged

add curriculum models #750

merged 1 commit into from
Feb 6, 2018

Conversation

Gustry
Copy link
Contributor

@Gustry Gustry commented Feb 6, 2018

Add models for the curriculum
#740

class Curriculum(models.Model):
"""Curriculum lesson model.

A curriculum is a grouping for one or more worksheets.
Copy link
Contributor

Choose a reason for hiding this comment

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

owned by a specific user

from lesson.models.worksheet import Worksheet


class CurriculumWorksheets(models.Model):
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder why we can't just use a manytomany field in the curriculum model. See https://docs.djangoproject.com/en/2.0/topics/db/examples/many_to_many/

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Correct me if I'm wrong, but we can't because we have the sequence number field on the relationship.
https://docs.djangoproject.com/en/dev/topics/db/models/#extra-fields-on-many-to-many-relationships

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah good point - LGTM then!

@Gustry Gustry merged commit 11775f0 into kartoza:develop Feb 6, 2018
@Gustry Gustry removed the in progress label Feb 6, 2018
@Gustry Gustry deleted the curriculum_models branch February 6, 2018 19:04
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.

None yet

3 participants