-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Milestone
Description
Create API REST for Content:
- Create serializers and use deserializers for create/update
- Create factories for tests with factory-boy
- For create content, there are two ways:
content-way1: { // Thing or Character already exist in DB
game: game_pk, // int,
position: (lat, lng), // tuple(float, float),
content_type: "Item/Knowledge/Rol/Player/NPC", // str
content_id: item_id, rol_id, ..., // id
}
content-way2: { // Thing or Character not exist and you should create
game: game_pk, // int,
position: (lat, lng), // tuple(float, float),
content_type: "Item/Knowledge/Rol/Player/NPC", // str
content: {
// Thing or Character serializered
},
content_id: item_id, rol_id, ... (when content will be created), // id
}
- Create contents inside games:
When we are creating a game, we should be able to create contents inside game. There are two ways for create:
game-way1: { // Thing or Character already exist
'title': 'Example',
'start': '2018-02-04T07:28:12.546030+00:00',
'preferences': {
'vision_distance': 100,
'meeting_distance': 20,
'visible_character': True
}
'contents': [
{
game: not neccesary you should use this game,
position: (lat, lng), // tuple(float, float),
content_type: "Item/Knowledge/Rol/Player/NPC", // str
content_id: item_id, rol_id, ..., // id
},
],
}
game-way2: { // Thing or Character not exist and you should create
'title': 'Example',
'start': '2018-02-04T07:28:12.546030+00:00',
'preferences': {
'vision_distance': 100,
'meeting_distance': 20,
'visible_character': True
}
'contents': [
{
game: not neccesary you should use this game,
position: (lat, lng), // tuple(float, float),
content_type: "Item/Knowledge/Rol/Player/NPC", // str
content: {
// Thing or Character serializered
},
content_id: item_id, rol_id, ..., // id
},
],
}