Menu

#34 Missing constants for values in fields of relations

v0.3.17
closed
Gulliver
None
1
2014-03-25
2014-02-21
Shun Yu
No

Missing constants for values in fields of relations

Discussion

  • Gulliver

    Gulliver - 2014-02-21

    Could you elaborate a little bit more? Perhaps a little example? ;)

     
  • Gulliver

    Gulliver - 2014-02-21
    • status: open --> pending
    • assigned_to: Gulliver
     
  • Shun Yu

    Shun Yu - 2014-02-21

    I saw the database specification and see that for a relation it looks like this:
    <relation [name="SomeRelation"] [id="1"] [unidir="true"]>
    <relate object="Person" [unique="false"] [limit="one"] [handle="cars"]/>
    <relate object="Car" [limit="many"] [handle="owner"]/>
    ... more related objects ...
    [<field name="order" type="integer"/>]
    ... more relation attributes ...
    </relation>

    where field is defined as [<field name="order" type="integer"/>].
    so it's implemented correctly and would be more of a feature request. :)

    I wish it could be more like this:

    <field name="color" type="integer">
    <value name="Red" value="0"/>
    <value name="Green" value="1"/>
    </field>

    where having the value tags in the field tag mean constants are automatically generated for you, like

    Class::Field::Constant1
    Class::Field::Constant2

     
  • Anonymous

    Anonymous - 2014-02-23

    Is implemented.
    see http://sourceforge.net/apps/trac/litesql/wiki/DefiningDatabase
    and the exampledatabase.xml in litesql/example (see Person::sex).

    It should also work for fields in relation.

     
  • Gulliver

    Gulliver - 2014-02-23
    • status: pending --> closed
     
  • Shun Yu

    Shun Yu - 2014-02-24

    I feel like it wasn't working for when it's inside relations tag but I will double check.

     
  • Gulliver

    Gulliver - 2014-02-24
    • status: closed --> pending
      maybe not working inside relations. waiting for reporters check.
     

    Last edit: Gulliver 2014-02-24
  • Shun Yu

    Shun Yu - 2014-02-25

    http://collabedit.com/xpr3x

    here is the example.
    I have a User object, and it has a gender field, which has 0 and 1 as its values.
    There's also a Friend relation, which has a status field, and it also has 0 and 1 as its values.

    Inside model.hpp, I don't see Friend::Status::requested or Friend::Status::connected anywhere.

    Gracias!

     
  • Gulliver

    Gulliver - 2014-02-25
    • status: pending --> accepted
     
  • Gulliver

    Gulliver - 2014-03-25

    fix is in git repository

     
  • Gulliver

    Gulliver - 2014-03-25
    • status: accepted --> closed
     

Anonymous
Anonymous

Add attachments
Cancel





Auth0 Logo