mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-02 04:39:54 -05:00
posprocessing hook for DRF
This commit is contained in:
112
vue3/src/openapi/models/OpenDataVersionRequest.ts
Normal file
112
vue3/src/openapi/models/OpenDataVersionRequest.ts
Normal file
@@ -0,0 +1,112 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Tandoor
|
||||
* Tandoor API Docs
|
||||
*
|
||||
* The version of the OpenAPI document: 0.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { mapValues } from '../runtime';
|
||||
/**
|
||||
* 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 OpenDataVersionRequest
|
||||
*/
|
||||
export interface OpenDataVersionRequest {
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof OpenDataVersionRequest
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof OpenDataVersionRequest
|
||||
*/
|
||||
code: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof OpenDataVersionRequest
|
||||
*/
|
||||
comment?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the OpenDataVersionRequest interface.
|
||||
*/
|
||||
export function instanceOfOpenDataVersionRequest(value: object): boolean {
|
||||
if (!('name' in value)) return false;
|
||||
if (!('code' in value)) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
export function OpenDataVersionRequestFromJSON(json: any): OpenDataVersionRequest {
|
||||
return OpenDataVersionRequestFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function OpenDataVersionRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): OpenDataVersionRequest {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
|
||||
'name': json['name'],
|
||||
'code': json['code'],
|
||||
'comment': json['comment'] == null ? undefined : json['comment'],
|
||||
};
|
||||
}
|
||||
|
||||
export function OpenDataVersionRequestToJSON(value?: OpenDataVersionRequest | null): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
return {
|
||||
|
||||
'name': value['name'],
|
||||
'code': value['code'],
|
||||
'comment': value['comment'],
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user