File: models.py

package info (click to toggle)
python-xapian-haystack 2.1.1-1%2Bdeb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 352 kB
  • sloc: python: 2,139; sh: 33; makefile: 4
file content (41 lines) | stat: -rw-r--r-- 1,174 bytes parent folder | download | duplicates (5)
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
from django.db import models
from django.contrib.contenttypes.models import ContentType

from ..core.models import MockTag, AnotherMockModel, MockModel, AFourthMockModel


class Document(models.Model):
    type_name = models.CharField(max_length=50)
    number = models.IntegerField()
    name = models.CharField(max_length=200)

    date = models.DateField()

    summary = models.TextField()
    text = models.TextField()


class BlogEntry(models.Model):
    """
    Same as tests.core.MockModel with a few extra fields for testing various
    sorting and ordering criteria.
    """
    datetime = models.DateTimeField()
    date = models.DateField()

    tags = models.ManyToManyField(MockTag)

    author = models.CharField(max_length=255)
    text = models.TextField()
    funny_text = models.TextField()
    non_ascii = models.TextField()
    url = models.URLField()

    boolean = models.BooleanField()
    number = models.IntegerField()
    float_number = models.FloatField()
    decimal_number = models.DecimalField(max_digits=4, decimal_places=2)


class DjangoContentType(models.Model):
    content_type = models.ForeignKey(ContentType, on_delete=models.CASCADE)