Beispiel #1
0
def import_politician_data_from_theunitedstatesio():
    """
    In this method, we import TheUnitedStates.io source data to a local table cache, and then take the cached
    data and move it/merge it with core We Vote data
    :return:
    """
    import_legislators_current_csv()
    transfer_theunitedstatesio_cached_data_to_wevote_tables()
Beispiel #2
0
def import_politician_data_from_theunitedstatesio():
    """
    In this method, we import TheUnitedStates.io source data to a local table cache, and then take the cached
    data and move it/merge it with core We Vote data
    :return:
    """
    import_legislators_current_csv()
    transfer_theunitedstatesio_cached_data_to_wevote_tables()
Beispiel #3
0
def import_theunitedstatesio_from_csv_view(request):
    """
    Take data from csv file and store in the local TheUnitedStatesIo database (TheUnitedStatesIoLegislatorCurrent)
    Then display to the import template from the database
    """
    import_legislators_current_csv()

    template_values = {
        'legislator_list':
        TheUnitedStatesIoLegislatorCurrent.objects.order_by('last_name'),
    }
    return render(request, 'import_export_theunitedstatesio/import.html',
                  template_values)
Beispiel #4
0
def import_theunitedstatesio_from_csv_view(request):
    """
    Take data from csv file and store in the local TheUnitedStatesIo database (TheUnitedStatesIoLegislatorCurrent)
    Then display to the import template from the database
    """
    # If person isn't signed in, we don't want to let them visit this page yet
    if not request.user.is_authenticated():
        return redirect('/admin')

    import_legislators_current_csv()

    template_values = {
        'legislator_list': TheUnitedStatesIoLegislatorCurrent.objects.order_by('last_name'),
    }
    return render(request, 'import_export_theunitedstatesio/import.html', template_values)