Completed
Push — master ( c4beda...275057 )
by
unknown
01:44
created

Participation.has_read_permission()   A

Complexity

Conditions 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 3
rs 10
cc 1
1
from django.db import models
2
3
from sigma_core.models.user import User
4
from sigma_core.models.event import Event
5
6
class Participation(models.Model):
7
8
    ################################################################
9
    # CONSTANTS                                                    #
10
    ################################################################
11
12
    POSSIBLE_STATUS = (
13
        (0, 'Invited'),
14
        (1, 'Interested'),
15
        (2, 'Partipates'),
16
    )
17
18
    ################################################################
19
    # FIELDS                                                       #
20
    ################################################################
21
22
    user = models.ForeignKey(User)
23
    event = models.ForeignKey(Event)
24
    status = models.IntegerField(choices=POSSIBLE_STATUS)
25
26
    ################################################################
27
    # PERMISSIONS                                                  #
28
    ################################################################
29
30
    def has_object_read_permission(self, request):
31
        return True
32
33
    @staticmethod
34
    def has_read_permission(request):
35
        return True
36
37
    def has_object_write_permission(self, request):
38
        return True
39
40
    @staticmethod
41
    def has_write_permission(request):
42
        return True
43