Couple of little fixes
This commit is contained in:
@@ -34,7 +34,7 @@ admin.site.register(models.Work, WorkAdmin)
|
||||
|
||||
class SectionInline(admin.TabularInline):
|
||||
model = models.Section
|
||||
fields = ['type', 'tag', 'ordinal', 'start', 'end', 'page']
|
||||
fields = ['tag', 'start', 'end', 'page']
|
||||
|
||||
class DocumentAdmin(admin.ModelAdmin):
|
||||
list_display = ['work', '__str__']
|
||||
|
||||
@@ -36,8 +36,6 @@ class Orchestration(models.Model):
|
||||
Stores a list of instrument codes as a single entry (space delimited).
|
||||
Can be global or ensemble specific
|
||||
"""
|
||||
# TODO: change ensemble to collection
|
||||
#ensemble = models.ForeignKey('interface.Ensemble', on_delete=models.CASCADE, related_name="orchestrations", null=True, blank=True)
|
||||
collection = models.ForeignKey('Collection', on_delete=models.CASCADE, related_name="custom_orchestrations", null=True, blank=True)
|
||||
name = models.CharField(max_length=100)
|
||||
instruments = models.TextField()
|
||||
@@ -234,10 +232,6 @@ class Work(models.Model):
|
||||
def meta(self):
|
||||
return self.meta_info.exclude(name='tag')
|
||||
|
||||
@property
|
||||
def active_projects(self):
|
||||
return self.projects.filter(active=True)
|
||||
|
||||
@property
|
||||
def current_loans(self):
|
||||
return self.project_items.filter(checkout__lte=now(), returned=None).select_related('project')
|
||||
|
||||
@@ -141,7 +141,7 @@ class CollectionListView(ListView):
|
||||
paginate_by = 20
|
||||
|
||||
def get_queryset(self):
|
||||
collections = models.Collection.objects.all()
|
||||
collections = models.Collection.objects.order_by('name')
|
||||
|
||||
if self.request.user.is_anonymous:
|
||||
return models.Collection.objects.none()
|
||||
|
||||
@@ -83,7 +83,7 @@ class SectionSerializer(serializers.ModelSerializer):
|
||||
|
||||
class DocumentSerializer(serializers.ModelSerializer):
|
||||
|
||||
upload = serializers.CharField()
|
||||
upload = serializers.URLField()
|
||||
sections = SectionSerializer(many=True)
|
||||
|
||||
#def to_internal_value(self, data):
|
||||
|
||||
Reference in New Issue
Block a user