# Collection of code snippets by Arne Vajhøj 
# (from articles on eksperten.dk / vajhoej.dk written sometime between 2004 and now) 
from java.math import BigDecimal

from dk.vajhoej.isam.map import PyIsamMap

import Customer
import CustomerActual
import Order

cmap = PyIsamMap.createIsamMapRMS('customer.isq', CustomerActual)
cmap.putDict({'id': 9, \
              'name': 'I company', \
              'phone': '9999-9999',
              'status': Customer.ACTUAL, \
              'address1': 'I road 9', \
              'address2': 'I town', \
              'contact': 'Mr. I'})
omap = PyIsamMap.createIsamMapRMS('order.isq', Order)
omap.putDict({'id': 9, \
              'customer': 9, \
              'status': 'In progress', \
              'nlines': 1, \
              'line': [{'item': 'X stuff', 'quantity': 1, 'price': BigDecimal('72.00')}]})
