Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 54 additions & 53 deletions api/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ class RegionName(IntEnum):
EUROPE = 3
MENA = 4

class Labels:
AFRICA = _('Africa')
AMERICAS = _('Americas')
ASIA_PACIFIC = _('Asia Pacific')
EUROPE = _('Europe')
MENA = _('Middle East North Africa')
# class Labels:
# AFRICA = _('Africa')
# AMERICAS = _('Americas')
# ASIA_PACIFIC = _('Asia Pacific')
# EUROPE = _('Europe')
# MENA = _('Middle East North Africa')


class Region(models.Model):
Expand Down Expand Up @@ -106,12 +106,13 @@ class CountryType(IntEnum):
COUNTRY_OFFICE = 4
REPRESENTATIVE_OFFICE = 5

class Labels:
COUNTRY = _('Country')
CLUSTER = _('Cluster')
REGION = _('Region')
COUNTRY_OFFICE = _('Country Office')
REPRESENTATIVE_OFFICE = _('Representative Office')
# class Labels:
# COUNTRY = _('Country')
# CLUSTER = _('Cluster')
# REGION = _('Region')
# COUNTRY_OFFICE = _('Country Office')
# REPRESENTATIVE_OFFICE = _('Representative Office')

# select name, society_name, record_type from api_country where name like '%luster%';
# select name, society_name, record_type from api_country where name like '%egion%';
# select name, society_name, record_type from api_country where name like '%ffice%'; -- no result
Expand Down Expand Up @@ -206,10 +207,10 @@ class VisibilityChoices(IntEnum):
IFRC = 2
PUBLIC = 3

class Labels:
MEMBERSHIP = _('Membership')
IFRC = _('IFRC Only')
PUBLIC = _('Public')
# class Labels:
# MEMBERSHIP = _('Membership')
# IFRC = _('IFRC Only')
# PUBLIC = _('Public')


class VisibilityCharChoices():
Expand Down Expand Up @@ -265,23 +266,23 @@ class PositionType(IntEnum):
LOW = 4
BOTTOM = 5

class Labels:
TOP = _('Top')
HIGH = _('High')
MIDDLE = _('Middle')
LOW = _('Low')
BOTTOM = _('Bottom')
# class Labels:
# TOP = _('Top')
# HIGH = _('High')
# MIDDLE = _('Middle')
# LOW = _('Low')
# BOTTOM = _('Bottom')


class TabNumber(IntEnum):
TAB_1 = 1
TAB_2 = 2
TAB_3 = 3

class Labels:
TAB_1 = _('Tab 1')
TAB_2 = _('Tab 2')
TAB_3 = _('Tab 3')
# class Labels:
# TAB_1 = _('Tab 1')
# TAB_2 = _('Tab 2')
# TAB_3 = _('Tab 3')


class RegionSnippet(models.Model):
Expand Down Expand Up @@ -380,10 +381,10 @@ class AlertLevel(IntEnum):
ORANGE = 1
RED = 2

class Labels:
GREEN = _('Green')
ORANGE = _('Orange')
RED = _('Red')
# class Labels:
# GREEN = _('Green')
# ORANGE = _('Orange')
# RED = _('Red')


class Event(models.Model):
Expand Down Expand Up @@ -641,10 +642,10 @@ class AppealType(IntEnum):
APPEAL = 1
INTL = 2

class Labels:
DREF = _('DREF')
APPEAL = _('Emergency Appeal')
INTL = _('International Appeal')
# class Labels:
# DREF = _('DREF')
# APPEAL = _('Emergency Appeal')
# INTL = _('International Appeal')


class AppealStatus(IntEnum):
Expand All @@ -653,11 +654,11 @@ class AppealStatus(IntEnum):
FROZEN = 2
ARCHIVED = 3

class Labels:
ACTIVE = _('Active')
CLOSED = _('Closed')
FROZEN = _('Frozen')
ARCHIVED = _('Archived')
# class Labels:
# ACTIVE = _('Active')
# CLOSED = _('Closed')
# FROZEN = _('Frozen')
# ARCHIVED = _('Archived')


