wadobo / socializa-api

Socializa is an interactive game for play it out of home
GNU Affero General Public License v3.0
1 stars 0 forks source link

ContentTypes API call #14

Open Virako opened 5 years ago

Virako commented 5 years ago

We need API call for obtain a some ContentTypes where key is a ContentType pk and value is a name of model.

GET: content/types/

return:

{
  15: 'item',
  23: 'knowledge',
  24: 'player',
  ...
}

We only need 5 elements: Player, NPC, Item, Knowledge and Rol. This call will be necessary when are creating a new Content from frontend.

ContentType is a django model where are saved all django models:

from django.contrib.contenttypes.models import ContentType