mirror of
https://github.com/django/django.git
synced 2025-08-03 02:23:12 +00:00
Convert much of the regression tests to use absolute imports. There's still work to be done though.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16976 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
d5a45d79fe
commit
d362c1546f
104 changed files with 396 additions and 220 deletions
|
@ -1,5 +1,6 @@
|
|||
from django.contrib.comments.models import Comment
|
||||
from django.db import models
|
||||
from django.contrib.comments.models import Comment
|
||||
|
||||
|
||||
# Regression for #13368. This is an example of a model
|
||||
# that imports a class that has an abstract base class.
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
from __future__ import absolute_import
|
||||
|
||||
from django.contrib import admin
|
||||
from admin_scripts.complex_app.models.foo import Foo
|
||||
|
||||
from ..models.foo import Foo
|
||||
|
||||
|
||||
admin.site.register(Foo)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from admin_scripts.complex_app.models.bar import Bar
|
||||
from admin_scripts.complex_app.models.foo import Foo
|
||||
from .bar import Bar
|
||||
from .foo import Foo
|
||||
|
||||
__all__ = ['Foo', 'Bar']
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
from __future__ import absolute_import
|
||||
|
||||
from django.db import models
|
||||
|
||||
from admin_scripts.complex_app.admin import foo
|
||||
from ..admin import foo
|
||||
|
||||
|
||||
class Bar(models.Model):
|
||||
name = models.CharField(max_length=5)
|
||||
class Meta:
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
from django.db import models
|
||||
|
||||
|
||||
class Foo(models.Model):
|
||||
name = models.CharField(max_length=5)
|
||||
class Meta:
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
from django.core.management.base import AppCommand
|
||||
|
||||
|
||||
class Command(AppCommand):
|
||||
help = 'Test Application-based commands'
|
||||
requires_model_validation = False
|
||||
|
@ -7,4 +8,4 @@ class Command(AppCommand):
|
|||
|
||||
def handle_app(self, app, **options):
|
||||
print 'EXECUTE:AppCommand app=%s, options=%s' % (app, sorted(options.items()))
|
||||
|
||||
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
from django.core.management.base import BaseCommand
|
||||
from optparse import make_option
|
||||
|
||||
from django.core.management.base import BaseCommand
|
||||
|
||||
|
||||
class Command(BaseCommand):
|
||||
option_list = BaseCommand.option_list + (
|
||||
make_option('--option_a','-a', action='store', dest='option_a', default='1'),
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
from django.core.management.base import LabelCommand
|
||||
|
||||
|
||||
class Command(LabelCommand):
|
||||
help = "Test Label-based commands"
|
||||
requires_model_validation = False
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
from django.core.management.base import NoArgsCommand
|
||||
|
||||
|
||||
class Command(NoArgsCommand):
|
||||
help = "Test No-args commands"
|
||||
requires_model_validation = False
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
from django.db import models
|
||||
|
||||
|
||||
class Article(models.Model):
|
||||
headline = models.CharField(max_length=100, default='Default headline')
|
||||
pub_date = models.DateTimeField()
|
||||
|
@ -9,4 +10,3 @@ class Article(models.Model):
|
|||
|
||||
class Meta:
|
||||
ordering = ('-pub_date', 'headline')
|
||||
|
|
@ -1 +1,3 @@
|
|||
from admin_scripts.complex_app.models.bar import Bar
|
||||
from __future__ import absolute_import
|
||||
|
||||
from ..complex_app.models.bar import Bar
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue