Refactor school class naming

This commit is contained in:
Ramon Wenger 2018-10-08 10:52:55 +02:00
parent 85cc99470e
commit d970f75fa4
6 changed files with 7 additions and 7 deletions

View File

@ -48,7 +48,7 @@
return this.$store.state.filterForSchoolClass;
},
schoolClasses() {
return this.$getRidOfEdges(this.me.schoolclassSet);
return this.$getRidOfEdges(this.me.schoolClasses);
},
showEverythingRadioButton() {
return this.me.permissions.includes('user.can_edit_modules');

View File

@ -63,7 +63,7 @@
computed: {
schoolClasses() {
return this.$getRidOfEdges(this.me.schoolclassSet);
return this.$getRidOfEdges(this.me.schoolClasses);
},
schoolClassVisibility() {

View File

@ -60,7 +60,7 @@
computed: {
schoolClasses() {
return this.$getRidOfEdges(this.me.schoolclassSet);
return this.$getRidOfEdges(this.me.schoolClasses);
}
},

View File

@ -7,7 +7,7 @@ fragment UserParts on UserNode {
firstName
lastName
avatar
schoolclassSet {
schoolClasses {
edges {
node {
...SchoolClassParts

View File

@ -47,7 +47,7 @@ class SchoolClass(models.Model):
name = models.CharField(max_length=100, blank=False, null=False)
year = models.PositiveIntegerField(blank=False, null=False, validators=[MinValueValidator(1900), MaxValueValidator(2200)])
is_deleted = models.BooleanField(blank=False, null=False, default=False)
users = models.ManyToManyField(get_user_model())
users = models.ManyToManyField(get_user_model(), related_name='school_classes')
school = models.ForeignKey('School', null=False, on_delete=models.CASCADE)
def __str__(self):
@ -130,7 +130,7 @@ class SchoolRoleManager(models.Manager):
class SchoolRole(models.Model):
key = models.CharField(_('Key'), max_length=100, blank=False, null=False)
name = models.CharField(_(u'Name'), max_length=100, blank=False, null=False)
name = models.CharField(_('Name'), max_length=100, blank=False, null=False)
school = models.ForeignKey('School', blank=False, null=False, on_delete=models.CASCADE)
role_permission = models.ManyToManyField(Permission, verbose_name=_('Role permission'),
blank=True, related_name="role_set", related_query_name="role")

View File

@ -14,7 +14,7 @@ class UserNode(DjangoObjectType):
class Meta:
model = User
filter_fields = ['username', 'email']
only_fields = ['username', 'email', 'first_name', 'last_name', 'schoolclass_set', ]
only_fields = ['username', 'email', 'first_name', 'last_name', 'school_classes', ]
interfaces = (relay.Node,)
def resolve_pk(self, info, **kwargs):