mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
Refs #33476 -- Reformatted code with Black.
This commit is contained in:
committed by
Mariusz Felisiak
parent
f68fa8b45d
commit
9c19aff7c7
@@ -8,17 +8,17 @@ class Band(models.Model):
|
||||
rank = models.IntegerField()
|
||||
|
||||
class Meta:
|
||||
ordering = ('name',)
|
||||
ordering = ("name",)
|
||||
|
||||
|
||||
class Song(models.Model):
|
||||
band = models.ForeignKey(Band, models.CASCADE)
|
||||
name = models.CharField(max_length=100)
|
||||
duration = models.IntegerField()
|
||||
other_interpreters = models.ManyToManyField(Band, related_name='covers')
|
||||
other_interpreters = models.ManyToManyField(Band, related_name="covers")
|
||||
|
||||
class Meta:
|
||||
ordering = ('name',)
|
||||
ordering = ("name",)
|
||||
|
||||
|
||||
class SongInlineDefaultOrdering(admin.StackedInline):
|
||||
@@ -27,13 +27,12 @@ class SongInlineDefaultOrdering(admin.StackedInline):
|
||||
|
||||
class SongInlineNewOrdering(admin.StackedInline):
|
||||
model = Song
|
||||
ordering = ('duration',)
|
||||
ordering = ("duration",)
|
||||
|
||||
|
||||
class DynOrderingBandAdmin(admin.ModelAdmin):
|
||||
|
||||
def get_ordering(self, request):
|
||||
if request.user.is_superuser:
|
||||
return ['rank']
|
||||
return ["rank"]
|
||||
else:
|
||||
return ['name']
|
||||
return ["name"]
|
||||
|
||||
Reference in New Issue
Block a user