Giter Club home page Giter Club logo

demorest's Introduction

Тестовое задание: проект “Афиша”
 
Стоит задача создать веб­приложение “Афиша” на Django с хранением данных в БД 
PostgreSQL. 
 
1. Используя Django ORM, создайте следующую схему:
 
Сервис хранит список событий(например, туры, концерты, выставки, и т.д.). Каждое 
событие имеет список “инстансов” имеющих дату начала/конца и место проведения. 
Например: 
         Событие: тур группы Metallica 
         Инстансы: 
             ● Air Canada Center, Toronto, 2015­09­15 19:00 
             ● Scotiabank Saddledome, Calgary, 2015­09­20 20:00 
Место проведения имеет следующие аттрибуты: 
      ● Название 
      ● Город 
      ● Координаты(используется для geo запросов) 
 
Event имеет следующие аттрибуты: 
      ● Название 
      ● Опасание 
      ● Список “Категорий” 
      ● Список “Инстансов” 
 
 
2. Используя django-rest-framework создайте следуюшие ресурсы:
 
 
GET /api/events?page=1&per_page=10&category=3 (​       list of events with an optional category 
filter) 
GET /api/events/geosearch?lat=&long=&radius=&page=1&per_page=10 (​            find events no 
further than radius km from point(lat, long)) 
 
{ 
  “pagination”: { 
    “has_next”: true, 
    “has_prev”: false 
  }, 
  “data”: [ 
    { 
      “id”: 123, 
      “title”: “Metallica Tour”, 
      “description: “Some description” 
    }, 
    ... 
  ] 
} 
 
GET /api/events/123 ​       (event details) 
{ 
  “id”: 123, 
  “title”: “Metallica Tour”, 
  “desctription”: “Some description”, 
  “instances”: [ 
    { 
      “start”: “2015­09­15 19:00”, 
      “end”: “”, 
      “place”: { 
        “id”: 1, 
        “name”: “Air Canada Center”, 
        “lat”: 43.643466, 
        “long”: ­79.379099, 
        “city”: { 
          “id”: 1, 
          “Name”: “Toronto” 
        } 
      } 
    }, 
    ... 
  ] 
} 
 
POST /api/events ​       (create a new event from JSON body and return newly created object as in 
details, or return 400 with a list of validation errors) 
PUT /api/events/123 ​       (update event with id 123 with JSON body and return updated object as in 
details, or return 400 with a list of validation errors) 
 
3. Используя любой javascript фреймворк, создать приложение для
отображения списка событий с pagination’ом, при клике на event отобразить
детали event’а со списком инстансов:
 
 
  Event 1                    Event 2 
                             Some Desctiption 
  Event 2                     
  Event 3                      start date   Place name   City 
                               start date   Place name   City 
                              
 
<< Prev page | Next page >> 

demorest's People

Contributors

fak3 avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.