class Appeal(models.Model):
Expand Down Expand Up @@ -798,22 +799,22 @@ class RequestChoices(IntEnum):
PLANNED = 2
COMPLETE = 3

class Labels:
NO = _('No')
REQUESTED = _('Requested')
PLANNED = _('Planned')
COMPLETE = _('Complete')
# class Labels:
# NO = _('No')
# REQUESTED = _('Requested')
# PLANNED = _('Planned')
# COMPLETE = _('Complete')


class EPISourceChoices(IntEnum):
MINISTRY_OF_HEALTH = 0
WHO = 1
OTHER = 2

class Labels:
MINISTRY_OF_HEALTH = _('Ministry of health')
WHO = _('WHO')
OTHER = _('OTHER')
# class Labels:
# MINISTRY_OF_HEALTH = _('Ministry of health')
# WHO = _('WHO')
# OTHER = _('OTHER')


class FieldReport(models.Model):
Expand Down Expand Up @@ -1537,11 +1538,11 @@ class CronJobStatus(IntEnum):
WARNED = 1
ERRONEOUS = 2

class Labels:
NEVER_RUN = _('Never run')
SUCCESSFUL = _('Successfull')
WARNED = _('Warned')
ERRONEOUS = _('Erroneous')
# class Labels:
# NEVER_RUN = _('Never run')
# SUCCESSFUL = _('Successfull')
# WARNED = _('Warned')
# ERRONEOUS = _('Erroneous')


class CronJob(models.Model):
Expand Down
44 changes: 22 additions & 22 deletions deployments/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@ class ERUType(IntEnum):
WASH_20 = 7
WASH_40 = 8

class Labels:
BASECAMP = _('Basecamp')
TELECOM = _('IT & Telecom')
LOGISTICS = _('Logistics')
EMERGENCY_HOSPITAL = _('RCRC Emergency Hospital')
EMERGENCY_CLINIC = _('RCRC Emergency Clinic')
RELIEF = _('Relief')
WASH_15 = _('Wash M15')
WASH_20 = _('Wash MSM20')
WASH_40 = _('Wash M40')
# class Labels:
# BASECAMP = _('Basecamp')
# TELECOM = _('IT & Telecom')
# LOGISTICS = _('Logistics')
# EMERGENCY_HOSPITAL = _('RCRC Emergency Hospital')
# EMERGENCY_CLINIC = _('RCRC Emergency Clinic')
# RELIEF = _('Relief')
# WASH_15 = _('Wash M15')
# WASH_20 = _('Wash MSM20')
# WASH_40 = _('Wash M40')


class ERUOwner(models.Model):
Expand Down Expand Up @@ -147,7 +147,7 @@ class Personnel(DeployedPerson):
RR = 'rr'

