/usr/lib/python3/dist-packages/recurrence/models.py is in python3-django-recurrence 1.2.0-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | from django.db import models
import recurrence as recur
from recurrence import managers, choices
class Recurrence(models.Model):
dtstart = models.DateTimeField(null=True, blank=True)
dtend = models.DateTimeField(null=True, blank=True)
objects = managers.RecurrenceManager()
def to_recurrence_object(self):
return Recurrence.objects.to_recurrence_object(self)
class Rule(models.Model):
recurrence = models.ForeignKey(Recurrence, related_name='rules')
mode = models.BooleanField(default=True, choices=choices.MODE_CHOICES)
freq = models.PositiveIntegerField(choices=choices.FREQUENCY_CHOICES)
interval = models.PositiveIntegerField(default=1)
wkst = models.PositiveIntegerField(
default=recur.Rule.firstweekday, null=True, blank=True)
count = models.PositiveIntegerField(null=True, blank=True)
until = models.DateTimeField(null=True, blank=True)
objects = managers.RuleManager()
def to_rule_object(self):
return self.__class__.objects.to_rule_object(self)
class Date(models.Model):
recurrence = models.ForeignKey(Recurrence, related_name='dates')
mode = models.BooleanField(default=True, choices=choices.MODE_CHOICES)
dt = models.DateTimeField()
class Param(models.Model):
rule = models.ForeignKey(Rule, related_name='params')
param = models.CharField(max_length=16)
value = models.IntegerField()
index = models.IntegerField(default=0)
|