Skip to content

Commit 373e5f7

Browse files
committed
add migration
1 parent aac971f commit 373e5f7

File tree

3 files changed

+248
-2
lines changed

3 files changed

+248
-2
lines changed
Lines changed: 248 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,248 @@
1+
# Generated by Django 5.1.2 on 2024-11-26 14:21
2+
3+
import _socket
4+
import django.core.validators
5+
import django.db.models.deletion
6+
import django_audit_fields.fields.hostname_modification_field
7+
import django_audit_fields.fields.userfield
8+
import django_audit_fields.models.audit_model_mixin
9+
import django_revision.revision_field
10+
import edc_pharmacy.models.stock.location
11+
import simple_history.models
12+
import uuid
13+
from django.conf import settings
14+
from django.db import migrations, models
15+
16+
17+
class Migration(migrations.Migration):
18+
19+
dependencies = [
20+
("edc_pharmacy", "0052_formulation_imp_formulation_imp_description_and_more"),
21+
("sites", "0002_alter_domain_unique"),
22+
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
23+
]
24+
25+
operations = [
26+
migrations.AlterModelManagers(
27+
name="location",
28+
managers=[
29+
("objects", edc_pharmacy.models.stock.location.Manager()),
30+
],
31+
),
32+
migrations.AlterField(
33+
model_name="historicalstock",
34+
name="lot",
35+
field=models.ForeignKey(
36+
blank=True,
37+
db_constraint=False,
38+
null=True,
39+
on_delete=django.db.models.deletion.DO_NOTHING,
40+
related_name="+",
41+
to="edc_pharmacy.lot",
42+
verbose_name="Batch",
43+
),
44+
),
45+
migrations.AlterField(
46+
model_name="stock",
47+
name="lot",
48+
field=models.ForeignKey(
49+
null=True,
50+
on_delete=django.db.models.deletion.PROTECT,
51+
to="edc_pharmacy.lot",
52+
verbose_name="Batch",
53+
),
54+
),
55+
migrations.CreateModel(
56+
name="HistoricalLocation",
57+
fields=[
58+
(
59+
"revision",
60+
django_revision.revision_field.RevisionField(
61+
blank=True,
62+
editable=False,
63+
help_text="System field. Git repository tag:branch:commit.",
64+
max_length=75,
65+
null=True,
66+
verbose_name="Revision",
67+
),
68+
),
69+
(
70+
"created",
71+
models.DateTimeField(
72+
blank=True, default=django_audit_fields.models.audit_model_mixin.utcnow
73+
),
74+
),
75+
(
76+
"modified",
77+
models.DateTimeField(
78+
blank=True, default=django_audit_fields.models.audit_model_mixin.utcnow
79+
),
80+
),
81+
(
82+
"user_created",
83+
django_audit_fields.fields.userfield.UserField(
84+
blank=True,
85+
help_text="Updated by admin.save_model",
86+
max_length=50,
87+
verbose_name="user created",
88+
),
89+
),
90+
(
91+
"user_modified",
92+
django_audit_fields.fields.userfield.UserField(
93+
blank=True,
94+
help_text="Updated by admin.save_model",
95+
max_length=50,
96+
verbose_name="user modified",
97+
),
98+
),
99+
(
100+
"hostname_created",
101+
models.CharField(
102+
blank=True,
103+
default=_socket.gethostname,
104+
help_text="System field. (modified on create only)",
105+
max_length=60,
106+
verbose_name="Hostname created",
107+
),
108+
),
109+
(
110+
"hostname_modified",
111+
django_audit_fields.fields.hostname_modification_field.HostnameModificationField(
112+
blank=True,
113+
help_text="System field. (modified on every save)",
114+
max_length=50,
115+
verbose_name="Hostname modified",
116+
),
117+
),
118+
(
119+
"device_created",
120+
models.CharField(blank=True, max_length=10, verbose_name="Device created"),
121+
),
122+
(
123+
"device_modified",
124+
models.CharField(
125+
blank=True, max_length=10, verbose_name="Device modified"
126+
),
127+
),
128+
(
129+
"locale_created",
130+
models.CharField(
131+
blank=True,
132+
help_text="Auto-updated by Modeladmin",
133+
max_length=10,
134+
null=True,
135+
verbose_name="Locale created",
136+
),
137+
),
138+
(
139+
"locale_modified",
140+
models.CharField(
141+
blank=True,
142+
help_text="Auto-updated by Modeladmin",
143+
max_length=10,
144+
null=True,
145+
verbose_name="Locale modified",
146+
),
147+
),
148+
(
149+
"name",
150+
models.CharField(
151+
db_index=True,
152+
help_text="This is the stored value, required",
153+
max_length=250,
154+
verbose_name="Stored value",
155+
),
156+
),
157+
(
158+
"plural_name",
159+
models.CharField(max_length=250, null=True, verbose_name="Plural name"),
160+
),
161+
(
162+
"display_index",
163+
models.IntegerField(
164+
default=0,
165+
help_text="Index to control display order if not alphabetical, not required",
166+
verbose_name="display index",
167+
),
168+
),
169+
(
170+
"field_name",
171+
models.CharField(
172+
blank=True,
173+
editable=False,
174+
help_text="Not required",
175+
max_length=25,
176+
null=True,
177+
),
178+
),
179+
("extra_value", models.CharField(max_length=250, null=True)),
180+
("version", models.CharField(default="1.0", editable=False, max_length=35)),
181+
("id", models.IntegerField(blank=True, db_index=True)),
182+
(
183+
"display_name",
184+
models.CharField(
185+
blank=True,
186+
db_index=True,
187+
help_text="(suggest 40 characters max.)",
188+
max_length=250,
189+
null=True,
190+
verbose_name="Name",
191+
),
192+
),
193+
("contact_name", models.CharField(blank=True, max_length=150, null=True)),
194+
(
195+
"contact_tel",
196+
models.CharField(
197+
blank=True,
198+
max_length=150,
199+
null=True,
200+
validators=[django.core.validators.RegexValidator("[0-9]{1,15}")],
201+
),
202+
),
203+
("contact_email", models.EmailField(blank=True, max_length=150, null=True)),
204+
(
205+
"history_id",
206+
models.UUIDField(
207+
default=uuid.uuid4, editable=False, primary_key=True, serialize=False
208+
),
209+
),
210+
("history_date", models.DateTimeField(db_index=True)),
211+
("history_change_reason", models.CharField(max_length=100, null=True)),
212+
(
213+
"history_type",
214+
models.CharField(
215+
choices=[("+", "Created"), ("~", "Changed"), ("-", "Deleted")],
216+
max_length=1,
217+
),
218+
),
219+
(
220+
"history_user",
221+
models.ForeignKey(
222+
null=True,
223+
on_delete=django.db.models.deletion.SET_NULL,
224+
related_name="+",
225+
to=settings.AUTH_USER_MODEL,
226+
),
227+
),
228+
(
229+
"site",
230+
models.ForeignKey(
231+
blank=True,
232+
db_constraint=False,
233+
null=True,
234+
on_delete=django.db.models.deletion.DO_NOTHING,
235+
related_name="+",
236+
to="sites.site",
237+
),
238+
),
239+
],
240+
options={
241+
"verbose_name": "historical Location",
242+
"verbose_name_plural": "historical Locations",
243+
"ordering": ("-history_date", "-history_id"),
244+
"get_latest_by": ("history_date", "history_id"),
245+
},
246+
bases=(simple_history.models.HistoricalChanges, models.Model),
247+
),
248+
]
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
{{ formulation }}
22
<BR>{{ containers_per_subject }} x {{ container }}
3-
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
<a title="search by subject_identifier" href="{{ changelist_url }}?q={{ subject_identifier }}">{{ subject_identifier }}</a>
22
<BR>{{ visit_code_and_seq }}
33
<BR>{{ appt_date }}
4-

0 commit comments

Comments
 (0)