Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cubicweb
cubes
tuto
Commits
0b5b484402dd
Commit
cadb8eaa
authored
Dec 14, 2020
by
François Ferry
Browse files
feat(schema): add schema
close:
#1
parent
e63b18b540c7
Changes
1
Hide whitespace changes
Inline
Side-by-side
cubicweb_tuto/schema.py
View file @
0b5b4844
...
...
@@ -16,3 +16,23 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
"""cubicweb-tuto schema"""
from
yams.buildobjs
import
EntityType
,
String
,
Float
,
SubjectRelation
,
Int
class
Museum
(
EntityType
):
name
=
String
()
latitude
=
Float
()
longitude
=
Float
()
is_in
=
SubjectRelation
(
"City"
,
cardinality
=
"1*"
)
director
=
SubjectRelation
(
"Person"
,
cardinality
=
"**"
)
postal_address
=
String
()
class
City
(
EntityType
):
name
=
String
()
zip_code
=
Int
()
class
Person
(
EntityType
):
name
=
String
()
email
=
String
()
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