Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
open-source
yams
Commits
60b79c822230
Commit
5f3b7465
authored
Apr 29, 2020
by
Laurent Peuch
Browse files
[types] Defintion.name is of type DefinitionName
parent
3ca6cf2849b1
Changes
2
Hide whitespace changes
Inline
Side-by-side
yams/buildobjs.py
View file @
60b79c82
...
...
@@ -129,7 +129,7 @@ def _add_constraint(kwargs: Dict[str, Any], constraint: BaseConstraint) -> None:
def
_add_relation
(
relations
:
List
[
"RelationDefinition"
],
relation_definition
:
"RelationDefinition"
,
name
:
Optional
[
str
]
=
None
,
name
:
Optional
[
yams_types
.
DefinitionName
]
=
None
,
insert_index
:
Optional
[
int
]
=
None
,
)
->
None
:
"""Add relation (param relation_definition) to list of relations (param relations)."""
...
...
@@ -216,7 +216,9 @@ class Definition(object, metaclass=autopackage):
__permissions__
=
MARKER
def
__init__
(
self
,
name
=
None
)
->
None
:
self
.
name
:
str
=
(
name
or
getattr
(
self
,
"name"
,
None
)
or
self
.
__class__
.
__name__
)
self
.
name
:
yams_types
.
DefinitionName
=
yams_types
.
DefinitionName
(
name
or
getattr
(
self
,
"name"
,
None
)
or
self
.
__class__
.
__name__
)
if
self
.
__doc__
:
self
.
description
=
" "
.
join
(
self
.
__doc__
.
split
())
...
...
yams/schema.py
View file @
60b79c82
...
...
@@ -114,7 +114,9 @@ class ERSchema:
"""Base class shared by entity and relation schema."""
@
deprecation
.
argument_renamed
(
old_name
=
"erdef"
,
new_name
=
"entity_relation_definition"
)
def
__init__
(
self
,
schema
:
"Schema"
,
entity_relation_definition
=
None
)
->
None
:
def
__init__
(
self
,
schema
:
"Schema"
,
entity_relation_definition
:
yams_types
.
RelationDefinition
=
None
)
->
None
:
"""
Construct an ERSchema instance.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment