Debian Codegraph @

bitfield/tests/models.py

raw
1 from django.db import models
2
3 from bitfield import BitField, CompositeBitField
4
5
6 class BitFieldTestModel(models.Model):
7 flags = BitField(flags=(
8 'FLAG_0',
9 'FLAG_1',
10 'FLAG_2',
11 'FLAG_3',
12 ), default=3, db_column='another_name')
13
14
15 class CompositeBitFieldTestModel(models.Model):
16 flags_1 = BitField(flags=(
17 'FLAG_0',
18 'FLAG_1',
19 'FLAG_2',
20 'FLAG_3',
21 ), default=0)
22 flags_2 = BitField(flags=(
23 'FLAG_4',
24 'FLAG_5',
25 'FLAG_6',
26 'FLAG_7',
27 ), default=0)
28 flags = CompositeBitField((
29 'flags_1',
30 'flags_2',
31 ))