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
from flask import Flask, render_template, request | |
from flask_wtf import FlaskForm | |
from wtforms import (SubmitField, SelectMultipleField, widgets) | |
class MultiCheckboxField(SelectMultipleField): | |
widget = widgets.ListWidget(prefix_label=False) | |
option_widget = widgets.CheckboxInput() | |
class ExampleForm(FlaskForm): | |
nums = MultiCheckboxField('label' |
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
apt update -y && apt upgrade -y | |
apt install python3-pip -y | |
pip install git+https://github.com/shadowsocks/shadowsocks.git@master | |
ssserver -p 8888 -k sspassword1234 -m aes-256-cfb --user nobody -d start |
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
from rest_framework import serializers | |
from .models import ClonedTopic, Topic, Note, ExternalDocument | |
# The reason Create and List is separated is that, | |
# if we specify depth, then somehow some of the fields are disabled/not, | |
# available when we do a POST, so we can't essentialy create an object! | |
# This issue is reproduceable you can test it for yourself, | |
# but as for the reason why, I am not investigate it yet. | |
# A separate serializer without depth is needed for CreateView. |