You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

0001_initial.py 1.5KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. from django.db import migrations, models
  2. class Migration(migrations.Migration):
  3. dependencies = [
  4. ('sites', '0001_initial'),
  5. ]
  6. operations = [
  7. migrations.CreateModel(
  8. name='Redirect',
  9. fields=[
  10. ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
  11. ('site', models.ForeignKey(
  12. to='sites.Site',
  13. to_field='id',
  14. on_delete=models.CASCADE,
  15. verbose_name='site',
  16. )),
  17. ('old_path', models.CharField(
  18. help_text=(
  19. "This should be an absolute path, excluding the domain name. Example: '/events/search/'."
  20. ), max_length=200, verbose_name='redirect from', db_index=True
  21. )),
  22. ('new_path', models.CharField(
  23. help_text="This can be either an absolute path (as above) or a full URL starting with 'http://'.",
  24. max_length=200, verbose_name='redirect to', blank=True
  25. )),
  26. ],
  27. options={
  28. 'ordering': ('old_path',),
  29. 'unique_together': {('site', 'old_path')},
  30. 'db_table': 'django_redirect',
  31. 'verbose_name': 'redirect',
  32. 'verbose_name_plural': 'redirects',
  33. },
  34. bases=(models.Model,),
  35. ),
  36. ]