1
votes

I saw in a lot a different post that Breeze.js is supposed to work with any http served resource.

In Breeze Documentation, you always have references to OData urls.

For example, the following breeze code:

var query = breeze.EntityQuery()
                  .from("Customers")
                  .where("CompanyName", "startsWith", "C")
                  .orderBy("CompanyName");

Will result in the following OData request:

http://www.example.com/api/Northwind/Customers?$filter=startswith(CompanyName,'C') eq true&$orderby=CompanyName

Well That's nice, but I'm Using Django+Tastypie and it does not support OData parameters, so this request fail on my backend.

How am I supposed to change the way breeze.js generate it's request to API backend server? Did I missed something in Breeze doc? IThank you for your help.

1

1 Answers

2
votes

Take a look at the Edmunds sample. In that sample, the breeze client makes requests of a service that does not speak OData.

If your service doesn't support the OData query syntax, then you can't use the LINQ-like query expressions on the breeze client. You can't use "where" and "orderBy". That's the deal.

You can still compose a query for any service endpoint that accepts a GET request. EntityQuery.from(anyURL) should work fine. You can still leverage the other benefits of Breeze client-side data management - caching, validation, entity navigation, etc. But you'll probably have to construct the metadata on the client and handle query and save yourself.