Skip to content

coco_api version 1.0.0#1004

Open
vermastuti wants to merge 36 commits intomasterfrom
coco_api_stuti
Open

coco_api version 1.0.0#1004
vermastuti wants to merge 36 commits intomasterfrom
coco_api_stuti

Conversation

@vermastuti
Copy link
Copy Markdown
Contributor

@vermastuti vermastuti commented May 8, 2020

Steps to apply changes:

  • Install libraries from requirements.txt
    (mainly djangorestframework==3.6.4
    djangorestframework-csv==2.1.0)
  • (Only in case tokens are not generated) Run python manage.py migrate command to implement TokenAuthentication
  • Implement changes in base_settings.py
  • Run python manage.py runserver

Changes summary:

  • New files have been added and changes are made in the following apps:
    -- activities
    -- videos
    -- geographies
    -- people
    -- programs
  • New api to get a match for provided comma separated phone numbers in people module has been added
  • A new property F_count has been added to people serializer to ease calculation in Redash for data visualization
  • A new folder coco_api has been created to keep utils, permissions and constants files
  • Logging has been added for views and the folder is: coco_api/log/logfile.log
  • Pagination has been added for all views
  • Permission named IsDGRestricted has been added to control access to views on the basis of django.contrib.auth.models.Group as mapped by PERMISSIONS_MAP in constants.py

Comment thread dg/urls.py Outdated
Comment thread dg/urls.py Outdated
Comment thread dg/urls.py Outdated
Comment thread dg/urls.py Outdated
Comment thread geographies/serializers.py
Comment thread geographies/serializers.py Outdated
Comment thread geographies/serializers.py Outdated
Comment thread geographies/serializers.py Outdated
Comment thread geographies/serializers.py Outdated
Comment thread dg/base_settings.py Outdated
Comment thread dg/base_settings.py
Comment thread activities/urls.py Outdated
Comment thread activities/views.py Outdated
Comment thread activities/views.py Outdated
Comment thread activities/views.py Outdated
Comment thread dg/urls.py Outdated
Comment thread videos/urls.py Outdated
Comment thread activities/urls.py Outdated
Comment thread people/views.py
Comment thread people/views.py
queryset = Person.objects.all().order_by('id')

if phoneNumberExists in ["true","t","yes","y"]:
queryset = queryset.filter(phone_no__isnull=False).exclude(phone_no__in=[''])
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic incorrect as it would provide numbers like 9, 0, 1 etc. Add a more generalised logic for numbers.

Comment thread people/views.py Outdated
Comment thread people/views.py Outdated
@sagardg
Copy link
Copy Markdown
Contributor

sagardg commented Jun 10, 2020

try to add try except blocks where ever you think your code could break and try adding testcases.

@sujit22993 sujit22993 self-assigned this Jun 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants