Ignore:
Timestamp:
11/11/11 14:05:02 (9 years ago)
Author:
mnagni
Message:

removed all the EA LIbrary until they are in stable status

Location:
mauRepo/MolesManager/trunk
Files:
5 added
19 deleted
6 edited

Legend:

Unmodified
Added
Removed
  • mauRepo/MolesManager/trunk/src/MolesManager/dataaccess.py

    r7970 r7976  
    1111    return '%s = \'%s\'' % (key, keyValue) 
    1212 
    13 def getDatePrecisionById(id): 
     13def getDateById(id): 
    1414      
    1515    session = MOLES3DB.getSession() 
     
    1717    print(res) 
    1818    return res.all() 
     19 
  • mauRepo/MolesManager/trunk/src/MolesManager/forms/date.py

    r7970 r7976  
    1212 
    1313def createForm(object = None): 
    14     form = CoreForm(object) 
    15     return type('CoreForm', (Form,), form._createFields())     
     14    form = Model2Form(object) 
     15    return type('CoreForm', (CoreForm,), form._createFields())     
    1616 
    1717class CoreForm(Form): 
     18    pass 
     19     
    1820 
    19     def __init__(self, object = None): 
    20         super(CoreForm, self).__init__(self)             
     21class Model2Form(object): 
     22    def __init__(self, object = None):                  
    2123        self._instance = None 
    2224        self._clazz = None 
     
    2729            self._instance = object 
    2830            self._clazz = type(object) 
    29  
    30         self._createFields() 
    3131 
    3232    def _createFields(self): 
     
    4040                    except Exception as e: 
    4141                        print e 
    42         return coreFields  
     42        return coreFields 
    4343            
    4444    def _manageInstrumentedAttribute(self, attrName, attrValue): 
     
    6060                pass 
    6161            elif (attrValue.direction.name == 'ONETOMANY'):                                 
    62                 return CoreForm(attrValue.mapper.class_) 
     62                return createForm(getattr(self._instance, attrName)) 
    6363     
    6464    def _extractValue(self, attrName): 
  • mauRepo/MolesManager/trunk/src/MolesManager/forms/formsFactory.py

    r7970 r7976  
    66from django.db import models 
    77from django.forms.fields import CharField, DecimalField, IntegerField 
    8 from ea_model.iso_19103_2005_schema_language.basic_types.primitive.date_and_time.dateprecision import DatePrecision 
    98from ascore.asenumeration import EnumSymbol 
    109from django.forms.formsets import formset_factory 
  • mauRepo/MolesManager/trunk/src/MolesManager/settings.py

    r7970 r7976  
    22import os 
    33from db_manager.dbConnection import DBConnection, DBScript 
    4 from libs.model.ModelForm import CustomFormFactory 
    5 from db_manager.DBMetadataHelper import DBMetadataHelper 
    64 
    75DEBUG = True 
     
    169167MOLES3DB_SCRIPT = SITE_ROOT + ADMIN_MEDIA_PREFIX + 'sqlTables.py' 
    170168MOLES3DB = DBConnection('postgresql://badc:rotyn217m@neptune.badc.rl.ac.uk:5432/Moles3', DBScript(MOLES3DB_SCRIPT)) 
    171 DB_METADATA_HELPER = DBMetadataHelper() 
    172 SessionTest = MOLES3DB.getSession() 
    173 CUSTOM_FORM_FACTORY = CustomFormFactory(None) 
  • mauRepo/MolesManager/trunk/src/MolesManager/static/templates/date.html

    r7970 r7976  
    22 
    33{{ form.day }}/{{ form.month }}/{{ form.year }} 
     4{{ form.precision.precision }} - {{ form.precision.determinationMethod }} 
    45 
    56{{ form.as_p }} 
  • mauRepo/MolesManager/trunk/src/MolesManager/views/dateView.py

    r7970 r7976  
    44@author: mnagni 
    55''' 
    6 from MolesManager.dataaccess import getDatePrecisionById 
     6from MolesManager.dataaccess import getDateById 
    77from MolesManager.forms.date import createForm 
    88from django.shortcuts import render_to_response 
     
    1818    return sampleForm 
    1919    ''' 
    20     dp = getDatePrecisionById(1) 
     20    dp = getDateById(1) 
    2121    return createForm(dp[0]) 
    2222def dateView(request): 
Note: See TracChangeset for help on using the changeset viewer.