-
-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create a better relationship #17
Comments
|
How does that work? What kind of object is passed to the callbacks? I don't even see an object that has a |
The idea is: for the first Block it'll pass a CD type object and for the second one a Track type object. both gotten from the type of the parameter. as it does with the positional one. @moritz And I'm sorry... its not all the code... its based on this example: https://github.com/FCO/Red/wiki/CD-sample |
|
So one thing missing is perhaps annotating the primary key (possibly composite) rather than just unique constraint, I assume here the :id on a column is that its a primary key with an auto index for that one column? perhaps :pk ? with :id being a special single column case of that. In SQLAlchemy at least the auto increment is implied by the type of a primary key, if its a single int column its assumed its a serial etc. I actually think thats a mistake because its not obvious when you're new, and sometimes you might not actually want it as behaviour. |
Was just playing around with the syntax a little bit. I hope it makes sense since I'm a kinda tired right now:
|
Hi @perlpilot! Thanks for your help! My idea of not using explicitly the type, as on Another thing: on actual implementation |
I was thinking that it could be either or. Left off for terseness, but allowed for documentation purposes.
I dunno. Why I used explicit naming of the relationships was for documentation purposes. It makes it a little easier to see what's going on.
I told you I was tired :-) I should have expounded a little on what was going on in my head. Uppercase ID because it seems "special" in that it could imply
I dunno. Even though they aren't actual columns, they act as such as far as the ORM is concerned. Maybe another declarator?
It jibes with my leaning towards self-documention. I like where you're going with this, but it feels like one of those things where if you get all the details right, it'll be awesome and if you miss a few things, it'll just be meh. For instance, the way the Anyway, keep up the good work! Maybe get some input from people who have built ORMs (like Matt Trout). More input and more ideas can only make it better. :-) |
What do you think should happen if some one do:
|
@perlpilot, @moritz @MattOates : what do you guys think about this?
|
This last example is what's "working" now! |
The trait will receive a block and run it passing: if the type of the attribute is positional the attribute type, else the model’s type. It’s return should be a column that is referencing some other column. It will create a new result seq using that.
The text was updated successfully, but these errors were encountered: