On Monday 24 December 2007 4:35 am, Ed Leafe wrote:
> On Dec 23, 2007, at 10:53 PM, johnf wrote:
> > Adrian pointed out that the doc's stated
> > "Updates the contained controls with current values from the source"
> >
> > I can see someone getting confused about the word 'source'. Maybe
> > some other
> > word could be used like 'Cursor', DataSet?
>
> I don't see how those are any less confusing, since those unfamiliar
> with client-server development could just as easily assume that the
> cursor is also connected live to the database, and 'DataSet' sounds
> just like 'DataBase'.
>
> The problem is simply getting to understand client-server
> development. I've seen this same confusion in VFP developers who are
> used to live table access when they first switch to MySQL or SQL
> Server or some other server backend for their data. They are used to
> thinking that when they edit a value in a textbox, they are editing
> it in the database, and have a difficult time making the leap to
> thinking in terms of disconnected data.
>
> -- Ed Leafe
Its not a problem with understanding the client-server model. I am also
learning to use the python ORM Storm (https://storm.canonical.com/), which by
the way is the first one I understand, after failed attempts at SqlAlchemy
and SqlObjects. It is not three tier like Dabo, but does have a similar
db-->obj layout. To help here is an obj class from Storm
class EmployeeBasic(Storm):
""" Basic information on employee.
"""
__storm_table__ = 'employee_basic'
employee_id = Int(primary=True,name='eb_employee_id')
last_name = Unicode(name='eb_last_name')
first_name = Unicode(name='eb_first_name')
middle_initial = Unicode(name='eb_middle_initial')
active = Bool(name='eb_active')
date_activate = Date(name='eb_date_activate')
date_deactivate = Date(name='eb_date_deactivate')
ts_insert = DateTime(name='eb_ts_insert')
ts_update = DateTime(name='eb_ts_update')
punch = ReferenceSet(employee_id,'PunchTable.employee_id',
order_by='PunchTable.card_punch')
EB_KW=['active','date_activate']
def __init__(self, first_name, last_name, middle_initial=None,**kwargs):
""" By default an employee is entered with defaults of active=1(True) and
date_activate=current date. Should that behavior need to be overriden it
is possible to use the kwargs to pass different values to active and
date_activate.
"""
self.first_name = first_name
self.last_name = last_name
self.middle_initial = middle_initial
if not (kwargs):
pass
else:
for key,value in kwargs.items():
object.__setattr__(self,key,value)
The difference is the use of __storm_table__ to indicate the underlying table
in Storm versus self.DataSource in Dabo. In only becomes an issue when you
are parsing the api docs and trying to figure out what source refers to. In
the case of save() or requery() it is the underlying table, in the case of
update() it is the bizobj. I am not saying to change the name, just make it
explicit in the docs where in the process the procedure works.
--
Adrian Klaver
[EMAIL PROTECTED]
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/dabo-users/[EMAIL PROTECTED]