Comments (4)
The implementation of this from your fork is merged in with v0.3.0. Thanks!
from epilogue.
This would be a great feature. Did it ever land in a release? The comment from last March seems to indicate it did, but I don't see anything in the readme, and the example from @mbroadst doesn't do anything. I'm using v0.3.2 from NPM.
from epilogue.
@bradisbell yes this feature was merged in and will work, but is generally supported by passing it in to the resource definition like so:
var userResource = epilouge.resource({
model: models.User,
include: [models.Address],
endpoints: ['/rest/users', '/rest/users/:id']
});
This include basically aliases to sequelize's include, so you can do stuff like:
include: [models.Address, { model: models.Person, as: 'peeps' }]
and all that jazz. My intention, based on the last issue brought up, is to provide this for legacy use but to add a feature to opt into "auto-association", pulling in all related associations and potentially new endpoints (like "user/:id/address/:id" for instance). This is not going to make it in in the next two weeks though 😄
The documentation needs a serious update (as you've probably noticed from other closed issues here there are at -least- two other undocumented features: 'sort' and 'q' query items), if you're interested changes would be gladly accepted. Aside from that, I'm out of the country for the next 10 days, so it'll be a little before I can properly update the documentation. In the meantime, the tests have pretty good coverage of the features provided, and show you how you can use them.
from epilogue.
I would be happy to contribute to this great project, but I'm just now getting my feet wet with Sequelize and epilogue so I will wait until I know what I'm doing. I'll check out the tests, thanks! Enjoy your trip!
from epilogue.
Related Issues (20)
- Support to check if Postgres array contains string?
- create inserts nulls on postgres db? HOT 1
- Workflow for pull requests? HOT 2
- Typescript support? HOT 4
- AResouce.list.data.after is not called if AResouce.list.data is not presented
- Controller List is not applying attributes of Model Scope as specified in req.query.scope HOT 1
- search by parameter 'q' does not work HOT 12
- Order of associations HOT 1
- repo unmaintained! active fork: https://github.com/tommybananas/finale HOT 4
- How to add another options item while creating an model instance?
- app[self.method] is not a function
- [Read Endpoint] Get data from two models HOT 1
- Filtering/sorting by association fields
- Project status HOT 1
- EpilogueError: internal error HOT 1
- Sorting ignored with hasMany relationships
- How to define all API routes to be in a separate group
- How do I add auth to all actions of a Resource? HOT 1
- How can I assign fetching items to POST request?
- Cannot set headers after they are sent to the client HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from epilogue.