from MHLogin.Invites.models import Invitation, InvitationLog from MHLogin.Administration.tech_admin import sites, options class InvitationAdmin(options.TechAdmin): list_display = ('sender', 'code', 'recipient', 'userType', 'typeVerified', 'requestTimestamp') search_fields = ('sender__username', 'sender__first_name', 'sender__last_name', 'code') class InvitationLogAdmin(options.TechAdmin): list_display = ('sender', 'code', 'recipient', 'userType', 'typeVerified', 'requestTimestamp', 'canceller') search_fields = ('sender__username', 'sender__first_name', 'sender__last_name', 'code') sites.register(Invitation, InvitationAdmin) sites.register(InvitationLog, InvitationLogAdmin)
from MHLogin.Administration.tech_admin import sites, options from MHLogin.MHLCallGroups.models import CallGroup, CallGroupMember, Specialty class CallGroupAdmin(options.TechAdmin): list_display = ('description', 'team', 'number_selection') class CallGroupMemberAdmin(options.TechAdmin): list_display = ('member', 'call_group', 'alt_provider') list_filter = ('call_group', ) class SpecialtyAdmin(options.TechAdmin): list_display = ('name', 'practice_location', 'number_selection') sites.register(CallGroup, CallGroupAdmin) sites.register(CallGroupMember, CallGroupMemberAdmin) sites.register(Specialty, SpecialtyAdmin)
from MHLogin.Administration.tech_admin import sites, options from MHLogin.followup.models import FollowUps class FollowUpsAdmin(options.TechAdmin): list_display = ('user', 'done', 'priority', 'task', 'creation_date', 'due_date', 'completion_date', 'deleted', 'note') sites.register(FollowUps, FollowUpsAdmin)
from MHLogin.Administration.tech_admin import sites, options from MHLogin.Validates.models import Validation, ValidationLog class ValidationAdmin(options.TechAdmin): list_display = ('code', 'type', 'applicant', 'recipient', 'is_active', 'sent_time', 'validate_locked_time', 'validate_success_time') search_fields = ('code', 'applicant', 'recipient') class ValidationLogAdmin(options.TechAdmin): list_display = ('validation', 'code_input', 'validate_time') search_fields = ('code_input',) sites.register(Validation, ValidationAdmin) sites.register(ValidationLog, ValidationLogAdmin)
from MHLogin.Administration.tech_admin import sites, options from MHLogin.MHLSites.models import Hospital class HospitalAdmin(options.TechAdmin): list_display = ('name', 'address1', 'city', 'state', 'zip') search_fields = ('name', 'city', 'state', 'zip',) sites.register(Hospital)
return form def _modify_user_query(self, user, field): """ helper to filter list results in tech-admin FK add/select users """ if field.queryset: query = user.groups.exclude(name=TECH_ADMIN_GROUP) klass = field.queryset[0].__class__ field.queryset = klass.objects.filter(user__user__groups__in=query).distinct() class PasswordResetLogAdmin(options.TechAdmin): list_display = ('user', 'reset', 'resolved', 'requestor', 'request_timestamp', 'reset_timestamp', 'servicer', 'resolution_timestamp') search_fields = ('user__username', 'servicer__username', 'requestor__username') def has_add_permission(self, request): return False sites.register(MHLUser, MHLUserAdmin) sites.register(Provider, ProviderAdmin) sites.register(OfficeStaff, OfficeStaffUserAdmin) sites.register([Administrator, Broker, NP_PA, Physician, Salesperson], StaffUserAdmin) sites.register([Nurse, Dietician, Office_Manager], StaffUserAdmin2) sites.register(Regional_Manager, Regional_ManagerAdmin) sites.register(EventLog) sites.register(PhysicianGroup) sites.register(PhysicianGroupMembers) sites.register(PasswordResetLog, PasswordResetLogAdmin)
class OrganizationMemberOrgsAdmin(options.TechAdmin): list_display = ('from_practicelocation', 'to_practicelocation', 'create_time', 'billing_flag') class Pending_Org_AssociationAdmin(options.TechAdmin): list_display = ('from_practicelocation', 'to_practicelocation', 'sender', 'create_time', 'resent_time') class Log_Org_AssociationAdmin(options.TechAdmin): list_display = ('association_id', 'from_practicelocation', 'to_practicelocation', 'sender', 'action_user', 'action', 'create_time') sites.register(PracticeLocation, PracticeLocationAdmin) sites.register(PracticeHours, PracticeHoursAdmin) sites.register(PracticeHolidays, PracticeHolidayAdmin) sites.register(Pending_Association, Pending_AssociationAdmin) sites.register(Log_Association, Log_AssociationAdmin) sites.register(AccessNumber, AccessNumberAdmin) sites.register(AccountActiveCode, AccountActiveCodeAdmin) sites.register(OrganizationSetting) sites.register(OrganizationRelationship, OrganizationRelationshipAdmin) sites.register(OrganizationTypeSubs, OrganizationTypeSubsAdmin) sites.register(OrganizationMemberOrgs, OrganizationMemberOrgsAdmin) sites.register(Pending_Org_Association, Pending_Org_AssociationAdmin) sites.register(Log_Org_Association, Log_Org_AssociationAdmin)
'rows': 10, 'cols': 65, 'style': "font-family:courier;" }) _cipherkey = forms.CharField(label="Cipherkey (pubkey encrypted)", widget=ta) def __init__(self, *args, **kwargs): super(EncryptedObjectAdmin.InnerForm, self).__init__(*args, **kwargs) encobj = kwargs.get('instance', None) self.fields['_cipherkey'].initial = encobj and encobj.cipherkey self.fields['_cipherkey'].widget.attrs['disabled'] = 'disabled' # def has_delete_permission(self, request, obj=None): # return False form = InnerForm list_display = ('object_type', 'object_id', 'object', 'opub', 'create_date') readonly_fields = [ 'object_type', 'object_id', 'object', 'opub', 'create_date' ] search_fields = ('object_id', ) list_filter = ('opub__owner_type', 'opub__keytype') sites.register(OwnerPublicKey, OwnerPublicKeyAdmin) sites.register(UserPrivateKey, UserPrivateKeyAdmin) sites.register(EncryptedObject, EncryptedObjectAdmin)
from MHLogin.Administration.tech_admin import sites, options from MHLogin.MHLUsers.Sales.models import Products, SalesLeads, SalesProduct class SalesLeadsAdmin(options.TechAdmin): list_display = ('rep', 'practice', 'region', 'stage', 'source') class SalesProductAdmin(options.TechAdmin): list_display = ('_get_lead_info', 'product', 'quoted_price', 'is_active') _get_lead_info = lambda self, obj: '/'.join( [str(obj.lead.rep), obj.lead.practice]) _get_lead_info.short_description = 'Lead Info' sites.register(Products) sites.register(SalesLeads, SalesLeadsAdmin) sites.register(SalesProduct, SalesProductAdmin)
"test", fmt=cleanf['encoding'], voice=cleanf['voice_id']) if stat['status'] != driver_h.TTS_RESULT_SUCCESS: raise ValidationError("Validation error, message from " "neospeech: %s" % stat['status_text']) return self.cleaned_data class NeospeechConfigAdmin(options.TechAdmin): form = NeospeechConfigAdminForm list_display = ('name', 'spoken_lang', 'server', 'server_port', 'status_port', 'admin_port', 'voice_id', 'encoding', 'volume', 'speed', 'pitch', 'is_active') class VoiceClipAdmin(options.TechAdmin): list_display = ('config', 'filename', '_get_spoken_text', 'access_count', 'access_date', 'create_date') search_fields = ('spoken_text', ) _get_spoken_text = lambda self, obj: "%s..." % (obj.spoken_text[:32]) def __init__(self, model, admin_site): super(VoiceClipAdmin, self).__init__(model, admin_site) self._get_spoken_text.im_func.short_description = 'Spoken Text' sites.register(NeospeechConfig, NeospeechConfigAdmin) sites.register(VoiceClip, VoiceClipAdmin)
class MessageAttachmentAdmin(options.TechAdmin): class MessageAttachmentForm(forms.ModelForm): _storage_name = forms.CharField(widget=forms.TextInput(attrs={'size': 40})) def __init__(self, *args, **kwargs): super(MessageAttachmentAdmin.MessageAttachmentForm, self).__init__(*args, **kwargs) if 'instance' in kwargs: attach = kwargs['instance'] # Show disabled read-only uuid field self.fields['_storage_name'].initial = attach.uuid self.fields['_storage_name'].widget.attrs['disabled'] = 'disabled' list_display = ('message', 'encrypted', 'content_type', 'encoding', 'charset', 'suffix', 'size', 'metadata') readonly_fields = ['message'] form = MessageAttachmentForm sites.register(Message, MessageAdmin) sites.register(MessageBody, MessageBodyAdmin) sites.register(MessageBodyUserStatus, MessageBodyUserStatusAdmin) sites.register(MessageAttachment, MessageAttachmentAdmin) if (settings.DEBUG_MODELS): from MHLogin.utils.admin_utils import registerallmodels registerallmodels('Messaging')
from MHLogin.Administration.tech_admin import sites from MHLogin.Administration.tech_admin import options from MHLogin.genbilling.models import Account, AccountTransaction, Invoice, \ Subscription, FailedTransaction class SubscriptionAdmin(options.TechAdmin): list_display = ('practice_group_new', 'practice_location', 'product', 'price', 'is_active') search_fields = ('practice_group_new__practice_name', 'practice_location__practice_name', 'product__code', 'product__description') class AccountAdmin(options.TechAdmin): list_display = ('practice_group_new', 'owner', 'status', 'last_bill_date', 'last_payment_state') search_fields = ('practice_group_new__practice_name', 'owner__username', 'owner__first_name', 'owner__last_name') sites.register(Account, AccountAdmin) sites.register(AccountTransaction) sites.register(Invoice) sites.register(Subscription, SubscriptionAdmin) sites.register(FailedTransaction)
fmt=cleanf['encoding'], voice=cleanf['voice_id']) if stat['status'] != driver_h.TTS_RESULT_SUCCESS: raise ValidationError("Validation error, message from " "neospeech: %s" % stat['status_text']) return self.cleaned_data class NeospeechConfigAdmin(options.TechAdmin): form = NeospeechConfigAdminForm list_display = ('name', 'spoken_lang', 'server', 'server_port', 'status_port', 'admin_port', 'voice_id', 'encoding', 'volume', 'speed', 'pitch', 'is_active') class VoiceClipAdmin(options.TechAdmin): list_display = ('config', 'filename', '_get_spoken_text', 'access_count', 'access_date', 'create_date') search_fields = ('spoken_text', ) _get_spoken_text = lambda self, obj: "%s..." % (obj.spoken_text[:32]) def __init__(self, model, admin_site): super(VoiceClipAdmin, self).__init__(model, admin_site) self._get_spoken_text.im_func.short_description = 'Spoken Text' sites.register(NeospeechConfig, NeospeechConfigAdmin) sites.register(VoiceClip, VoiceClipAdmin)
def __init__(self, model, admin_site): super(SmartPhoneAssnAdmin, self).__init__(model, admin_site) self._get_push_tok.im_func.short_description = 'Push Token' def dissociate_selected(self, request, obj): for o in obj: o.dissociate(request, administrative_request=True) def get_actions(self, request): actions = super(SmartPhoneAssnAdmin, self).get_actions(request) if ('delete_selected' in actions): del actions['delete_selected'] return actions def save_model(self, request, obj, form, change): obj.save(request) def delete_model(self, request, obj): obj.dissociate(request, administrative_request=True) def has_add_permission(self, request, obj=None): return False def has_delete_permission(self, request, obj=None): return False sites.register(SmartPhoneAssn, SmartPhoneAssnAdmin)
from MHLogin.Administration.tech_admin import sites, options from MHLogin.MHLUsers.Sales.models import Products, SalesLeads, SalesProduct class SalesLeadsAdmin(options.TechAdmin): list_display = ('rep', 'practice', 'region', 'stage', 'source') class SalesProductAdmin(options.TechAdmin): list_display = ('_get_lead_info', 'product', 'quoted_price', 'is_active') _get_lead_info = lambda self, obj: '/'.join([str(obj.lead.rep), obj.lead.practice]) _get_lead_info.short_description = 'Lead Info' sites.register(Products) sites.register(SalesLeads, SalesLeadsAdmin) sites.register(SalesProduct, SalesProductAdmin)
""" helper to filter list results in tech-admin FK add/select users """ if field.queryset: query = user.groups.exclude(name=TECH_ADMIN_GROUP) klass = field.queryset[0].__class__ field.queryset = klass.objects.filter( user__user__groups__in=query).distinct() class PasswordResetLogAdmin(options.TechAdmin): list_display = ('user', 'reset', 'resolved', 'requestor', 'request_timestamp', 'reset_timestamp', 'servicer', 'resolution_timestamp') search_fields = ('user__username', 'servicer__username', 'requestor__username') def has_add_permission(self, request): return False sites.register(MHLUser, MHLUserAdmin) sites.register(Provider, ProviderAdmin) sites.register(OfficeStaff, OfficeStaffUserAdmin) sites.register([Administrator, Broker, NP_PA, Physician, Salesperson], StaffUserAdmin) sites.register([Nurse, Dietician, Office_Manager], StaffUserAdmin2) sites.register(Regional_Manager, Regional_ManagerAdmin) sites.register(EventLog) sites.register(PhysicianGroup) sites.register(PhysicianGroupMembers) sites.register(PasswordResetLog, PasswordResetLogAdmin)
list_display = ('owner', 'owner_type', 'callerID', 'read_timestamp', 'callbacknumber', 'answeringservice') class CallLogAdmin(options.TechAdmin): list_display = ('mdcom_caller', 'caller_number', 'mdcom_called', 'called_number', 'timestamp') class CallEventAdmin(options.TechAdmin): list_display = ('callSID', 'event', 'timestamp') class AnsSvcDLFailureAdmin(options.TechAdmin): list_display = ('practice_id', 'error_timestamp', 'resolved', 'resolution_timestamp', 'failure_type', 'caller', 'called') sites.register(VMBox_Config, VMBox_ConfigAdmin) sites.register(VMMessage, VMMessageAdmin) sites.register(IVR_Prompt) sites.register(AnsSvcDLFailure, AnsSvcDLFailureAdmin) from django.conf import settings if (settings.DEBUG_MODELS): sites.register(callLog, CallLogAdmin) sites.register(callEvent, CallEventAdmin) # register rest with default admin from MHLogin.utils.admin_utils import registerallmodels registerallmodels('IVR')
from MHLogin.Administration.tech_admin import sites, options from MHLogin.MHLCallGroups.Scheduler.models import EventEntry class EventEntryAdmin(options.TechAdmin): list_display = ( 'callGroup', 'oncallPerson', 'creator', 'startDate', 'endDate', 'oncallLevel', 'eventStatus', ) list_filter = ( 'oncallStatus', 'eventStatus', 'startDate', 'endDate', ) search_fields = ( 'callGroup__description', 'oncallPerson__last_name', 'oncallPerson__first_name', 'oncallPerson__username', ) sites.register(EventEntry, EventEntryAdmin)
class MessageAttachmentAdmin(options.TechAdmin): class MessageAttachmentForm(forms.ModelForm): _storage_name = forms.CharField(widget=forms.TextInput( attrs={'size': 40})) def __init__(self, *args, **kwargs): super(MessageAttachmentAdmin.MessageAttachmentForm, self).__init__(*args, **kwargs) if 'instance' in kwargs: attach = kwargs['instance'] # Show disabled read-only uuid field self.fields['_storage_name'].initial = attach.uuid self.fields['_storage_name'].widget.attrs['disabled'] = 'disabled' list_display = ('message', 'encrypted', 'content_type', 'encoding', 'charset', 'suffix', 'size', 'metadata') readonly_fields = ['message'] form = MessageAttachmentForm sites.register(Message, MessageAdmin) sites.register(MessageBody, MessageBodyAdmin) sites.register(MessageBodyUserStatus, MessageBodyUserStatusAdmin) sites.register(MessageAttachment, MessageAttachmentAdmin) if (settings.DEBUG_MODELS): from MHLogin.utils.admin_utils import registerallmodels registerallmodels('Messaging')
class LogoutEventAdmin(options.TechAdmin): fieldsets = [ (None, { 'fields':( ('user', 'timestamp'), )}), ] class LogFilesAdmin(options.TechAdmin): def urls(self): info = self.model._meta.app_label, self.model._meta.module_name return patterns('', url(r'^$', logfiles_list, name='%s_%s_changelist' % info, kwargs={'root_path': '/dcAdmin/tech_admin/'}), url(r'^(?P<logfile_id>\d+)/$', logfile_view, name='log-file-admin', kwargs={'root_path': '/dcAdmin/tech_admin/'})) urls = property(urls) def has_add_permission(self, request): return False sites.register(LogFiles, LogFilesAdmin) #sites.register(Event, EventAdmin) #sites.register(LoginEvent, LoginEventAdmin) #sites.register(LogoutEvent, LogoutEventAdmin)
from MHLogin.Administration.tech_admin import sites, options from MHLogin.MHLCallGroups.Scheduler.models import EventEntry class EventEntryAdmin(options.TechAdmin): list_display = ('callGroup', 'oncallPerson', 'creator', 'startDate', 'endDate', 'oncallLevel', 'eventStatus',) list_filter = ('oncallStatus', 'eventStatus', 'startDate', 'endDate',) search_fields = ('callGroup__description', 'oncallPerson__last_name', 'oncallPerson__first_name', 'oncallPerson__username',) sites.register(EventEntry, EventEntryAdmin)
(obj.push_token[:16] if obj.push_token else "") def __init__(self, model, admin_site): super(SmartPhoneAssnAdmin, self).__init__(model, admin_site) self._get_push_tok.im_func.short_description = 'Push Token' def dissociate_selected(self, request, obj): for o in obj: o.dissociate(request, administrative_request=True) def get_actions(self, request): actions = super(SmartPhoneAssnAdmin, self).get_actions(request) if ('delete_selected' in actions): del actions['delete_selected'] return actions def save_model(self, request, obj, form, change): obj.save(request) def delete_model(self, request, obj): obj.dissociate(request, administrative_request=True) def has_add_permission(self, request, obj=None): return False def has_delete_permission(self, request, obj=None): return False sites.register(SmartPhoneAssn, SmartPhoneAssnAdmin)
class MessageLogAdmin(options.TechAdmin): list_display = ('__unicode__', 'current_site', 'tx_number', 'rx_number', 'timestamp', 'success') class MessageTempAdmin(options.TechAdmin): list_display = ('user', 'timestamp') class PagerLogAdmin(options.TechAdmin): list_display = ('pager', 'paged', 'current_site', 'callback', 'timestamp') class SiteAnalyticsAdmin(options.TechAdmin): list_display = ('dateoflog', 'site', 'countPage', 'countMessage', 'countClick2Call', 'lastUpdate') sites.register(PagerLog, PagerLogAdmin) sites.register(Click2Call_Log, Click2Call_LogAdmin) sites.register(MessageLog, MessageLogAdmin) sites.register(SiteAnalytics, SiteAnalyticsAdmin) sites.register(Click2Call_ActionLog, Click2Call_ActionLogAdmin) from django.conf import settings if (settings.DEBUG_MODELS): from MHLogin.utils.admin_utils import registerallmodels registerallmodels('DoctorCom')