I want to filter data, getting data from api, but it isnt working, any solution ?
$scope.filter_all2 = function(value) {
$scope.filtered_inventories = new Inventory().query({model: value, manufacturer: value}).$object;
};
my template
<select ng-model="inventory.model" ng-change="filter_all2(inventory.model)">
<option value="">Model</option>
<option ng-repeat="inventory in inventories | unique:'model'" value="{{inventory.model}}">{{inventory.model}}</div>
</select>
<select ng-model="inventory.manufacturer" ng-change="filter_all2(inventory.manufacturer)">
<option value="">Manufacturer</option>
<option ng-repeat="inventory in inventories | unique:'manufacturer'" value="{{inventory.manufacturer}}">{{inventory.manufacturer}}</div>
</select>
EDIT:
Tastypie api, information.
class InventoryResource(ModelResource):
assigned = fields.ForeignKey('bos_inventory.api.AssignedResource', 'assigned', full=True, null=True)
location = fields.ForeignKey('bos_inventory.api.LocationResource', 'location', full=True, null=True)
tags = fields.ToManyField(TagResource, 'tags', full=True, null=True)
class Meta:
queryset = Inventory.objects.all()
resource_name = 'inventory'
list_allowed_methods = ['get', 'put', 'post', 'delete', 'copy']
detail_allowed_methods = ['get', 'put', 'post', 'delete', 'copy']
authorization = DjangoAuthorization()
authorization = Authorization()
serializer = Serializer()
filtering = {'id': ALL, 'barcode': ALL, 'model': ALL, 'manufacturer': ALL, 'location': ALL, 'tags': ALL, 'assigned': ALL, 'inventory': ALL}