This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo dpkg --add-architecture armhf | |
sudo apt-get update | |
sudo apt-get install libc6:armhf | |
sudo ln -s /lib/ld-linux-armhf.so.3 /lib/ld-linux.so.3 | |
sudo apt-get install libstdc++6:armhf | |
sudo wget https://www.vpn.net/installers/logmein-hamachi_2.1.0.203-1_armhf.deb | |
sudo dpkg -i logmein-hamachi_2.1.0.203-1_armhf.deb | |
sudo hamachi login | |
sudo hamachi attach-net [email protected] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@method_decorator(csrf_exempt, name='dispatch') | |
class AnnouncementUpdateView(generic.CreateView): | |
model = Announcement | |
fields = ["name", "author", "price", "description", "is_published", "category", "image"] | |
def post(self, request, *args, **kwargs): | |
super().post(request, *args, **kwargs) | |
self.object = self.get_object() | |
announce_data = json.loads(request.body) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# AnnouncementCreate ========= МОДЕЛЬ CREATE READY ================ | |
@method_decorator(csrf_exempt, name='dispatch') | |
class AnnouncementCreateView(generic.CreateView): | |
model = Announcement | |
fields = ["name", "author", "price", "description", "category", "image"] | |
def post(self, request, is_published=None, *args, **keyword): | |
# super().post(request, **keyword) | |
announce_data = json.loads(request.body) | |
# self.object = self.get_object() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Category(models.Model): | |
""" Модель Category(КАТЕГОРИЯ) """ | |
name = models.CharField(_("Наименование"), max_length=64, unique=True) | |
class Location(models.Model): | |
""" Модель местоположения """ | |
name = models.CharField(_("Местоположение"), max_length=250) | |
lat = models.FloatField(_("lat")) | |
lng = models.FloatField(_("lng")) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class BaseUnit(ABC): | |
""" | |
Базовый класс юнита | |
""" | |
def __init__(self, name: str, unit_class: UnitClass): | |
""" | |
При инициализации класса Unit используем свойства класса UnitClass | |
""" | |
self.name = name | |
self.unit_class = unit_class |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65.55.213.73 - - [17/May/2015:15:05:44 +0000] "GET /blog/tags/year%20review HTTP/1.1" 200 34590 "-" "msnbot/2.0b (+http://search.msn.com/msnbot.htm)" | |
65.55.213.73 - - [17/May/2015:15:05:01 +0000] "GET /blog/geekery/year-in-review-2011.html HTTP/1.1" 200 11118 "-" "msnbot/2.0b (+http://search.msn.com/msnbot.htm)" | |
65.55.213.73 - - [17/May/2015:15:05:44 +0000] "GET /blog/geekery/xdotool-2.20110530.html HTTP/1.1" 200 11936 "-" "msnbot/2.0b (+http://search.msn.com/msnbot.htm)" | |
95.153.89.104 - - [17/May/2015:15:05:00 +0000] "GET /files/rubygems615/java-ssl-debug-last-request.txt HTTP/1.1" 200 66717 "https://www.google.com/search?q=proxy+50na50" "Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.7.5) Gecko/20050105 Epiphany/1.4.8" | |
65.55.213.73 - - [17/May/2015:15:05:01 +0000] "GET /blog/tags/tools HTTP/1.1" 200 26510 "-" "msnbot/2.0b (+http://search.msn.com/msnbot.htm)" | |
65.55.213.73 - - [17/May/2015:15:05:50 +0000] "GET /blog/geekery/solving-good-or-bad-problems.html HTTP/1.1" 200 10756 "-" "msnbot/2.0b (+http://search. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from abc import ABC, abstractmethod | |
class Storage(ABC): # Нужно ли сюда делать наследование от ABC? | |
@abstractmethod | |
def add(self, name, qnt): | |
pass | |
@abstractmethod |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from abc import ABC, abstractmethod | |
class Storage(ABC): # Нужно ли сюда делать наследование от ABC? | |
@abstractmethod | |
def add(self, name, qnt): | |
pass | |
@abstractmethod |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from abc import ABC, abstractmethod | |
class Storage(ABC): # Нужно ли сюда делать наследование от ABC? | |
""" | |
Создайте абстрактный класс Storage | |
**Поля:** | |
`items` (словарь название:количество) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from flask import Flask | |
from flask_sqlalchemy import SQLAlchemy | |
from config import Configuration | |
from sqlalchemy.orm import relationship | |
app = Flask(__name__) | |
# app.config.from_object(Configuration) | |
app.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = False |