Loading django/contrib/contenttypes/migrations/0001_initial.py 0 → 100644 +33 −0 Original line number Diff line number Diff line # -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='ContentType', fields=[ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('name', models.CharField(max_length=100)), ('app_label', models.CharField(max_length=100)), ('model', models.CharField(max_length=100, verbose_name='python model class name')), ], options={ 'ordering': ('name',), 'db_table': 'django_content_type', 'verbose_name': 'content type', 'verbose_name_plural': 'content types', }, bases=(models.Model,), ), migrations.AlterUniqueTogether( name='contenttype', unique_together=set([('app_label', 'model')]), ), ] django/contrib/contenttypes/migrations/__init__.py 0 → 100644 +0 −0 Empty file added. django/contrib/contenttypes/models.py +2 −0 Original line number Diff line number Diff line from __future__ import unicode_literals from django.apps import apps from django.db import models from django.utils.translation import ugettext_lazy as _ Loading django/contrib/contenttypes/tests/__init__.py 0 → 100644 +0 −0 Empty file added. django/contrib/contenttypes/tests/models.py 0 → 100644 +43 −0 Original line number Diff line number Diff line from django.db import models from django.utils.encoding import python_2_unicode_compatible from django.utils.http import urlquote class ConcreteModel(models.Model): name = models.CharField(max_length=10) class ProxyModel(ConcreteModel): class Meta: proxy = True @python_2_unicode_compatible class FooWithoutUrl(models.Model): """ Fake model not defining ``get_absolute_url`` for ContentTypesTests.test_shortcut_view_without_get_absolute_url() """ name = models.CharField(max_length=30, unique=True) def __str__(self): return self.name class FooWithUrl(FooWithoutUrl): """ Fake model defining ``get_absolute_url`` for ContentTypesTests.test_shortcut_view(). """ def get_absolute_url(self): return "/users/%s/" % urlquote(self.name) class FooWithBrokenAbsoluteUrl(FooWithoutUrl): """ Fake model defining a ``get_absolute_url`` method containing an error """ def get_absolute_url(self): return "/users/%s/" % self.unknown_field Loading
django/contrib/contenttypes/migrations/0001_initial.py 0 → 100644 +33 −0 Original line number Diff line number Diff line # -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='ContentType', fields=[ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('name', models.CharField(max_length=100)), ('app_label', models.CharField(max_length=100)), ('model', models.CharField(max_length=100, verbose_name='python model class name')), ], options={ 'ordering': ('name',), 'db_table': 'django_content_type', 'verbose_name': 'content type', 'verbose_name_plural': 'content types', }, bases=(models.Model,), ), migrations.AlterUniqueTogether( name='contenttype', unique_together=set([('app_label', 'model')]), ), ]
django/contrib/contenttypes/models.py +2 −0 Original line number Diff line number Diff line from __future__ import unicode_literals from django.apps import apps from django.db import models from django.utils.translation import ugettext_lazy as _ Loading
django/contrib/contenttypes/tests/models.py 0 → 100644 +43 −0 Original line number Diff line number Diff line from django.db import models from django.utils.encoding import python_2_unicode_compatible from django.utils.http import urlquote class ConcreteModel(models.Model): name = models.CharField(max_length=10) class ProxyModel(ConcreteModel): class Meta: proxy = True @python_2_unicode_compatible class FooWithoutUrl(models.Model): """ Fake model not defining ``get_absolute_url`` for ContentTypesTests.test_shortcut_view_without_get_absolute_url() """ name = models.CharField(max_length=30, unique=True) def __str__(self): return self.name class FooWithUrl(FooWithoutUrl): """ Fake model defining ``get_absolute_url`` for ContentTypesTests.test_shortcut_view(). """ def get_absolute_url(self): return "/users/%s/" % urlquote(self.name) class FooWithBrokenAbsoluteUrl(FooWithoutUrl): """ Fake model defining a ``get_absolute_url`` method containing an error """ def get_absolute_url(self): return "/users/%s/" % self.unknown_field