working search with flat endpoint

This commit is contained in:
vabene1111
2024-02-29 20:08:37 +01:00
parent e47bdd043e
commit 1cac34d2a0
143 changed files with 18623 additions and 9992 deletions

View File

@@ -1,10 +1,10 @@
/* tslint:disable */
/* eslint-disable */
/**
* Django Recipes
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document:
* The version of the OpenAPI document: 0.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -13,15 +13,61 @@
*/
import { exists, mapValues } from '../runtime';
import type { OpenDataUnitVersion } from './OpenDataUnitVersion';
import type { OpenDataUnitBaseUnit } from './OpenDataUnitBaseUnit';
import {
OpenDataUnitVersionFromJSON,
OpenDataUnitVersionFromJSONTyped,
OpenDataUnitVersionToJSON,
} from './OpenDataUnitVersion';
OpenDataUnitBaseUnitFromJSON,
OpenDataUnitBaseUnitFromJSONTyped,
OpenDataUnitBaseUnitToJSON,
} from './OpenDataUnitBaseUnit';
import type { OpenDataUnitTypeEnum } from './OpenDataUnitTypeEnum';
import {
OpenDataUnitTypeEnumFromJSON,
OpenDataUnitTypeEnumFromJSONTyped,
OpenDataUnitTypeEnumToJSON,
} from './OpenDataUnitTypeEnum';
import type { OpenDataVersion } from './OpenDataVersion';
import {
OpenDataVersionFromJSON,
OpenDataVersionFromJSONTyped,
OpenDataVersionToJSON,
} from './OpenDataVersion';
/**
* Moves `UniqueValidator`'s from the validation stage to the save stage.
* It solves the problem with nested validation for unique fields on update.
*
* If you want more details, you can read related issues and articles:
* https://github.com/beda-software/drf-writable-nested/issues/1
* http://www.django-rest-framework.org/api-guide/validators/#updating-nested-serializers
*
* Example of usage:
* ```
* class Child(models.Model):
* field = models.CharField(unique=True)
*
*
* class Parent(models.Model):
* child = models.ForeignKey('Child')
*
*
* class ChildSerializer(UniqueFieldsMixin, serializers.ModelSerializer):
* class Meta:
* model = Child
*
*
* class ParentSerializer(NestedUpdateMixin, serializers.ModelSerializer):
* child = ChildSerializer()
*
* class Meta:
* model = Parent
* ```
*
* Note: `UniqueFieldsMixin` must be applied only on the serializer
* which has unique fields.
*
* Note: When you are using both mixins
* (`UniqueFieldsMixin` and `NestedCreateMixin` or `NestedUpdateMixin`)
* you should put `UniqueFieldsMixin` ahead.
* @export
* @interface OpenDataUnit
*/
@@ -31,13 +77,13 @@ export interface OpenDataUnit {
* @type {number}
* @memberof OpenDataUnit
*/
readonly id?: number;
readonly id: number;
/**
*
* @type {OpenDataUnitVersion}
* @type {OpenDataVersion}
* @memberof OpenDataUnit
*/
version: OpenDataUnitVersion;
version: OpenDataVersion;
/**
*
* @type {string}
@@ -58,13 +104,13 @@ export interface OpenDataUnit {
pluralName?: string;
/**
*
* @type {string}
* @type {OpenDataUnitBaseUnit}
* @memberof OpenDataUnit
*/
baseUnit?: OpenDataUnitBaseUnitEnum;
baseUnit?: OpenDataUnitBaseUnit;
/**
*
* @type {string}
* @type {OpenDataUnitTypeEnum}
* @memberof OpenDataUnit
*/
type: OpenDataUnitTypeEnum;
@@ -79,54 +125,20 @@ export interface OpenDataUnit {
* @type {string}
* @memberof OpenDataUnit
*/
readonly createdBy?: string;
readonly createdBy: string;
}
/**
* @export
*/
export const OpenDataUnitBaseUnitEnum = {
G: 'G',
Kg: 'KG',
Ml: 'ML',
L: 'L',
Ounce: 'OUNCE',
Pound: 'POUND',
FluidOunce: 'FLUID_OUNCE',
Tsp: 'TSP',
Tbsp: 'TBSP',
Cup: 'CUP',
Pint: 'PINT',
Quart: 'QUART',
Gallon: 'GALLON',
ImperialFluidOunce: 'IMPERIAL_FLUID_OUNCE',
ImperialPint: 'IMPERIAL_PINT',
ImperialQuart: 'IMPERIAL_QUART',
ImperialGallon: 'IMPERIAL_GALLON'
} as const;
export type OpenDataUnitBaseUnitEnum = typeof OpenDataUnitBaseUnitEnum[keyof typeof OpenDataUnitBaseUnitEnum];
/**
* @export
*/
export const OpenDataUnitTypeEnum = {
Weight: 'WEIGHT',
Volume: 'VOLUME',
Other: 'OTHER'
} as const;
export type OpenDataUnitTypeEnum = typeof OpenDataUnitTypeEnum[keyof typeof OpenDataUnitTypeEnum];
/**
* Check if a given object implements the OpenDataUnit interface.
*/
export function instanceOfOpenDataUnit(value: object): boolean {
let isInstance = true;
isInstance = isInstance && "id" in value;
isInstance = isInstance && "version" in value;
isInstance = isInstance && "slug" in value;
isInstance = isInstance && "name" in value;
isInstance = isInstance && "type" in value;
isInstance = isInstance && "createdBy" in value;
return isInstance;
}
@@ -141,15 +153,15 @@ export function OpenDataUnitFromJSONTyped(json: any, ignoreDiscriminator: boolea
}
return {
'id': !exists(json, 'id') ? undefined : json['id'],
'version': OpenDataUnitVersionFromJSON(json['version']),
'id': json['id'],
'version': OpenDataVersionFromJSON(json['version']),
'slug': json['slug'],
'name': json['name'],
'pluralName': !exists(json, 'plural_name') ? undefined : json['plural_name'],
'baseUnit': !exists(json, 'base_unit') ? undefined : json['base_unit'],
'type': json['type'],
'baseUnit': !exists(json, 'base_unit') ? undefined : OpenDataUnitBaseUnitFromJSON(json['base_unit']),
'type': OpenDataUnitTypeEnumFromJSON(json['type']),
'comment': !exists(json, 'comment') ? undefined : json['comment'],
'createdBy': !exists(json, 'created_by') ? undefined : json['created_by'],
'createdBy': json['created_by'],
};
}
@@ -162,12 +174,12 @@ export function OpenDataUnitToJSON(value?: OpenDataUnit | null): any {
}
return {
'version': OpenDataUnitVersionToJSON(value.version),
'version': OpenDataVersionToJSON(value.version),
'slug': value.slug,
'name': value.name,
'plural_name': value.pluralName,
'base_unit': value.baseUnit,
'type': value.type,
'base_unit': OpenDataUnitBaseUnitToJSON(value.baseUnit),
'type': OpenDataUnitTypeEnumToJSON(value.type),
'comment': value.comment,
};
}