Changeset 679 for trunk/opentrials/repository/admin.py
- Timestamp:
- 11/05/10 17:55:50 (3 years ago)
- Files:
-
- 1 modified
-
trunk/opentrials/repository/admin.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/opentrials/repository/admin.py
r611 r679 2 2 3 3 from django.contrib import admin 4 from django.utils.translation import ugettext as _ 5 4 6 from repository.models import * 5 7 … … 25 27 list_display_links = ('identifier','short_title',) 26 28 search_fields = ('scientific_title', 'public_title', 'i_freetext',) 27 list_filter = ('updated', 'study_type', 'phase', 'recruitment_status', )29 list_filter = ('updated', 'study_type', 'phase', 'recruitment_status', 'status',) 28 30 date_hierarchy = 'updated' 29 31 save_on_top = True 32 actions = ['publish_action'] 33 34 def publish_action(self, request, queryset): 35 rows_updated = 0 36 37 for obj in queryset: 38 if obj.status != 'published': 39 obj.status = 'published' 40 obj.save() 41 rows_updated += 1 42 43 if rows_updated == 0: 44 message = _("No clinical trial was published.") 45 elif rows_updated == 1: 46 message = "1 %s" % _("clinical trial was published.") 47 else: 48 message = "%s %s" % (rows_updated, _("clinical trials were published.")) 49 self.message_user(request, message) 50 51 publish_action.short_description = _("Publish the selected clinical trials") 30 52 31 53 class DescriptorAdmin(admin.ModelAdmin):
