moment().format("DD/MM/YYYY")
import datetime
class Log(db.Model):
...
date = db.Column(db.DateTime, default=datetime.datetime.now)
...
import datetime
@blueprint.route('/add', methods=["POST", "GET"])
def route():
...
form.date.data = datetime.datetime.now()
if form.validate_on_submit():
#обрабытваем форму
{
"directory": "build/components/",
}
$ bower init
$ bower install --save-dev bootstrap
@app.route('/comment/<int:id>/like', methods=["POST"])
@login_required
def comment_like(id):
comment = Comment.query.get_or_404(id)
comment.like += 1
db.session.add(comment)
db.session.commit()
return jsonify({'likes': comment.like})
<a data-id="{{comment.id}}" class="like-button">Like</a>
$('.like-button').onclick(
...
//Post запрос по url, из data-id
$.ajax({
type: 'POST',
url: "/comment/"+data-id+"/like",
data: data
});
// если удался меняем innerhtml
#start_workflow_code примерно такой код
cd ~/git/works/
git clone ~/git/workflow newproject
cd newproject
npm install
ImportError: No module named pycurl
ImportError: No module named lxml.html
/private/tmp/venv/lib/python2.7/site-packages/grab/deprecated.py:
156
157 @deprecated(use_instead='grab.doc.select()')
158: def xpath_list(self, path, filter=None):
159 if filter is not None:
160 raise GrabMisuseError('Argument `filter` is not supported anymore')
TypeError: 'unicode' object is not callable
for i in c:
print i.text
text
| Text before the first subelement. This is either a string or
| the value None, if there was no text.