@statezero/core 0.2.22 → 0.2.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/actions/backend1/django_app/calculate-hash.d.ts +57 -0
- package/dist/actions/backend1/django_app/calculate-hash.js +80 -0
- package/dist/actions/backend1/django_app/calculate-hash.schema.json +148 -0
- package/dist/actions/backend1/django_app/get-current-username.d.ts +29 -0
- package/dist/actions/backend1/django_app/get-current-username.js +65 -0
- package/dist/actions/backend1/django_app/get-current-username.schema.json +47 -0
- package/dist/actions/backend1/django_app/get-server-status.d.ts +38 -0
- package/dist/actions/backend1/django_app/get-server-status.js +68 -0
- package/dist/actions/backend1/django_app/get-server-status.schema.json +93 -0
- package/dist/actions/backend1/django_app/get-user-info.d.ts +44 -0
- package/dist/actions/backend1/django_app/get-user-info.js +70 -0
- package/dist/actions/backend1/django_app/get-user-info.schema.json +127 -0
- package/dist/actions/backend1/django_app/index.d.ts +1 -0
- package/dist/actions/backend1/django_app/index.js +6 -0
- package/dist/actions/backend1/django_app/process-data.d.ts +51 -0
- package/dist/actions/backend1/django_app/process-data.js +78 -0
- package/dist/actions/backend1/django_app/process-data.schema.json +117 -0
- package/dist/actions/backend1/django_app/send-notification.d.ts +55 -0
- package/dist/actions/backend1/django_app/send-notification.js +81 -0
- package/dist/actions/backend1/django_app/send-notification.schema.json +175 -0
- package/dist/actions/backend1/index.d.ts +1 -0
- package/dist/actions/backend1/index.js +1 -0
- package/dist/actions/default/django_app/calculate-hash.d.ts +57 -0
- package/dist/actions/default/django_app/calculate-hash.js +80 -0
- package/dist/actions/default/django_app/calculate-hash.schema.json +148 -0
- package/dist/actions/default/django_app/get-current-username.d.ts +29 -0
- package/dist/actions/default/django_app/get-current-username.js +65 -0
- package/dist/actions/default/django_app/get-current-username.schema.json +47 -0
- package/dist/actions/default/django_app/get-server-status.d.ts +38 -0
- package/dist/actions/default/django_app/get-server-status.js +68 -0
- package/dist/actions/default/django_app/get-server-status.schema.json +93 -0
- package/dist/actions/default/django_app/get-user-info.d.ts +44 -0
- package/dist/actions/default/django_app/get-user-info.js +70 -0
- package/dist/actions/default/django_app/get-user-info.schema.json +127 -0
- package/dist/actions/default/django_app/index.d.ts +1 -0
- package/dist/actions/default/django_app/index.js +6 -0
- package/dist/actions/default/django_app/process-data.d.ts +51 -0
- package/dist/actions/default/django_app/process-data.js +78 -0
- package/dist/actions/default/django_app/process-data.schema.json +117 -0
- package/dist/actions/default/django_app/send-notification.d.ts +55 -0
- package/dist/actions/default/django_app/send-notification.js +81 -0
- package/dist/actions/default/django_app/send-notification.schema.json +175 -0
- package/dist/actions/default/index.d.ts +1 -0
- package/dist/actions/default/index.js +1 -0
- package/dist/actions/index.d.ts +1 -0
- package/dist/actions/index.js +5 -0
- package/dist/flavours/django/dates.js +4 -1
- package/dist/flavours/django/serializers.js +8 -4
- package/dist/models/backend1/django_app/comprehensivemodel.d.ts +894 -0
- package/dist/models/backend1/django_app/comprehensivemodel.js +71 -0
- package/dist/models/backend1/django_app/comprehensivemodel.schema.json +870 -0
- package/dist/models/backend1/django_app/custompkmodel.d.ts +92 -0
- package/dist/models/backend1/django_app/custompkmodel.js +69 -0
- package/dist/models/backend1/django_app/custompkmodel.schema.json +71 -0
- package/dist/models/backend1/django_app/dailyrate.d.ts +230 -0
- package/dist/models/backend1/django_app/dailyrate.js +71 -0
- package/dist/models/backend1/django_app/dailyrate.schema.json +212 -0
- package/dist/models/backend1/django_app/deepmodellevel1.d.ts +140 -0
- package/dist/models/backend1/django_app/deepmodellevel1.js +72 -0
- package/dist/models/backend1/django_app/deepmodellevel1.schema.json +114 -0
- package/dist/models/backend1/django_app/deepmodellevel2.d.ts +118 -0
- package/dist/models/backend1/django_app/deepmodellevel2.js +71 -0
- package/dist/models/backend1/django_app/deepmodellevel2.schema.json +92 -0
- package/dist/models/backend1/django_app/deepmodellevel3.d.ts +92 -0
- package/dist/models/backend1/django_app/deepmodellevel3.js +69 -0
- package/dist/models/backend1/django_app/deepmodellevel3.schema.json +69 -0
- package/dist/models/backend1/django_app/dummymodel.d.ts +134 -0
- package/dist/models/backend1/django_app/dummymodel.js +71 -0
- package/dist/models/backend1/django_app/dummymodel.schema.json +109 -0
- package/dist/models/backend1/django_app/dummyrelatedmodel.d.ts +92 -0
- package/dist/models/backend1/django_app/dummyrelatedmodel.js +69 -0
- package/dist/models/backend1/django_app/dummyrelatedmodel.schema.json +69 -0
- package/dist/models/backend1/django_app/filetest.d.ts +140 -0
- package/dist/models/backend1/django_app/filetest.js +69 -0
- package/dist/models/backend1/django_app/filetest.schema.json +111 -0
- package/dist/models/backend1/django_app/index.d.ts +1 -0
- package/dist/models/backend1/django_app/index.js +18 -0
- package/dist/models/backend1/django_app/modelwithcustompkrelation.d.ts +118 -0
- package/dist/models/backend1/django_app/modelwithcustompkrelation.js +71 -0
- package/dist/models/backend1/django_app/modelwithcustompkrelation.schema.json +93 -0
- package/dist/models/backend1/django_app/modelwithrestrictedfields.d.ts +134 -0
- package/dist/models/backend1/django_app/modelwithrestrictedfields.js +71 -0
- package/dist/models/backend1/django_app/modelwithrestrictedfields.schema.json +111 -0
- package/dist/models/backend1/django_app/namefiltercustompkmodel.d.ts +92 -0
- package/dist/models/backend1/django_app/namefiltercustompkmodel.js +69 -0
- package/dist/models/backend1/django_app/namefiltercustompkmodel.schema.json +71 -0
- package/dist/models/backend1/django_app/order.d.ts +220 -0
- package/dist/models/backend1/django_app/order.js +71 -0
- package/dist/models/backend1/django_app/order.schema.json +203 -0
- package/dist/models/backend1/django_app/orderitem.d.ts +172 -0
- package/dist/models/backend1/django_app/orderitem.js +72 -0
- package/dist/models/backend1/django_app/orderitem.schema.json +149 -0
- package/dist/models/backend1/django_app/product.d.ts +254 -0
- package/dist/models/backend1/django_app/product.js +71 -0
- package/dist/models/backend1/django_app/product.schema.json +277 -0
- package/dist/models/backend1/django_app/productcategory.d.ts +92 -0
- package/dist/models/backend1/django_app/productcategory.js +69 -0
- package/dist/models/backend1/django_app/productcategory.schema.json +70 -0
- package/dist/models/backend1/django_app/rateplan.d.ts +92 -0
- package/dist/models/backend1/django_app/rateplan.js +69 -0
- package/dist/models/backend1/django_app/rateplan.schema.json +70 -0
- package/dist/models/backend1/django_app/restrictedfieldrelatedmodel.d.ts +108 -0
- package/dist/models/backend1/django_app/restrictedfieldrelatedmodel.js +69 -0
- package/dist/models/backend1/django_app/restrictedfieldrelatedmodel.schema.json +87 -0
- package/dist/models/backend1/fileobject.d.ts +4 -0
- package/dist/models/backend1/fileobject.js +9 -0
- package/dist/models/backend1/index.d.ts +2 -0
- package/dist/models/backend1/index.js +2 -0
- package/dist/models/default/django_app/comprehensivemodel.d.ts +894 -0
- package/dist/models/default/django_app/comprehensivemodel.js +71 -0
- package/dist/models/default/django_app/comprehensivemodel.schema.json +870 -0
- package/dist/models/default/django_app/custompkmodel.d.ts +92 -0
- package/dist/models/default/django_app/custompkmodel.js +69 -0
- package/dist/models/default/django_app/custompkmodel.schema.json +71 -0
- package/dist/models/default/django_app/dailyrate.d.ts +230 -0
- package/dist/models/default/django_app/dailyrate.js +71 -0
- package/dist/models/default/django_app/dailyrate.schema.json +212 -0
- package/dist/models/default/django_app/deepmodellevel1.d.ts +128 -0
- package/dist/models/default/django_app/deepmodellevel1.js +72 -0
- package/dist/models/default/django_app/deepmodellevel1.schema.json +102 -0
- package/dist/models/default/django_app/deepmodellevel2.d.ts +106 -0
- package/dist/models/default/django_app/deepmodellevel2.js +71 -0
- package/dist/models/default/django_app/deepmodellevel2.schema.json +80 -0
- package/dist/models/default/django_app/deepmodellevel3.d.ts +80 -0
- package/dist/models/default/django_app/deepmodellevel3.js +69 -0
- package/dist/models/default/django_app/deepmodellevel3.schema.json +57 -0
- package/dist/models/default/django_app/dummymodel.d.ts +122 -0
- package/dist/models/default/django_app/dummymodel.js +71 -0
- package/dist/models/default/django_app/dummymodel.schema.json +97 -0
- package/dist/models/default/django_app/dummyrelatedmodel.d.ts +80 -0
- package/dist/models/default/django_app/dummyrelatedmodel.js +69 -0
- package/dist/models/default/django_app/dummyrelatedmodel.schema.json +57 -0
- package/dist/models/default/django_app/filetest.d.ts +128 -0
- package/dist/models/default/django_app/filetest.js +69 -0
- package/dist/models/default/django_app/filetest.schema.json +99 -0
- package/dist/models/default/django_app/index.d.ts +1 -0
- package/dist/models/default/django_app/index.js +18 -0
- package/dist/models/default/django_app/modelwithcustompkrelation.d.ts +118 -0
- package/dist/models/default/django_app/modelwithcustompkrelation.js +71 -0
- package/dist/models/default/django_app/modelwithcustompkrelation.schema.json +93 -0
- package/dist/models/default/django_app/modelwithrestrictedfields.d.ts +134 -0
- package/dist/models/default/django_app/modelwithrestrictedfields.js +71 -0
- package/dist/models/default/django_app/modelwithrestrictedfields.schema.json +111 -0
- package/dist/models/default/django_app/namefiltercustompkmodel.d.ts +92 -0
- package/dist/models/default/django_app/namefiltercustompkmodel.js +69 -0
- package/dist/models/default/django_app/namefiltercustompkmodel.schema.json +71 -0
- package/dist/models/default/django_app/order.d.ts +220 -0
- package/dist/models/default/django_app/order.js +71 -0
- package/dist/models/default/django_app/order.schema.json +203 -0
- package/dist/models/default/django_app/orderitem.d.ts +172 -0
- package/dist/models/default/django_app/orderitem.js +72 -0
- package/dist/models/default/django_app/orderitem.schema.json +149 -0
- package/dist/models/default/django_app/product.d.ts +254 -0
- package/dist/models/default/django_app/product.js +71 -0
- package/dist/models/default/django_app/product.schema.json +277 -0
- package/dist/models/default/django_app/productcategory.d.ts +92 -0
- package/dist/models/default/django_app/productcategory.js +69 -0
- package/dist/models/default/django_app/productcategory.schema.json +70 -0
- package/dist/models/default/django_app/rateplan.d.ts +92 -0
- package/dist/models/default/django_app/rateplan.js +69 -0
- package/dist/models/default/django_app/rateplan.schema.json +70 -0
- package/dist/models/default/django_app/restrictedfieldrelatedmodel.d.ts +108 -0
- package/dist/models/default/django_app/restrictedfieldrelatedmodel.js +69 -0
- package/dist/models/default/django_app/restrictedfieldrelatedmodel.schema.json +87 -0
- package/dist/models/default/fileobject.d.ts +4 -0
- package/dist/models/default/fileobject.js +9 -0
- package/dist/models/default/index.d.ts +2 -0
- package/dist/models/default/index.js +2 -0
- package/dist/models/index.d.ts +1 -0
- package/dist/models/index.js +5 -0
- package/package.json +1 -1
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated. Do not make direct changes to the file.
|
|
3
|
+
*/
|
|
4
|
+
import { Model, Manager, QuerySet, getModelClass } from '../../../../src';
|
|
5
|
+
import { wrapReactiveModel } from '../../../../src';
|
|
6
|
+
import schemaData from './dummyrelatedmodel.schema.json';
|
|
7
|
+
/**
|
|
8
|
+
* Model-specific QuerySet implementation
|
|
9
|
+
*/
|
|
10
|
+
export class DummyRelatedModelQuerySet extends QuerySet {
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Model-specific Manager implementation
|
|
14
|
+
*/
|
|
15
|
+
export class DummyRelatedModelManager extends Manager {
|
|
16
|
+
constructor(ModelClass) {
|
|
17
|
+
super(ModelClass, DummyRelatedModelQuerySet);
|
|
18
|
+
}
|
|
19
|
+
newQuerySet() {
|
|
20
|
+
return new DummyRelatedModelQuerySet(this.ModelClass);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Implementation of the DummyRelatedModel model
|
|
25
|
+
*/
|
|
26
|
+
export class DummyRelatedModel extends Model {
|
|
27
|
+
constructor(data) {
|
|
28
|
+
DummyRelatedModel.validateFields(data);
|
|
29
|
+
super(data);
|
|
30
|
+
// Define getters and setters for all fields
|
|
31
|
+
this._defineProperties();
|
|
32
|
+
return wrapReactiveModel(this);
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Define property getters and setters for all model fields
|
|
36
|
+
* @private
|
|
37
|
+
*/
|
|
38
|
+
_defineProperties() {
|
|
39
|
+
// For each field, define a property that gets/sets from internal storage
|
|
40
|
+
DummyRelatedModel.fields.forEach(field => {
|
|
41
|
+
Object.defineProperty(this, field, {
|
|
42
|
+
get: function () {
|
|
43
|
+
return this.getField(field);
|
|
44
|
+
},
|
|
45
|
+
set: function (value) {
|
|
46
|
+
this.setField(field, value);
|
|
47
|
+
},
|
|
48
|
+
enumerable: true, // Make sure fields are enumerable for serialization
|
|
49
|
+
configurable: true
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
// Add a special read-only getter for the repr field
|
|
53
|
+
Object.defineProperty(this, 'repr', {
|
|
54
|
+
get: function () {
|
|
55
|
+
return this.getField('repr');
|
|
56
|
+
},
|
|
57
|
+
enumerable: true, // Make sure repr is enumerable
|
|
58
|
+
configurable: true
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
// Bind this model to its backend
|
|
63
|
+
DummyRelatedModel.configKey = 'default';
|
|
64
|
+
DummyRelatedModel.modelName = 'django_app.dummyrelatedmodel';
|
|
65
|
+
DummyRelatedModel.primaryKeyField = 'id';
|
|
66
|
+
DummyRelatedModel.objects = new DummyRelatedModelManager(DummyRelatedModel);
|
|
67
|
+
DummyRelatedModel.fields = ['id', 'name'];
|
|
68
|
+
DummyRelatedModel.schema = schemaData;
|
|
69
|
+
DummyRelatedModel.relationshipFields = new Map([]);
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{
|
|
2
|
+
"model_name": "django_app.dummyrelatedmodel",
|
|
3
|
+
"title": "Dummy Related Model",
|
|
4
|
+
"class_name": "DummyRelatedModel",
|
|
5
|
+
"plural_title": "Dummy Related Models",
|
|
6
|
+
"primary_key_field": "id",
|
|
7
|
+
"filterable_fields": [
|
|
8
|
+
"name"
|
|
9
|
+
],
|
|
10
|
+
"searchable_fields": [
|
|
11
|
+
"name"
|
|
12
|
+
],
|
|
13
|
+
"ordering_fields": [
|
|
14
|
+
"name"
|
|
15
|
+
],
|
|
16
|
+
"properties": {
|
|
17
|
+
"id": {
|
|
18
|
+
"type": "integer",
|
|
19
|
+
"title": "Id",
|
|
20
|
+
"required": true,
|
|
21
|
+
"description": null,
|
|
22
|
+
"nullable": false,
|
|
23
|
+
"format": "id",
|
|
24
|
+
"max_length": null,
|
|
25
|
+
"choices": null,
|
|
26
|
+
"default": null,
|
|
27
|
+
"validators": [],
|
|
28
|
+
"max_digits": null,
|
|
29
|
+
"decimal_places": null,
|
|
30
|
+
"read_only": true,
|
|
31
|
+
"ref": null
|
|
32
|
+
},
|
|
33
|
+
"name": {
|
|
34
|
+
"type": "string",
|
|
35
|
+
"title": "Name",
|
|
36
|
+
"required": true,
|
|
37
|
+
"description": null,
|
|
38
|
+
"nullable": false,
|
|
39
|
+
"format": null,
|
|
40
|
+
"max_length": 50,
|
|
41
|
+
"choices": null,
|
|
42
|
+
"default": null,
|
|
43
|
+
"validators": [],
|
|
44
|
+
"max_digits": null,
|
|
45
|
+
"decimal_places": null,
|
|
46
|
+
"read_only": false,
|
|
47
|
+
"ref": null
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
"relationships": {},
|
|
51
|
+
"default_ordering": null,
|
|
52
|
+
"definitions": {},
|
|
53
|
+
"datetime_format": "iso-8601",
|
|
54
|
+
"date_format": "iso-8601",
|
|
55
|
+
"time_format": "iso-8601",
|
|
56
|
+
"display": null
|
|
57
|
+
}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Model-specific QuerySet implementation
|
|
3
|
+
*/
|
|
4
|
+
export class FileTestQuerySet {
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Model-specific Manager implementation
|
|
8
|
+
*/
|
|
9
|
+
export class FileTestManager {
|
|
10
|
+
constructor(ModelClass: any);
|
|
11
|
+
newQuerySet(): FileTestQuerySet;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Implementation of the FileTest model
|
|
15
|
+
*/
|
|
16
|
+
export class FileTest {
|
|
17
|
+
static configKey: string;
|
|
18
|
+
static modelName: string;
|
|
19
|
+
static primaryKeyField: string;
|
|
20
|
+
static objects: FileTestManager;
|
|
21
|
+
static fields: string[];
|
|
22
|
+
static schema: {
|
|
23
|
+
model_name: string;
|
|
24
|
+
title: string;
|
|
25
|
+
class_name: string;
|
|
26
|
+
plural_title: string;
|
|
27
|
+
primary_key_field: string;
|
|
28
|
+
filterable_fields: never[];
|
|
29
|
+
searchable_fields: never[];
|
|
30
|
+
ordering_fields: never[];
|
|
31
|
+
properties: {
|
|
32
|
+
id: {
|
|
33
|
+
type: string;
|
|
34
|
+
title: string;
|
|
35
|
+
required: boolean;
|
|
36
|
+
description: null;
|
|
37
|
+
nullable: boolean;
|
|
38
|
+
format: string;
|
|
39
|
+
max_length: null;
|
|
40
|
+
choices: null;
|
|
41
|
+
default: null;
|
|
42
|
+
validators: never[];
|
|
43
|
+
max_digits: null;
|
|
44
|
+
decimal_places: null;
|
|
45
|
+
read_only: boolean;
|
|
46
|
+
ref: null;
|
|
47
|
+
};
|
|
48
|
+
title: {
|
|
49
|
+
type: string;
|
|
50
|
+
title: string;
|
|
51
|
+
required: boolean;
|
|
52
|
+
description: null;
|
|
53
|
+
nullable: boolean;
|
|
54
|
+
format: null;
|
|
55
|
+
max_length: number;
|
|
56
|
+
choices: null;
|
|
57
|
+
default: null;
|
|
58
|
+
validators: never[];
|
|
59
|
+
max_digits: null;
|
|
60
|
+
decimal_places: null;
|
|
61
|
+
read_only: boolean;
|
|
62
|
+
ref: null;
|
|
63
|
+
};
|
|
64
|
+
document: {
|
|
65
|
+
type: string;
|
|
66
|
+
title: string;
|
|
67
|
+
required: boolean;
|
|
68
|
+
description: null;
|
|
69
|
+
nullable: boolean;
|
|
70
|
+
format: string;
|
|
71
|
+
max_length: number;
|
|
72
|
+
choices: null;
|
|
73
|
+
default: null;
|
|
74
|
+
validators: never[];
|
|
75
|
+
max_digits: null;
|
|
76
|
+
decimal_places: null;
|
|
77
|
+
read_only: boolean;
|
|
78
|
+
ref: null;
|
|
79
|
+
};
|
|
80
|
+
image: {
|
|
81
|
+
type: string;
|
|
82
|
+
title: string;
|
|
83
|
+
required: boolean;
|
|
84
|
+
description: null;
|
|
85
|
+
nullable: boolean;
|
|
86
|
+
format: string;
|
|
87
|
+
max_length: number;
|
|
88
|
+
choices: null;
|
|
89
|
+
default: null;
|
|
90
|
+
validators: never[];
|
|
91
|
+
max_digits: null;
|
|
92
|
+
decimal_places: null;
|
|
93
|
+
read_only: boolean;
|
|
94
|
+
ref: null;
|
|
95
|
+
};
|
|
96
|
+
created_at: {
|
|
97
|
+
type: string;
|
|
98
|
+
title: string;
|
|
99
|
+
required: boolean;
|
|
100
|
+
description: null;
|
|
101
|
+
nullable: boolean;
|
|
102
|
+
format: string;
|
|
103
|
+
max_length: null;
|
|
104
|
+
choices: null;
|
|
105
|
+
default: null;
|
|
106
|
+
validators: never[];
|
|
107
|
+
max_digits: null;
|
|
108
|
+
decimal_places: null;
|
|
109
|
+
read_only: boolean;
|
|
110
|
+
ref: null;
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
relationships: {};
|
|
114
|
+
default_ordering: null;
|
|
115
|
+
definitions: {};
|
|
116
|
+
datetime_format: string;
|
|
117
|
+
date_format: string;
|
|
118
|
+
time_format: string;
|
|
119
|
+
display: null;
|
|
120
|
+
};
|
|
121
|
+
static relationshipFields: Map<any, any>;
|
|
122
|
+
constructor(data: any);
|
|
123
|
+
/**
|
|
124
|
+
* Define property getters and setters for all model fields
|
|
125
|
+
* @private
|
|
126
|
+
*/
|
|
127
|
+
private _defineProperties;
|
|
128
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated. Do not make direct changes to the file.
|
|
3
|
+
*/
|
|
4
|
+
import { Model, Manager, QuerySet, getModelClass } from '../../../../src';
|
|
5
|
+
import { wrapReactiveModel } from '../../../../src';
|
|
6
|
+
import schemaData from './filetest.schema.json';
|
|
7
|
+
/**
|
|
8
|
+
* Model-specific QuerySet implementation
|
|
9
|
+
*/
|
|
10
|
+
export class FileTestQuerySet extends QuerySet {
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Model-specific Manager implementation
|
|
14
|
+
*/
|
|
15
|
+
export class FileTestManager extends Manager {
|
|
16
|
+
constructor(ModelClass) {
|
|
17
|
+
super(ModelClass, FileTestQuerySet);
|
|
18
|
+
}
|
|
19
|
+
newQuerySet() {
|
|
20
|
+
return new FileTestQuerySet(this.ModelClass);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Implementation of the FileTest model
|
|
25
|
+
*/
|
|
26
|
+
export class FileTest extends Model {
|
|
27
|
+
constructor(data) {
|
|
28
|
+
FileTest.validateFields(data);
|
|
29
|
+
super(data);
|
|
30
|
+
// Define getters and setters for all fields
|
|
31
|
+
this._defineProperties();
|
|
32
|
+
return wrapReactiveModel(this);
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Define property getters and setters for all model fields
|
|
36
|
+
* @private
|
|
37
|
+
*/
|
|
38
|
+
_defineProperties() {
|
|
39
|
+
// For each field, define a property that gets/sets from internal storage
|
|
40
|
+
FileTest.fields.forEach(field => {
|
|
41
|
+
Object.defineProperty(this, field, {
|
|
42
|
+
get: function () {
|
|
43
|
+
return this.getField(field);
|
|
44
|
+
},
|
|
45
|
+
set: function (value) {
|
|
46
|
+
this.setField(field, value);
|
|
47
|
+
},
|
|
48
|
+
enumerable: true, // Make sure fields are enumerable for serialization
|
|
49
|
+
configurable: true
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
// Add a special read-only getter for the repr field
|
|
53
|
+
Object.defineProperty(this, 'repr', {
|
|
54
|
+
get: function () {
|
|
55
|
+
return this.getField('repr');
|
|
56
|
+
},
|
|
57
|
+
enumerable: true, // Make sure repr is enumerable
|
|
58
|
+
configurable: true
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
// Bind this model to its backend
|
|
63
|
+
FileTest.configKey = 'default';
|
|
64
|
+
FileTest.modelName = 'django_app.filetest';
|
|
65
|
+
FileTest.primaryKeyField = 'id';
|
|
66
|
+
FileTest.objects = new FileTestManager(FileTest);
|
|
67
|
+
FileTest.fields = ['id', 'title', 'document', 'image', 'created_at'];
|
|
68
|
+
FileTest.schema = schemaData;
|
|
69
|
+
FileTest.relationshipFields = new Map([]);
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
{
|
|
2
|
+
"model_name": "django_app.filetest",
|
|
3
|
+
"title": "File Test",
|
|
4
|
+
"class_name": "FileTest",
|
|
5
|
+
"plural_title": "File Tests",
|
|
6
|
+
"primary_key_field": "id",
|
|
7
|
+
"filterable_fields": [],
|
|
8
|
+
"searchable_fields": [],
|
|
9
|
+
"ordering_fields": [],
|
|
10
|
+
"properties": {
|
|
11
|
+
"id": {
|
|
12
|
+
"type": "integer",
|
|
13
|
+
"title": "Id",
|
|
14
|
+
"required": true,
|
|
15
|
+
"description": null,
|
|
16
|
+
"nullable": false,
|
|
17
|
+
"format": "id",
|
|
18
|
+
"max_length": null,
|
|
19
|
+
"choices": null,
|
|
20
|
+
"default": null,
|
|
21
|
+
"validators": [],
|
|
22
|
+
"max_digits": null,
|
|
23
|
+
"decimal_places": null,
|
|
24
|
+
"read_only": true,
|
|
25
|
+
"ref": null
|
|
26
|
+
},
|
|
27
|
+
"title": {
|
|
28
|
+
"type": "string",
|
|
29
|
+
"title": "Title",
|
|
30
|
+
"required": true,
|
|
31
|
+
"description": null,
|
|
32
|
+
"nullable": false,
|
|
33
|
+
"format": null,
|
|
34
|
+
"max_length": 100,
|
|
35
|
+
"choices": null,
|
|
36
|
+
"default": null,
|
|
37
|
+
"validators": [],
|
|
38
|
+
"max_digits": null,
|
|
39
|
+
"decimal_places": null,
|
|
40
|
+
"read_only": false,
|
|
41
|
+
"ref": null
|
|
42
|
+
},
|
|
43
|
+
"document": {
|
|
44
|
+
"type": "string",
|
|
45
|
+
"title": "Document",
|
|
46
|
+
"required": false,
|
|
47
|
+
"description": null,
|
|
48
|
+
"nullable": true,
|
|
49
|
+
"format": "file-path",
|
|
50
|
+
"max_length": 100,
|
|
51
|
+
"choices": null,
|
|
52
|
+
"default": null,
|
|
53
|
+
"validators": [],
|
|
54
|
+
"max_digits": null,
|
|
55
|
+
"decimal_places": null,
|
|
56
|
+
"read_only": false,
|
|
57
|
+
"ref": null
|
|
58
|
+
},
|
|
59
|
+
"image": {
|
|
60
|
+
"type": "string",
|
|
61
|
+
"title": "Image",
|
|
62
|
+
"required": false,
|
|
63
|
+
"description": null,
|
|
64
|
+
"nullable": true,
|
|
65
|
+
"format": "file-path",
|
|
66
|
+
"max_length": 100,
|
|
67
|
+
"choices": null,
|
|
68
|
+
"default": null,
|
|
69
|
+
"validators": [],
|
|
70
|
+
"max_digits": null,
|
|
71
|
+
"decimal_places": null,
|
|
72
|
+
"read_only": false,
|
|
73
|
+
"ref": null
|
|
74
|
+
},
|
|
75
|
+
"created_at": {
|
|
76
|
+
"type": "string",
|
|
77
|
+
"title": "Created at",
|
|
78
|
+
"required": true,
|
|
79
|
+
"description": null,
|
|
80
|
+
"nullable": false,
|
|
81
|
+
"format": "date-time",
|
|
82
|
+
"max_length": null,
|
|
83
|
+
"choices": null,
|
|
84
|
+
"default": null,
|
|
85
|
+
"validators": [],
|
|
86
|
+
"max_digits": null,
|
|
87
|
+
"decimal_places": null,
|
|
88
|
+
"read_only": true,
|
|
89
|
+
"ref": null
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
"relationships": {},
|
|
93
|
+
"default_ordering": null,
|
|
94
|
+
"definitions": {},
|
|
95
|
+
"datetime_format": "iso-8601",
|
|
96
|
+
"date_format": "iso-8601",
|
|
97
|
+
"time_format": "iso-8601",
|
|
98
|
+
"display": null
|
|
99
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export * from './dummyrelatedmodel';
|
|
2
|
+
export * from './dummymodel';
|
|
3
|
+
export * from './filetest';
|
|
4
|
+
export * from './deepmodellevel3';
|
|
5
|
+
export * from './deepmodellevel2';
|
|
6
|
+
export * from './deepmodellevel1';
|
|
7
|
+
export * from './comprehensivemodel';
|
|
8
|
+
export * from './custompkmodel';
|
|
9
|
+
export * from './modelwithcustompkrelation';
|
|
10
|
+
export * from './namefiltercustompkmodel';
|
|
11
|
+
export * from './productcategory';
|
|
12
|
+
export * from './product';
|
|
13
|
+
export * from './order';
|
|
14
|
+
export * from './orderitem';
|
|
15
|
+
export * from './rateplan';
|
|
16
|
+
export * from './dailyrate';
|
|
17
|
+
export * from './restrictedfieldrelatedmodel';
|
|
18
|
+
export * from './modelwithrestrictedfields';
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Model-specific QuerySet implementation
|
|
3
|
+
*/
|
|
4
|
+
export class ModelWithCustomPKRelationQuerySet {
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Model-specific Manager implementation
|
|
8
|
+
*/
|
|
9
|
+
export class ModelWithCustomPKRelationManager {
|
|
10
|
+
constructor(ModelClass: any);
|
|
11
|
+
newQuerySet(): ModelWithCustomPKRelationQuerySet;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Implementation of the ModelWithCustomPKRelation model
|
|
15
|
+
*/
|
|
16
|
+
export class ModelWithCustomPKRelation {
|
|
17
|
+
static configKey: string;
|
|
18
|
+
static modelName: string;
|
|
19
|
+
static primaryKeyField: string;
|
|
20
|
+
static objects: ModelWithCustomPKRelationManager;
|
|
21
|
+
static fields: string[];
|
|
22
|
+
static schema: {
|
|
23
|
+
model_name: string;
|
|
24
|
+
title: string;
|
|
25
|
+
class_name: string;
|
|
26
|
+
plural_title: string;
|
|
27
|
+
primary_key_field: string;
|
|
28
|
+
filterable_fields: string[];
|
|
29
|
+
searchable_fields: string[];
|
|
30
|
+
ordering_fields: string[];
|
|
31
|
+
properties: {
|
|
32
|
+
id: {
|
|
33
|
+
type: string;
|
|
34
|
+
title: string;
|
|
35
|
+
required: boolean;
|
|
36
|
+
description: null;
|
|
37
|
+
nullable: boolean;
|
|
38
|
+
format: string;
|
|
39
|
+
max_length: null;
|
|
40
|
+
choices: null;
|
|
41
|
+
default: null;
|
|
42
|
+
validators: never[];
|
|
43
|
+
max_digits: null;
|
|
44
|
+
decimal_places: null;
|
|
45
|
+
read_only: boolean;
|
|
46
|
+
ref: null;
|
|
47
|
+
};
|
|
48
|
+
name: {
|
|
49
|
+
type: string;
|
|
50
|
+
title: string;
|
|
51
|
+
required: boolean;
|
|
52
|
+
description: null;
|
|
53
|
+
nullable: boolean;
|
|
54
|
+
format: null;
|
|
55
|
+
max_length: number;
|
|
56
|
+
choices: null;
|
|
57
|
+
default: null;
|
|
58
|
+
validators: never[];
|
|
59
|
+
max_digits: null;
|
|
60
|
+
decimal_places: null;
|
|
61
|
+
read_only: boolean;
|
|
62
|
+
ref: null;
|
|
63
|
+
};
|
|
64
|
+
custom_pk_related: {
|
|
65
|
+
type: string;
|
|
66
|
+
title: string;
|
|
67
|
+
required: boolean;
|
|
68
|
+
description: null;
|
|
69
|
+
nullable: boolean;
|
|
70
|
+
format: string;
|
|
71
|
+
max_length: null;
|
|
72
|
+
choices: null;
|
|
73
|
+
default: null;
|
|
74
|
+
validators: never[];
|
|
75
|
+
max_digits: null;
|
|
76
|
+
decimal_places: null;
|
|
77
|
+
read_only: boolean;
|
|
78
|
+
ref: null;
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
relationships: {
|
|
82
|
+
custom_pk_related: {
|
|
83
|
+
type: string;
|
|
84
|
+
model: string;
|
|
85
|
+
class_name: string;
|
|
86
|
+
primary_key_field: string;
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
default_ordering: null;
|
|
90
|
+
definitions: {
|
|
91
|
+
MoneyField: {
|
|
92
|
+
type: string;
|
|
93
|
+
properties: {
|
|
94
|
+
amount: {
|
|
95
|
+
type: string;
|
|
96
|
+
};
|
|
97
|
+
currency: {
|
|
98
|
+
type: string;
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
datetime_format: string;
|
|
104
|
+
date_format: string;
|
|
105
|
+
time_format: string;
|
|
106
|
+
display: null;
|
|
107
|
+
};
|
|
108
|
+
static relationshipFields: Map<string, {
|
|
109
|
+
ModelClass: () => any;
|
|
110
|
+
relationshipType: string;
|
|
111
|
+
}>;
|
|
112
|
+
constructor(data: any);
|
|
113
|
+
/**
|
|
114
|
+
* Define property getters and setters for all model fields
|
|
115
|
+
* @private
|
|
116
|
+
*/
|
|
117
|
+
private _defineProperties;
|
|
118
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated. Do not make direct changes to the file.
|
|
3
|
+
*/
|
|
4
|
+
import { Model, Manager, QuerySet, getModelClass } from '../../../../src';
|
|
5
|
+
import { wrapReactiveModel } from '../../../../src';
|
|
6
|
+
import schemaData from './modelwithcustompkrelation.schema.json';
|
|
7
|
+
/**
|
|
8
|
+
* Model-specific QuerySet implementation
|
|
9
|
+
*/
|
|
10
|
+
export class ModelWithCustomPKRelationQuerySet extends QuerySet {
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Model-specific Manager implementation
|
|
14
|
+
*/
|
|
15
|
+
export class ModelWithCustomPKRelationManager extends Manager {
|
|
16
|
+
constructor(ModelClass) {
|
|
17
|
+
super(ModelClass, ModelWithCustomPKRelationQuerySet);
|
|
18
|
+
}
|
|
19
|
+
newQuerySet() {
|
|
20
|
+
return new ModelWithCustomPKRelationQuerySet(this.ModelClass);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Implementation of the ModelWithCustomPKRelation model
|
|
25
|
+
*/
|
|
26
|
+
export class ModelWithCustomPKRelation extends Model {
|
|
27
|
+
constructor(data) {
|
|
28
|
+
ModelWithCustomPKRelation.validateFields(data);
|
|
29
|
+
super(data);
|
|
30
|
+
// Define getters and setters for all fields
|
|
31
|
+
this._defineProperties();
|
|
32
|
+
return wrapReactiveModel(this);
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Define property getters and setters for all model fields
|
|
36
|
+
* @private
|
|
37
|
+
*/
|
|
38
|
+
_defineProperties() {
|
|
39
|
+
// For each field, define a property that gets/sets from internal storage
|
|
40
|
+
ModelWithCustomPKRelation.fields.forEach(field => {
|
|
41
|
+
Object.defineProperty(this, field, {
|
|
42
|
+
get: function () {
|
|
43
|
+
return this.getField(field);
|
|
44
|
+
},
|
|
45
|
+
set: function (value) {
|
|
46
|
+
this.setField(field, value);
|
|
47
|
+
},
|
|
48
|
+
enumerable: true, // Make sure fields are enumerable for serialization
|
|
49
|
+
configurable: true
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
// Add a special read-only getter for the repr field
|
|
53
|
+
Object.defineProperty(this, 'repr', {
|
|
54
|
+
get: function () {
|
|
55
|
+
return this.getField('repr');
|
|
56
|
+
},
|
|
57
|
+
enumerable: true, // Make sure repr is enumerable
|
|
58
|
+
configurable: true
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
// Bind this model to its backend
|
|
63
|
+
ModelWithCustomPKRelation.configKey = 'default';
|
|
64
|
+
ModelWithCustomPKRelation.modelName = 'django_app.modelwithcustompkrelation';
|
|
65
|
+
ModelWithCustomPKRelation.primaryKeyField = 'id';
|
|
66
|
+
ModelWithCustomPKRelation.objects = new ModelWithCustomPKRelationManager(ModelWithCustomPKRelation);
|
|
67
|
+
ModelWithCustomPKRelation.fields = ['id', 'name', 'custom_pk_related'];
|
|
68
|
+
ModelWithCustomPKRelation.schema = schemaData;
|
|
69
|
+
ModelWithCustomPKRelation.relationshipFields = new Map([
|
|
70
|
+
['custom_pk_related', { 'ModelClass': () => getModelClass('django_app.custompkmodel', 'default'), 'relationshipType': 'foreign-key' }]
|
|
71
|
+
]);
|