PageRenderTime 171ms CodeModel.GetById 96ms app.highlight 10ms RepoModel.GetById 61ms app.codeStats 0ms

/tests/regressiontests/admin_ordering/models.py

https://code.google.com/p/mango-py/
Python | 26 lines | 19 code | 6 blank | 1 comment | 0 complexity | 5b824666ae9dd4a9209dbc3da66149ae MD5 | raw file
 1# coding: utf-8
 2from django.db import models
 3from django.contrib import admin
 4
 5class Band(models.Model):
 6    name = models.CharField(max_length=100)
 7    bio = models.TextField()
 8    rank = models.IntegerField()
 9
10    class Meta:
11        ordering = ('name',)
12
13class Song(models.Model):
14    band = models.ForeignKey(Band)
15    name = models.CharField(max_length=100)
16    duration = models.IntegerField()
17
18    class Meta:
19        ordering = ('name',)
20
21class SongInlineDefaultOrdering(admin.StackedInline):
22    model = Song
23
24class SongInlineNewOrdering(admin.StackedInline):
25    model = Song
26    ordering = ('duration', )