This file contains 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 A4ordConfirmForm(CrispyForm): | |
code = forms.IntegerField(label=l_(u'Код'), required=True) | |
next_stage = None | |
form = forms.CharField() | |
def __init__(self, *args, **kwargs): | |
super(A4ordConfirmForm, self).__init__(*args, **kwargs) | |
self.session = get_current_session() | |
def get_layout(self, *args, **kwargs): |
This file contains 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 A4ordLoginView(TemplateView, BaseFormView): | |
template_name = 'accounts/a4ord_login.html' | |
success_url = '/' | |
forms = {'A4ordLoginForm': A4ordLoginForm, 'A4ordPasswordForm': A4ordPasswordForm} | |
form_class = A4ordLoginForm | |
prev_form_class = form_class | |
form = None | |
def post(self, request, **kwargs): | |
self.form_class = self.forms[self.request.POST['form']] |
This file contains 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
[ | |
{ | |
"Level": 1, | |
"Code": "A", | |
"Parent": "", | |
"Description": "PRODUCTS OF AGRICULTURE, FORESTRY AND FISHING" | |
}, | |
{ | |
"Level": 2, | |
"Code": "1", |
This file contains 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
def nace_childs(data, parent=''): | |
return list(filter(lambda x: x['Parent'] == parent, data)) | |
def nace_code_tree(data, parent='', max_level=4): | |
nodes = nace_childs(data, parent) | |
for node in nodes: | |
if node['Level'] < max_level: | |
childs = nace_code_tree(data, node['Code'], max_level) | |
else: |
This file contains 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
def parsing_one_group(url: str) -> Dict[str, list[str]]: | |
''' | |
Парсинг одной группы по букве. | |
Возвращает список животных в словаре | |
{"А": "Аардоникс"} | |
''' | |
page = requests.get(url).text | |
soup = BeautifulSoup(page, 'lxml') | |
group = soup.find(id='mw-pages').find('div', class_='mw-category-group') | |
letter = group.find('h3').text |
This file contains 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
2022-08-13 08:11:14 1 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED' | |
2022-08-13 08:11:14 1 [Note] Shutting down plugin 'INNODB_FT_DELETED' | |
2022-08-13 08:11:14 1 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD' | |
2022-08-13 08:11:14 1 [Note] Shutting down plugin 'INNODB_METRICS' | |
2022-08-13 08:11:14 1 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS' | |
2022-08-13 08:11:14 1 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU' | |
2022-08-13 08:11:14 1 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE' | |
2022-08-13 08:11:14 1 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET' | |
2022-08-13 08:11:14 1 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX' | |
2022-08-13 08:11:14 1 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET' |
This file contains 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
#-*- coding: utf-8 -*- | |
import copy | |
import json | |
import monotonic | |
class MyEncoder(json.JSONEncoder): | |
def default(self, obj): | |
return obj.__dict__ |
This file contains 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
CREATE OR REPLACE PROCEDURE CREATE_TABLE_TRANSFORMED_DATA() | |
LANGUAGE 'plpgsql' | |
AS $$ | |
CREATE TABLE IF NOT EXISTS public.transformed_data | |
( | |
value_timestamp timestamp without time zone NOT NULL, | |
CONSTRAINT transformed_data_pkey PRIMARY KEY (value_timestamp) | |
); | |
DECLARE names ARRAY; |
This file contains 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
def upgrade() -> None: | |
# ### commands auto generated by Alembic - please adjust! ### | |
op.alter_column('advice_reactions', 'advice_id', new_column_name='advice_reсomendation_id') | |
op.drop_constraint('advice_reactions_advice_id_fkey', 'advice_reactions', type_='foreignkey') | |
op.create_foreign_key(None, 'advice_reactions', 'advices', ['advice_reсomendation_id'], ['id'], onupdate='CASCADE', ondelete='CASCADE') | |
# ### end Alembic commands ### | |
def downgrade() -> None: | |
# ### commands auto generated by Alembic - please adjust! ### |
This file contains 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
jupyterhub: | |
image: jupyterhub/jupyterhub:2.1.1 | |
container_name: ${CONTAINER_NAME_PREFIX}jupyterhub | |
volumes: | |
- ./jupyterhub/jupyterhub_config.py:/etc/jupyterhub/jupyterhub_config.py | |
- ./jupyterhub/data:/home | |
working_dir: /home/jupyter | |
user: root | |
environment: | |
SERVER_HOST: ${SERVER_HOST} |