Skip to content

Instantly share code, notes, and snippets.

Avatar
📡
there is no time to explain, write the code!

akbarov o. masterbpro

📡
there is no time to explain, write the code!
View GitHub Profile
View gist:5f63f0b481a245c47adfd7a6aed65f9c
@login_required()
def index_view(request):
"""
Отображения всех доступных объектов для пользователя
"""
facilities = Facility.objects.filter(group_of_installers__in=request.user.groups)
print(facilities)
return render(request, 'facility/view_facilities.html',
{'facilities': facilities})
View gist:11a010125e362fa39f149eddd7b68d93
# view.py
@login_required()
def index_view(request):
"""
Отображения всех доступных объектов для пользователя
"""
user_group = User.objects.get(id=request.user.id).groups.all()
facilities = []
for x in user_group:
View parser
import requests
from bs4 import BeautifulSoup
from loguru import logger
PAGE_URL = "https://filmix.zone/filmy/page/{page_num}"
class FilmZone:
def __init__(self):
self.session = requests.Session()