TYPE_CHOICES = (
(FACT, _('Fact')),
(FACT, _('FACT')),
(HEOP, _('HEOP')),
(RDRT, _('RDRT')),
(IFRC, _('IFRC')),
Expand Down Expand Up @@ -208,10 +208,10 @@ class ProgrammeTypes(IntEnum):
MULTILATERAL = 1
DOMESTIC = 2

class Labels:
BILATERAL = _('Bilateral')
MULTILATERAL = _('Multilateral')
DOMESTIC = _('Domestic')
# class Labels:
# BILATERAL = _('Bilateral')
# MULTILATERAL = _('Multilateral')
# DOMESTIC = _('Domestic')


class Sectors(IntEnum):
Expand Down Expand Up @@ -279,19 +279,19 @@ class Statuses(IntEnum):
ONGOING = 1
COMPLETED = 2

class Labels:
PLANNED = _('Planned')
ONGOING = _('Ongoing')
COMPLETED = _('Completed')
# class Labels:
# PLANNED = _('Planned')
# ONGOING = _('Ongoing')
# COMPLETED = _('Completed')


class OperationTypes(IntEnum):
PROGRAMME = 0
EMERGENCY_OPERATION = 1

class Labels:
PROGRAMME = _('Programme')
EMERGENCY_OPERATION = _('Emergency Operation')
# class Labels:
# PROGRAMME = _('Programme')
# EMERGENCY_OPERATION = _('Emergency Operation')


class RegionalProject(models.Model):
Expand Down
67 changes: 34 additions & 33 deletions notifications/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ class SurgeAlertType(IntEnum):
SURGE = 5
RAPID_RESPONSE = 6

class Labels:
FACT = _('fact')
SIMS = _('SIMS')
ERU = _('ERU')
DHEOPS = _('DHEOPS')
HEOPS = _('HEOPS')
SURGE = _('surge')
RAPID_RESPONSE = _('rapid response')
# class Labels:
# FACT = _('fact')
# SIMS = _('SIMS')
# ERU = _('ERU')
# DHEOPS = _('DHEOPS')
# HEOPS = _('HEOPS')
# SURGE = _('surge')
# RAPID_RESPONSE = _('rapid response')


class SurgeAlertCategory(IntEnum):
Expand All @@ -33,12 +33,12 @@ class SurgeAlertCategory(IntEnum):
SHELTER = 3
STAND_DOWN = 4

class Labels:
INFO = _('information')
DEPLOYMENT = _('deployment')
ALERT = _('alert')
SHELTER = _('shelter')
STAND_DOWN = _('stand down')
# class Labels:
# INFO = _('information')
# DEPLOYMENT = _('deployment')
# ALERT = _('alert')
# SHELTER = _('shelter')
# STAND_DOWN = _('stand down')


class SurgeAlert(models.Model):
Expand Down Expand Up @@ -74,9 +74,9 @@ class SubscriptionType(IntEnum):
NEW = 0
EDIT = 1

class Labels:
NEW = _('new')
EDIT = _('edit')
# class Labels:
# NEW = _('new')
# EDIT = _('edit')


class RecordType(IntEnum):
Expand All @@ -97,22 +97,23 @@ class RecordType(IntEnum):
NEW_OPERATIONS = 13
GENERAL_ANNOUNCEMENTS = 14

class Labels:
EVENT = _('event')
APPEAL = _('appeal')
FIELD_REPORT = _('field report')
SURGE_ALERT = _('surge alert')
COUNTRY = _('country')
REGION = _('region')
DTYPE = _('disaster type')
PER_DUE_DATE = _('per due date')
FOLLOWED_EVENT = _('followed event')
SURGE_DEPLOYMENT_MESSAGES = _('surge deployment messages')
SURGE_APPROACHING_END_OF_MISSION = _('surge approaching end of mission')
WEEKLY_DIGEST = _('weekly digest')
NEW_EMERGENCIES = _('new emergencies')
NEW_OPERATIONS = _('new operations')
GENERAL_ANNOUNCEMENTS = _('general announcements')
# class Labels:
# EVENT = _('event')
# APPEAL = _('appeal')
# FIELD_REPORT = _('field report')
# SURGE_ALERT = _('surge alert')
# COUNTRY = _('country')
# REGION = _('region')
# DTYPE = _('disaster type')
# PER_DUE_DATE = _('per due date')
# FOLLOWED_EVENT = _('followed event')
# SURGE_DEPLOYMENT_MESSAGES = _('surge deployment messages')
# SURGE_APPROACHING_END_OF_MISSION = _('surge approaching end of mission')
# WEEKLY_DIGEST = _('weekly digest')
# NEW_EMERGENCIES = _('new emergencies')
# NEW_OPERATIONS = _('new operations')
# GENERAL_ANNOUNCEMENTS = _('general announcements')

# Migration
# update notification_subscription set rtype=12, stype=0 where rtype=0; -- EVENT > EMERGENCY
# delete from notification_subscription where rtype=0; -- EVENT > EMERGENCY
Expand Down
Loading