Re: Leaf Resources with child Leaf Resources

Jacek Furmankiewicz <[email protected]>
Newsgroups gmane.comp.python.twisted.web
Message-ID <CAGDztiFxWpsrjiqQrLttBfVR_87hApeRa_N95RJHt4VrOznBBQ@mail.gmail.com>
OK, so the issue I have is that I cannot create two separate REST Resources
with nested URLs  e.g.

class CustomerRestService(Resource):
     """Handles REST operations for Customer /customer"""
     pass

class CustomerAddressRestService(Resource):
     """Handles REST operations for Customer Address
/customer/<customerId>/address"""
     pass

Instead I would need to have one common Resource that handles everything
under '/customer',
including the customer entity and customer address entity in one (and any
other entity whose root is '/customer').

That isn't a very good design...especially if you maybe have 50 different
entities hooked up  under '/customer' (like in our app).
It seems in order to enable having nice cohesive classes that provide a
REST service for just one entity I would need to manually
route the request from the root Resource into each of them myself.

That is what i was trying to avoid, but it looks like there is no other
choice.

Jacek

_______________________________________________
Twisted-web mailing list
[email protected]
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.