File tree 1 file changed +8
-12
lines changed
1 file changed +8
-12
lines changed Original file line number Diff line number Diff line change @@ -62,24 +62,20 @@ This demonstrates starting with a json schema and generating python dataclasses
62
62
63
63
### Configuring the Context itself
64
64
65
- Schemey uses a strategy very similar to marshy for configuration.
65
+ Schemey uses [ Injecty] ( https://github.org/tofarr/injecty ) for configuration.
66
+ The default configuration is [ here] ( injecty_config_schemey/__init__.py )
66
67
67
- Schemey looks for top level modules starting with the name ` schemey_config_* ` ,
68
- sorts them by ` priority ` , and applies them to the default context by invoking their
69
- ` configure ` function. [ schemey_config_default/__ init__ .py] ( schemey_config_default/__init__.py )
70
- contains the default set of factories.
71
-
72
- For example, for a project named ` no_more_uuids ` , I may add a file ` schemey_config_no_more_uuids/__init__.py ` :
68
+ For example, for a project named ` no_more_uuids ` , I may add a file ` injecty_config_no_more_uuids/__init__.py ` :
73
69
74
70
```
71
+ from schemey.factory.schema_factory_abc import SchemaFactoryABC
72
+ from schemey.factory.uuid_factory import UuidFactory
73
+
75
74
priority = 120 # Applied after default
76
75
76
+
77
77
def configure(context):
78
- # For some reason, I don't want to be able to generate schemas for uuids!
79
- context.factories = [
80
- f for f in context.factories
81
- if 'uuid' not in f.__class__.__name__.lower()
82
- ]
78
+ context.deregister_impl(SchemaFactoryABC, UuidFactory)
83
79
84
80
```
85
81
You can’t perform that action at this time.
0 commit comments