[Schevo-devel] [TUTORIAL] - Create and Evolve a Simple OO Application

Patrick K. O'Brien pobrien at orbtech.com
Wed Feb 23 10:03:01 EST 2005


Ilias Lazaridis wrote:
> here's the tutorial 0.1 - draft version:
> 
> -
> 
> Creating the Project
> ====================
> 
> open a command window
> 
> cmd: evo new myapp
> 
> within folder "myapp" in the file "entity.py"
> 
> use any editor to insert this:
> 
> //---------------------------------------------------------------------------------
> 
> 
> """Entity schema."""
> 
> class Car:
>     """Type of car."""
> 
>     manufacturer = f.string()
>     model = f.string()
>     modelYear = f.integer()
> 
>     _key(manufacturer, model, modelYear)
> 
>     _icon('.actions.kgpg_key3')
> 
>     def __str__(self):
>         return '%s %s %s' % (
>             self.modelYear, self.manufacturer, self.model)
> 
> //---------------------------------------------------------------------------------
> 
> 
> [preparation steps]
> 
> cmd: evo run myapp
> 
> GUI (schevo navigator): add 2 cars within the schevo-navigator.
> 
> -
> 
> Adding a 1:1 Relation
> =====================
> 
> add class "Owner" to "entity.py"
> 
> add a "1:1" relation to Cars
> 
> [preparation steps]
> 
> cmd: evo run myapp
> 
> GUI: add 2 Owners
> 
> GUI: edit cars, assign Owner to Car [Car is owned by one Owner]
> 
> -
> 
> Adding a 1:N Relation
> =====================
> 
> add class "Drivers" to "entity.py"
> 
> add "1:n" relation to Cars
> 
> [preparation steps]
> 
> cmd: evo run myapp
> 
> GUI: add 3 Drivers
> 
> GUI: edit cars, assign drivers [Car can be driven by several Drivers]
> 
> -
> 
> Adding a M:N Relation
> =====================
> 
> add class "Roads" to "entity.py"
> 
> add "m:n" relation to Cars / Roads
> 
> [preparation steps]
> 
> cmd: evo run myapp
> 
> GUI: add 4 Roads
> 
> GUI: edit cars, assign roads to cars [Car has been driven on many Roads]
> 
> GUI: edit roads, assign cars to roads [Road has been passed by many Cars]

I do not have time right now to fill in all the missing pieces of this
tutorial.  Sorry.

-- 
Patrick K. O'Brien
Orbtech    http://www.orbtech.com
Schevo     http://www.schevo.org
Pypersyst  http://www.pypersyst.org




More information about the Schevo-devel mailing list