Skip to content

Commit

Permalink
Merge pull request #461 from mercycorps/staging
Browse files Browse the repository at this point in the history
Staging to master for hatchling release
  • Loading branch information
sanjuroj authored Aug 25, 2021
2 parents 0885e7a + 931c454 commit 4d5f9b4
Show file tree
Hide file tree
Showing 101 changed files with 19,901 additions and 2,455 deletions.
1 change: 1 addition & 0 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r dev-requirements.txt
- name: Run Tests
run: |
python manage.py test
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,6 @@ site.retry
.eslintrc.yml
requirements.txt
htmlcov

# ingore temp files in bulk import dir, which will always start with yyyymmdd
indicators/bulk_import_files/[0-9]*
3 changes: 2 additions & 1 deletion dev-requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@
django-silk # Request-based query explainer, profiling, speed checking
django-debug-toolbar # In-page query explainer, profiling, template debug
django-extensions # shell plus and other helpful tools
pip-tools # used to produce requirements.txt
pip-tools # used to produce requirements.txt
polib # used in a management command to create placeholder translations, also used in tests
15 changes: 8 additions & 7 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,28 @@
# pip-compile dev-requirements.in
#
autopep8==1.5.4 # via django-silk
certifi==2020.6.20 # via -c requirements.txt, requests
chardet==3.0.4 # via -c requirements.txt, requests
certifi==2020.12.5 # via -c requirements.txt, requests
chardet==4.0.0 # via -c requirements.txt, requests
click==7.1.2 # via pip-tools
django-debug-toolbar==3.1.1 # via -r dev-requirements.in
django-extensions==3.1.0 # via -r dev-requirements.in
django-silk==4.1.0 # via -r dev-requirements.in
django==2.2.14 # via -c requirements.txt, django-debug-toolbar, django-silk
django==2.2.21 # via -c requirements.txt, django-debug-toolbar, django-silk
gprof2dot==2019.11.30 # via django-silk
idna==2.10 # via -c requirements.txt, requests
jinja2==2.11.2 # via django-silk
markupsafe==1.1.1 # via jinja2
pip-tools==5.4.0 # via -r dev-requirements.in
polib==1.1.1 # via -r dev-requirements.in
pycodestyle==2.6.0 # via autopep8
pygments==2.7.2 # via django-silk
python-dateutil==2.8.1 # via -c requirements.txt, django-silk
pytz==2020.1 # via -c requirements.txt, django, django-silk
requests==2.24.0 # via -c requirements.txt, django-silk
pytz==2021.1 # via -c requirements.txt, django, django-silk
requests==2.25.1 # via -c requirements.txt, django-silk
six==1.15.0 # via -c requirements.txt, pip-tools, python-dateutil
sqlparse==0.3.1 # via -c requirements.txt, django, django-debug-toolbar, django-silk
sqlparse==0.4.1 # via -c requirements.txt, django, django-debug-toolbar, django-silk
toml==0.10.2 # via autopep8
urllib3==1.25.9 # via -c requirements.txt, requests
urllib3==1.26.4 # via -c requirements.txt, requests

# The following packages are considered to be unsafe in a requirements file:
# pip
10 changes: 5 additions & 5 deletions factories/indicators_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,21 @@
DisaggregationType,
DisaggregationLabel,
DisaggregatedValue,
DataCollectionFrequency
DataCollectionFrequency,
)
from factories.workflow_models import OrganizationFactory, ProgramFactory, CountryFactory


FAKER = faker.Faker(locale='en_US')


class ReportingFrequency(DjangoModelFactory):
class ReportingFrequencyFactory(DjangoModelFactory):
class Meta:
model = ReportingFrequency

frequency = 'Bi-weekly'
description = 'Every two weeks'
organization = SubFactory(OrganizationFactory)
sort_order = Sequence(lambda n: n)


class RandomIndicatorFactory(DjangoModelFactory):
Expand Down Expand Up @@ -93,7 +93,7 @@ class DefinedIndicatorFactory(IndicatorFactory):
target_frequency = Indicator.QUARTERLY
means_of_verification = "some means of verifying"
data_collection_method = "some method of collecting data"
data_collection_frequency = SubFactory('factories.indicators_models.DataCollectionFrequencyFactory')
data_collection_frequencies = SubFactory('factories.indicators_models.DataCollectionFrequencyFactory')


class RFIndicatorFactory(DjangoModelFactory):
Expand Down Expand Up @@ -371,4 +371,4 @@ class Meta:

frequency = "some reasonable frequency"
description = "a description of how frequent this is"
numdays = 10
sort_order = Sequence(lambda n: n)
1 change: 1 addition & 0 deletions factories/workflow_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ def convert_to_data(counts_for_tier, parents=None, count=0):

@post_generation
def indicators(self, create, extracted, **kwargs):
"""To assign indicators to levels, pass 'indicators__levels=True' to the class when creating the program """
if extracted:
from factories.indicators_models import RFIndicatorFactory
if kwargs and kwargs.get('levels'):
Expand Down
10 changes: 5 additions & 5 deletions indicators/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ class IndicatorResource(resources.ModelResource):
objective = ManyToManyWidget(Objective, separator=" | ", field="objective")
strategic_objective = ManyToManyWidget(StrategicObjective, separator=" | ", field="strategic_objective")
level = ManyToManyWidget(Level, separator=" | ", field="level")
reporting_frequency = fields.Field(column_name='reporting_frequency', attribute='reporting_frequency',
widget=ForeignKeyWidget(ReportingFrequency, 'frequency'))
reporting_frequencies = ManyToManyWidget(ReportingFrequency, separator=" | ", field="frequency")
data_collection_frequencies = ManyToManyWidget(DataCollectionFrequency, separator=" | ", field="frequency")
sector = fields.Field(column_name='sector', attribute='sector', widget=ForeignKeyWidget(Sector, 'sector'))
program = ManyToManyWidget(Program, separator=" | ", field="name")

Expand All @@ -82,9 +82,9 @@ class Meta:
fields = ('id', 'indicator_type', 'level', 'objective', 'strategic_objective', 'name', 'number',
'source', 'definition', 'justification', 'unit_of_measure', 'baseline', 'lop_target',
'rationale_for_target', 'means_of_verification', 'data_collection_method',
'data_collection_frequency', 'data_points', 'responsible_person',
'method_of_analysis', 'information_use', 'reporting_frequency', 'quality_assurance',
'data_issues', 'indicator_changes', 'comments', 'disaggregation', 'sector',
'data_collection_frequencies', 'data_points', 'responsible_person',
'method_of_analysis', 'information_use', 'reporting_frequencies', 'quality_assurance',
'data_issues', 'comments', 'disaggregation', 'sector',
'program')


Expand Down
Binary file not shown.
Loading

0 comments on commit 4d5f9b4

Please sign in to comment.