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

Event.has_object_read_permission()   A

Complexity

Conditions 1

Size

Total Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 2
rs 10
cc 1
1
from django.db import models
2
3
from sigma_core.models.group import Group
4
from sigma_core.models.publication import Publication
5
6
class Event(models.Model):
7
8
    ################################################################
9
    # CONSTANTS                                                    #
10
    ################################################################
11
12
    ################################################################
13
    # FIELDS                                                       #
14
    ################################################################
15
16
    name = models.CharField(max_length=255)
17
    related_publication = models.ForeignKey(Publication)
18
    description = models.CharField(max_length=1400)
19
20
    date_start = models.DateTimeField()
21
    date_end = models.DateTimeField()
22
    place_name = models.CharField(max_length=255)
23
    # ToDo : place_localisation
24
25
    ################################################################
26
    # PERMISSIONS                                                  #
27
    ################################################################
28
29
    def has_object_read_permission(self, request):
30
        return True
31
32
    @staticmethod
33
    def has_read_permission(request):
34
        return True
35
36
    def has_object_write_permission(self, request):
37
        return True
38
39
    @staticmethod
40
    def has_write_permission(request):
41
        return True
42