Skip to content

Instantly share code, notes, and snippets.

View Barolina's full-sized avatar

꧁꧂Larisa Barolina

View GitHub Profile

FROM overcoder

От толкания в отладчике и источнике: все модели Django используют метакласс ModelBase, определенный в /db/models/base.py. Для каждого поля в определении класса модели метод ModelBase .add_to_class вызовет метод поля .contribute_to_class.

Field.contribute_to_class определяется в /db/models/fields/__init__.py, и это отвечает за сопоставление определения поля с конкретной моделью. Поле изменяется путем добавления свойства .model и вызова метода .set_attributes_from_name с именем, используемым в определении класса модели. Это, в свою очередь, добавляет свойства .attname и .column и устанавливает .name и .verbose_name при необходимости.

Когда я 
1 непрерывное планирование
2 совместное развитие
3 непрерывное тестирование
4 непрерывный выпуск и развитие
5 непрерывный мониторинг
6 постоянная обратная связь и оптимизация
@Barolina
Barolina / recovery.md
Created May 7, 2020 07:10
pythin and pika and recovery (while)
Blocking connection can be recovered in exception handling style (similar to php client). For example:

while True:
    connection = pika.BlockingConnection(parameters)

    channel = connection.channel()
    channel.basic_consume(on_message, 'queue')

 try:
@Barolina
Barolina / http status.md
Created March 13, 2020 06:21
http status (rest)

HTTP Return Code

HTTP defines status code. When designing REST API, don't just use 200 for success or 404 for error. Always use the semantically appropriate status code for the response.

Here is a non-exhaustive selection of security related REST API status codes. Use it to ensure you return the correct code.

Code Message Description
200 OK Response to a successful REST API action. The HTTP method can be GET, POST, PUT, PATCH or DEL
@Barolina
Barolina / упаковка а python пакет (рекурсивный обход).md
Last active March 12, 2020 13:47
сборка ptython пакета (c рекурсивным обходом)

в файле MANIFEST.in

# Include the README
include *.md

# Include the license file
include LICENSE.txt

# Include locale files
@Barolina
Barolina / заказ выписок бесплатно.md
Last active January 29, 2020 06:31
заказ выписок бесплатно.md

Способы:

1 Межвед:

  • только гос учреж

2 Прямое взаимоействие

  • ограниченный срок жизни (полгода а может болько )
A transport and architecture agnostic RPC library that focuses on exposing services with a well-defined API using popular protocols. http://spyne.io

Linux: поиск изменных файлов в диреткории

> find "путь до директории" -cmin -"время"

пример (поииск измененных за последние 5 мин в директории /var/log/)

> find /var/log/ -cmin -5