File: fields.py

package info (click to toggle)
python-model-bakery 1.20.5-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 532 kB
  • sloc: python: 4,298; sh: 149; makefile: 21
file content (25 lines) | stat: -rw-r--r-- 438 bytes parent folder | download | duplicates (3)
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
from django.db import models


class CustomFieldWithGenerator(models.TextField):
    pass


class CustomFieldWithoutGenerator(models.TextField):
    pass


class CustomFieldViaSettings(models.TextField):
    pass


class FakeListField(models.TextField):
    def to_python(self, value):
        return value.split()

    def get_prep_value(self, value):
        return " ".join(value)


class CustomForeignKey(models.ForeignKey):
    pass