Пример #1
0
def get_data(request):
    organiser = CompleteMultigroupOrganiser()

    if request.is_ajax():
        if (
            "countries[]" in request.GET and "indicators[]" in request.GET
        ):  # We should check that we got exactly two indicators!
            countries = request.GET.getlist("countries[]")
            indicators = request.GET.getlist("indicators[]")
            conf.countries = countries
            conf.indicators = indicators
            representation = organiser.get_representation(conf)
            print("representation is:")
            print(representation)
        # If no countries are required return empty json.
        else:
            representation = []
    # For fetching json from /getdata/ url directly.
    else:
        conf.countries = ["HRV", "USA"]
        representation = organiser.get_representation(conf)

    return HttpResponse(simplejson.dumps(representation), mimetype="application/json")
Пример #2
0
def run_matplotlib():
    organiser = CompleteMultigroupOrganiser()
    repr = organiser.get_representation(conf)
Пример #3
0
'''
Created on 26. 6. 2012.

@author: kermit
'''
from foc.visualiser.data_organiser.complete_multigroup import CompleteMultigroupOrganiser
import foc.visualiser.data_presenter.default_vis_conf as conf
from pprint import pprint

def run_matplotlib():
    organiser = CompleteMultigroupOrganiser()
    repr = organiser.get_representation(conf)

if __name__ == '__main__':
    organiser = CompleteMultigroupOrganiser()
    repr = organiser.get_representation(conf)
    pprint(repr)