How to use the dispatch.apps.core.models.Person function in dispatch

To help you get started, we’ve selected a few dispatch examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ubyssey / dispatch / dispatch / modules / auth / tests.py View on Github external
def test_user_str(self):
        self.assertEquals(self.u1.__str__(), self.EMAIL)
        p1 = Person(full_name="John Doe")
        p1.save()
        self.u1.person = p1
        self.u1.save()
        self.assertEquals(self.u1.__str__(), "John Doe")
github ubyssey / dispatch / dispatch / modules / content / models.py View on Github external
try:
            revision = type(self).objects.filter(parent=self.parent).order_by('-pk')[1]
            return revision
        except:
            return self

    class Meta:
        abstract = True

class Article(Publishable):

    parent = ForeignKey('Article', related_name='article_parent', blank=True, null=True)

    headline = CharField(max_length=255)
    section = ForeignKey('Section')
    authors = ManyToManyField(Person, through="Author")
    topic = ForeignKey('Topic', null=True)
    tags = ManyToManyField('Tag')

    IMPORTANCE_CHOICES = [(i,i) for i in range(1,6)]

    importance = PositiveIntegerField(validators=[MaxValueValidator(5)], choices=IMPORTANCE_CHOICES, default=3)

    READING_CHOICES = (
        ('anytime', 'Anytime'),
        ('morning', 'Morning'),
        ('midday', 'Midday'),
        ('evening', 'Evening'),
    )

    reading_time = CharField(max_length=100, choices=READING_CHOICES, default='anytime')