Debian Codegraph @

django/contrib/redirects/migrations/0001_initial.py

raw
1 from django.db import migrations, models
2
3
4 class Migration(migrations.Migration):
5 dependencies = [
6 ("sites", "0001_initial"),
7 ]
8
9 operations = [
10 migrations.CreateModel(
11 name="Redirect",
12 fields=[
13 (
14 "id",
15 models.AutoField(
16 verbose_name="ID",
17 serialize=False,
18 auto_created=True,
19 primary_key=True,
20 ),
21 ),
22 (
23 "site",
24 models.ForeignKey(
25 to="sites.Site",
26 on_delete=models.CASCADE,
27 verbose_name="site",
28 ),
29 ),
30 (
31 "old_path",
32 models.CharField(
33 help_text=(
34 "This should be an absolute path, excluding the domain "
35 "name. Example: “/events/search/”."
36 ),
37 max_length=200,
38 verbose_name="redirect from",
39 db_index=True,
40 ),
41 ),
42 (
43 "new_path",
44 models.CharField(
45 help_text=(
46 "This can be either an absolute path (as above) or a full "
47 "URL starting with “http://”."
48 ),
49 max_length=200,
50 verbose_name="redirect to",
51 blank=True,
52 ),
53 ),
54 ],
55 options={
56 "ordering": ["old_path"],
57 "unique_together": {("site", "old_path")},
58 "db_table": "django_redirect",
59 "verbose_name": "redirect",
60 "verbose_name_plural": "redirects",
61 },
62 bases=(models.Model,),
63 ),
64 ]