Skip to content

Commit

Permalink
Document more related fields in sigma_core
Browse files Browse the repository at this point in the history
  • Loading branch information
TheBirdie authored and TheBirdie committed Feb 15, 2016
1 parent da2ce5b commit ac712de
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
5 changes: 4 additions & 1 deletion sigma_core/models/group.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from sigma_core.models.custom_field import CustomField
from sigma_core.models.group_field import GroupField


class Group(models.Model):
#########################
# Constants and choices #
Expand Down Expand Up @@ -46,7 +45,11 @@ class Group(models.Model):
# - users (model User)
# - fields (model GroupField)
# - posts (model GroupPost)
# - publications (model Publication through GroupPost)
# - created_publications (model Publication)
# - publications (model Publication through GroupPost)
# Publications posted IN this group (different from `created_publications`)

# TODO: Determine whether 'memberships' fields needs to be retrieved every time or not...

@property
Expand Down
3 changes: 2 additions & 1 deletion sigma_core/models/group_member_value.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
from django.db import models

from sigma_core.models.group_field import GroupField
from sigma_core.models.group_member import GroupMember
from sigma_core.models.user import User

class GroupMemberValue(models.Model):
class Meta:
unique_together = (("membership", "field"),)

membership = models.ForeignKey('GroupMember', related_name='values')
membership = models.ForeignKey(GroupMember, related_name='values')
field = models.ForeignKey('GroupField', related_name='+')
value = models.CharField(max_length=GroupField.FIELD_VALUE_MAX_LENGTH)

Expand Down
2 changes: 1 addition & 1 deletion sigma_core/models/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class User(AbstractBaseUser):
# Related fields:
# - memberships (model Group through GroupMember)
# - created_publications (model Publication)
# - comments (PublicationComment)
# - comments (model PublicationComment)

USERNAME_FIELD = 'email'
REQUIRED_FIELDS = ['lastname', 'firstname']
Expand Down

0 comments on commit ac712de

Please sign in to comment.