Date index for Aug 2002
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [achievo] [DEV] atkManyToOneRelation
Perhaps I've confused myself and everyone else in the process!
The effect I want is to establish a "one-to-many" in a lookup/drop down
list such as the class.usercontracts demonstrates.
Table with one-of-a-kind is "Technology_Classes"
- Primary key=Technology_Class_ID
Table with many is "Technology_SubClasses"
- Primary key=Technology_SubClass_ID
- Field for linkage is Technology_ParentClass_ID,
so that it results in:
One technology class has zero-to-many sub-classes.
Surely there must be a way to do this, but my tired old head just
doesn't grasp it today!
TIA for advice. I think once I can see it work with my own modules, I
will have "conquered the next hill". (my retired military thing may be
showing here!!)
Dave Nuttall
San Antonio, TX
> Hi,
>
> Dave Nuttall wrote:
>
> > It looks like the code is supposed to pull a matching record from
> > employee where the userid field value in employee matches the value
in
> > usercontract.
> > What do I do if the field names in the related tables are not the
same?
>
> Doesn't matter. It takes the primary key field (which it knows
because
> of the AF_PRIMARY flag) of that table, and stores it in the current
> table under the name you give it ("userid" in this case).
>
> an atkManyToOneRelation is used in this situation:
>
> Each contract is associated with exactly one employee, so when
editing a
> contract, you want to see a dropdown of users.
>
> The name of the attribute ("userid") is ofcourse the name of the
field
> in the contracts table. This doesn't have to be the same as the field
in
> the employee table. For example, see class.projects.inc, it contains
a
> manytoonerelation with name "coordinator" and that works too.
>
> By the way, relations will be discussed in detail in part 2 of the
guide.
>
> Greetings,
> Ivo
>
> --
> Ivo Jansch <ivo dot
> ibuildings.nl BV - information technology
> http://www.ibuildings.nl
>
>
>
> [ Achievo mailing list - http://www.achievo.org/ ]
> [ to unsubscribe send an e-mail to achievo-unsubscribe dot
>
>