kopia lustrzana https://github.com/OpenDroneMap/WebODM
Columns are added to the projects view in administration.
Column tasks_count is added.pull/1331/head^2
rodzic
ecd89a3f3f
commit
3429255f42
|
@ -23,7 +23,14 @@ from webodm import settings
|
|||
from django.core.files.uploadedfile import InMemoryUploadedFile
|
||||
from django.utils.translation import gettext_lazy as _, gettext
|
||||
|
||||
admin.site.register(Project, GuardedModelAdmin)
|
||||
|
||||
class ProjectAdmin(GuardedModelAdmin):
|
||||
list_display = ('id', 'name', 'owner', 'created_at', 'tasks_count', 'tags')
|
||||
list_filter = ('owner',)
|
||||
search_fields = ('id', 'name', 'owner__username')
|
||||
|
||||
|
||||
admin.site.register(Project, ProjectAdmin)
|
||||
|
||||
|
||||
class TaskAdmin(admin.ModelAdmin):
|
||||
|
|
|
@ -48,6 +48,9 @@ class Project(models.Model):
|
|||
def tasks(self):
|
||||
return self.task_set.only('id')
|
||||
|
||||
def tasks_count(self):
|
||||
return self.task_set.count()
|
||||
|
||||
def get_map_items(self):
|
||||
return [task.get_map_items() for task in self.task_set.filter(
|
||||
status=status_codes.COMPLETED
|
||||
|
|
Ładowanie…
Reference in New Issue