Coder Social home page Coder Social logo

profiles's People

Contributors

asmedrano avatar jdveiga avatar jtellis avatar njali2001 avatar zcrosby avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

profiles's Issues

data_domain requests with GET parameters always result in a 500 error

An example of what I mean can be viewed here

The indicators variable is commented out, but still being used in the if else statement of data_domain and none of the GET parameters are actually being used.

Is it necessary to continue to use the if/else statement? Could something like this work instead?

def data_domain(request, geo_level_slug, geo_record_slug, data_domain_slug):
    """ Overview of a data domain for a geo record """
    level = get_object_or_404(GeoLevel, slug=geo_level_slug)

    try:
        record = GeoRecord.objects.defer('mappings', 'components', 'parent').get(level=level, slug=geo_record_slug)
    except GeoRecord.DoesNotExist:
        raise Http404

    filter_key = ''
    if level.related_within:
        geoids = json.loads(record.geo_id_segments)
        sum_lev = level.related_within.summary_level
        filter_key = geoids[sum_lev]

    domain = get_object_or_404(DataDomain, slug=data_domain_slug)
    levels = get_levels_as_list()

    return render_to_response('profiles/data_domain.html',
        {
            'geo_level': level,
            'geo_record': record,
            'data_domain': domain,
            'level_json':json.dumps({'id':level.id, 'name':level.lev_name, 'slug':level.slug, 'sumlev':level.summary_level}),
            'levels': json.dumps(levels),
            'rec_json':json.dumps({'id':record.id, 'name': record.name, 'slug':record.slug, 'geom_id':record.get_geom_id(), 'geo_id':record.geo_id}),
            'filter_key': filter_key,
         },
        context_instance=RequestContext(request))

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.