Open sebpatu opened 10 years ago
At the moment the "id:SUId" field is not added through the macro, but rather in the base ufront.db.Object
class.
I think one workaround may be to split it into:
sys.db.Object
- standard haxe db objectufront.db.BaseObject extends sys.db.Object
- adds save() and our ufront's build macroufront.db.Object extends BaseObject
- adds id, created, modified.So that way you could use BaseObject
and specify your own ID.
Some work would be required to get this to work cleanly with BelongsTo<>
and ManyToMany
and HasMany
relations, it is certainly possible. Pull requests welcome :) Otherwise I'll look at it when I get time.
Hi, The ufront ORM will automatically add the field id, but if i define an id field in my Spod, i get a compile error. It would be good if the ufront macro let users define custom fields, and add it automatically only when it does not exist.
Thanks Seb