source: mauRepo/MolesManager/trunk/src/MolesManager/views/cedaObservationView.py @ 8091

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/mauRepo/MolesManager/trunk/src/MolesManager/views/cedaObservationView.py@8091
Revision 8091, 924 bytes checked in by mnagni, 8 years ago (diff)

The migration process now includes
1) deployment_data files
2) XML document hash
3) full Dojo support


Line 
1'''
2Created on 1 Nov 2011
3
4@author: mnagni
5'''
6from django.shortcuts import render_to_response
7from django.core.context_processors import csrf
8from MolesManager.forms.commons import ObjectById
9from ea_model.ceda_metadatamodel.ceda_observation.ceda_observation import CEDA_Observation
10from MolesManager.moles3epb import Moles3EPB
11from MolesManager.djencoder import DJEncoder
12
13
14def __getSample(request, c):
15    '''
16    @param request: an HttpRequest
17    @param objectId: an istance of ObjectById 
18    '''
19    if request.POST.has_key('obs_id'):
20        dp = Moles3EPB.search(CEDA_Observation, request.POST['obs_id'], request.moles_session)
21        c['records'] = dp
22
23def coView(request):
24    c = {}
25    __getSample(request, c)
26    if c.has_key('records'):
27        c['coObs'] = DJEncoder().encode(c['records'])
28        print c['coObs'] 
29   
30    c.update(csrf(request))
31    return render_to_response('cedaObservation.html', c)
Note: See TracBrowser for help on using the repository browser.