Coder Social home page Coder Social logo

Comments (4)

dchester avatar dchester commented on September 27, 2024

The implementation of this from your fork is merged in with v0.3.0. Thanks!

from epilogue.

bradisbell avatar bradisbell commented on September 27, 2024

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.

mbroadst avatar mbroadst commented on September 27, 2024

@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.

bradisbell avatar bradisbell commented on September 27, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.