Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
e6025d5
Добавлены зависимости
LHLHLHE Feb 22, 2023
ca1673e
Создана основа приложения
LHLHLHE Feb 22, 2023
a4120bd
Настроен alembic для миграций
LHLHLHE Feb 22, 2023
9969675
Добавлен .gitignore
LHLHLHE Feb 22, 2023
ecf719b
Добавлены модели пользователей
LHLHLHE Feb 22, 2023
097cb9e
Добавлены пидантик схемы для юзеров
LHLHLHE Feb 27, 2023
d5b0683
created pubs model
tinkofoxil Mar 3, 2023
c7c14c3
created alcohol model
tinkofoxil Mar 3, 2023
182da5c
Добавлен файл запуска приложения
LHLHLHE Mar 6, 2023
5adb957
Новые зависиости
LHLHLHE Mar 6, 2023
ef7a9b3
Добавлена зависимости сессии базы данных
LHLHLHE Mar 6, 2023
d32ec44
Исправлен импорт
LHLHLHE Mar 6, 2023
6b71fe7
Добавлены схемы для токена
LHLHLHE Mar 6, 2023
5d538c0
Добавлена логика авторизации (в процессе...)
LHLHLHE Mar 6, 2023
78262a1
Добавлен роутер юзеров
LHLHLHE Mar 6, 2023
7a4b24a
Исправлены настройки бд
LHLHLHE Mar 7, 2023
10e98f3
Завершена регистрация/авторизация для игроков
LHLHLHE Mar 7, 2023
7d03c5e
Добавлен эндпоинт для просмотра своего аккаунта
LHLHLHE Mar 9, 2023
23305a2
Изменена структура приложения
LHLHLHE Mar 9, 2023
2da836e
Изменена структура приожения
LHLHLHE Mar 10, 2023
4679063
Доделана регистрация и вход ля игроков и компаний
LHLHLHE Mar 13, 2023
9460ed1
Добавлено все для персонала
LHLHLHE Mar 13, 2023
e34138c
Изменены коды ответов
LHLHLHE Mar 14, 2023
09d0fc0
Получение данных токена вынесено в отдельую функцию
LHLHLHE Mar 14, 2023
de425ae
Изменение почты игрока (в процессе)
LHLHLHE Mar 14, 2023
4c7ee83
Переехали на Django
LHLHLHE Mar 16, 2023
331123e
Переехали на Django
LHLHLHE Mar 16, 2023
3cbb6b6
Удален лишний файл run_server.py
LHLHLHE Mar 16, 2023
77c9d7e
Удалены лишние файлы
LHLHLHE Mar 16, 2023
cc759c0
Добавлена зависимочть для DRF
LHLHLHE Mar 16, 2023
ea99c04
Добавлены пользователи
LHLHLHE Mar 16, 2023
f6dc754
Переход на Django
tinkofoxil Mar 16, 2023
9f08e53
Добавлена drf в зависимости
tinkofoxil Mar 16, 2023
8ecd8db
Создана модель пабов
tinkofoxil Mar 16, 2023
b0f4eaa
Изменен gitignore
tinkofoxil Mar 16, 2023
58db135
Изменен gitignore
tinkofoxil Mar 16, 2023
d30b3e5
Delete .vscode directory
tinkofoxil Mar 16, 2023
1aab523
Пабы добавлены в админку
tinkofoxil Mar 16, 2023
aaaa619
Merge branch 'backend-pubs' of https://github.com/TerrifyingAnt/PubGo…
tinkofoxil Mar 16, 2023
967f1d7
Создана модель алкоголя
tinkofoxil Mar 16, 2023
871deca
Создана модель меню
tinkofoxil Mar 16, 2023
c6217a0
Добавлен Pillow
LHLHLHE Mar 22, 2023
84da4cf
Добавлено приложение api
LHLHLHE Mar 22, 2023
ff8db97
Добавлены пермишны
LHLHLHE Mar 22, 2023
93f49fc
Добавлены настройки для DRF и Djoser
LHLHLHE Mar 22, 2023
6a50814
Доработаны пользователи
LHLHLHE Mar 23, 2023
cd4f8fa
Доработаны пользователи
LHLHLHE Mar 23, 2023
e0a9274
Джосер
LHLHLHE Mar 23, 2023
556baba
Новое приложение
LHLHLHE Mar 23, 2023
11b76ea
Исправлен сериализатор для друзей
LHLHLHE Mar 24, 2023
c474c12
Добавлено ограничение на добавление в друзья только для игроков
LHLHLHE Mar 24, 2023
95a3307
Delete backend/games directory
LHLHLHE Mar 24, 2023
0af57b8
Merged backend-users
LHLHLHE Mar 24, 2023
4b238bc
Добавлено приложение игр
LHLHLHE Mar 24, 2023
3877c0d
Добавлена модель этапа
LHLHLHE Mar 25, 2023
4699af7
Merged backend-pubs
tinkofoxil Mar 31, 2023
c1f41bb
Update settings.py
tinkofoxil Mar 31, 2023
b19c0fe
Update requirements.txt
tinkofoxil Mar 31, 2023
3fcec0d
Update .gitignore
tinkofoxil Mar 31, 2023
e49c103
added user in pubs
tinkofoxil Apr 3, 2023
891fca7
Added Pub in Serializers
tinkofoxil Apr 3, 2023
6d97ec7
Добавлен статус подтверждения дружбы
LHLHLHE Apr 11, 2023
5aabf91
added pubs views
tinkofoxil Apr 14, 2023
29e81bf
Created Pub and Menu viewsets
tinkofoxil Apr 19, 2023
f1cc3c1
Created Pub and Menu viewsets
tinkofoxil Apr 19, 2023
fa15576
added validation of name in menu
tinkofoxil Apr 19, 2023
158e449
Допилены пабы
LHLHLHE Apr 26, 2023
7f556fc
Проверены и доделаны пабы
tinkofoxil May 5, 2023
35ad375
произошло слияние
LHLHLHE May 9, 2023
eab88b5
Новые миграции
LHLHLHE May 9, 2023
4023bb9
Добавлена автодока
LHLHLHE May 9, 2023
af66ec0
Исправлена дружба
LHLHLHE May 12, 2023
1b4780f
Создана модель приглашения
tinkofoxil May 15, 2023
fd1a476
Доделаны комнаты и приглашения
tinkofoxil May 17, 2023
a98c9f1
Доделано validate в GameUser
tinkofoxil May 17, 2023
13b6ee4
Просто отступ
tinkofoxil May 17, 2023
48611c3
Доработано создание игры
LHLHLHE May 22, 2023
eb89395
Старт игры (в процессе)
LHLHLHE May 25, 2023
6c8f02b
Добавлен старт игры
LHLHLHE May 26, 2023
f8bb28a
Отредачены пабы
tinkofoxil May 31, 2023
89921c0
Доделайте пабы(((
tinkofoxil May 31, 2023
eedc3fd
Добавлена зависимость
LHLHLHE Jun 1, 2023
c5c77e8
Сделан старт игры
LHLHLHE Jun 1, 2023
4229291
Добавлен завершение игры
LHLHLHE Jun 4, 2023
1fec7b7
Доработаны старт и финиш игры
LHLHLHE Jun 4, 2023
979646a
Доделан вывод списка игр
LHLHLHE Jun 4, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
157 changes: 157 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal


# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
.pdm.toml

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
.idea/
Empty file added backend/api/__init__.py
Empty file.
5 changes: 5 additions & 0 deletions backend/api/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from django.apps import AppConfig


class ApiConfig(AppConfig):
name = 'api'
5 changes: 5 additions & 0 deletions backend/api/pagination.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from rest_framework.pagination import PageNumberPagination


class GamesAndFriendsPagination(PageNumberPagination):
page_size = 10
48 changes: 48 additions & 0 deletions backend/api/permissions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
from rest_framework import permissions


class PlayerPermission(permissions.BasePermission):

def has_permission(self, request, view):
return (request.user.is_authenticated
and not request.user.is_company)

def has_object_permission(self, request, view, obj):
return (request.user.is_authenticated
and not request.user.is_company)


class CompanyPermission(permissions.BasePermission):

def has_permission(self, request, view):
return (request.user.is_authenticated
and request.user.is_company)

def has_object_permission(self, request, view, obj):
return (request.user.is_authenticated
and request.user.is_company)


class ReadOnlyPermission(permissions.BasePermission):

def has_permission(self, request, view):
return request.method in permissions.SAFE_METHODS

def has_object_permission(self, request, view, obj):
return request.method in permissions.SAFE_METHODS


class IsOwnerOrReadOnly(permissions.BasePermission):
def has_object_permission(self, request, view, obj):
if request.method in permissions.SAFE_METHODS:
return True

return obj.company == request.user


class IsPubOwnerOrReadOnly(permissions.BasePermission):
def has_object_permission(self, request, view, obj):
if request.method in permissions.SAFE_METHODS:
return True

return obj.pub.company == request.user
Loading