[Nitro] Nitro/OG examples that show recommended ......

George Moschovitis george.moschovitis at gmail.com
Fri Sep 2 10:09:59 EDT 2005

> OK.....I did look at that and will experiment with that, but are there "controls" already defined to work with them.  i.e Are there text fields that will automatically pull from the defined variable and to prefill the field, and then when posting automatically validates and set the data to the correct field.  If there are errors how does it display them? On the same page or is this configurable???

This is a work in progress. Have a look at the new scaffolding and
auto admin code. This code does not support validations yet, but this
will be available shortly. As an example have a look at Flare.

> I did look at this and dug deeper into the OG source code.  And while it does look like it can handle a legacy schema fairly well,
> I don't believe it currently works with compound primary keys.  Everywhere in the source it refers to a pk field, it does not seem to allow for an array of these.  Or have I just totally misunderstood something fundamental.

The next version will feature dynamic finder so you will be able to do this:

Article.find_by_oid_and_author(2, 'gmosx')

For the moment you can emulate this:

def find_by_oid_and_author(oid, author)
  find(:condition => "oid = #{oid} AND author='#{author}'")

you can also define the compound sql index:

class Article
  sql_index oid, author

> Cool....I guess the only part I am missing is how to describe this?  And are there requirements > that they be set in the constructor or can they be set after object creation vie assessor fields.
> ...
> I am missing how I tell OG to map the fields to the sub-object Address contianed by Customer.

I am not sure if this works in legacy schemas, but in normal mode Og
handles the mapping automatically for you. Then again I am not sure I
correctly understood your question. I am running a lot today.



More information about the Nitro-general mailing list