]> git.parisson.com Git - mezzo.git/commitdiff
[Timesheet] : add filter on projects
authorEmilie <zawadzki@ircam.fr>
Fri, 30 Dec 2016 16:16:36 +0000 (17:16 +0100)
committerEmilie <zawadzki@ircam.fr>
Fri, 30 Dec 2016 16:16:36 +0000 (17:16 +0100)
app/organization/projects/admin.py
app/organization/projects/models.py

index 21b0ba7fc290308b26f4f6fa1b642e579daa452e..11ad0ba2bab948275d6740fa9e98df81ae93883c 100644 (file)
@@ -32,6 +32,7 @@ from organization.pages.models import *
 from organization.media.models import Playlist
 from organization.pages.admin import PageImageInline
 from organization.projects.forms import DynamicContentProjectForm
+from organization.core.admin import null_filter
 
 
 class ProjectLinkInline(StackedDynamicInlineAdmin):
@@ -108,8 +109,8 @@ class ProjectAdminDisplayable(DisplayableAdmin):
                 ProjectRelatedTitleAdmin,
                 DynamicContentProjectInline]
     filter_horizontal = ['teams', 'organizations']
-    list_filter = ['type', 'program', 'program_type', ]
-    list_display = ['title', 'date_from', 'date_to', 'status', 'admin_link']
+    list_filter = ['type', 'program', 'program_type', null_filter('external_id')]
+    list_display = ['title', 'external_id', 'date_from', 'date_to', 'status', 'admin_link']
 
 
 class ProjectTopicAdmin(BaseTranslationModelAdmin):
index 25b43911043c328649ff0439c4011bad4a95c8d5..af207b34b312003fe34ee1c0f98c844ee6020d5c 100644 (file)
@@ -50,7 +50,7 @@ class Project(Displayable, Period, RichText):
     """(Project description)"""
 
     type = models.CharField(_('type'), max_length=128, choices=PROJECT_TYPE_CHOICES)
-    external_id = models.CharField(_('register ID'), blank=True, null=True, max_length=128)
+    external_id = models.CharField(_('external ID'), blank=True, null=True, max_length=128)
     program = models.ForeignKey('ProjectProgram', verbose_name=_('project program'), related_name='projects', blank=True, null=True, on_delete=models.SET_NULL)
     program_type = models.ForeignKey('ProjectProgramType', verbose_name=_('project program type'), related_name='projects', blank=True, null=True, on_delete=models.SET_NULL)
     lead_team = models.ForeignKey('organization-network.Team', verbose_name=_('lead team'), related_name='leader_projects', blank=True, null=True)