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 User(db.Model, UserMixin): | |
id = db.Column(db.Integer, primary_key=True) | |
nickname = db.Column(db.String(200), unique=True) | |
posts = db.relationship('Post', backref='author', lazy='dynamic') | |
def __repr__(self): | |
return '{}'.format(self.nickname) | |
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
#!/usr/bin/env python -*- coding: utf-8 -*- | |
from flask import request | |
from flask_wtf import FlaskForm, RecaptchaField | |
from wtforms import StringField, SelectField, TextField, TextAreaField, \ | |
DateField, PasswordField, RadioField, BooleanField, SubmitField | |
from wtforms.validators import ValidationError, DataRequired, Length, \ | |
Email, EqualTo, Regexp | |
from app.util.validators import Unique | |
from datetime import datetime | |
from flask_babel import _, lazy_gettext as _l |
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
<table> | |
<tr valign="top"> | |
<td> | |
<h4><a href="{{ url_for('main.source_profile', title=source.title) }}" {{ source.title }} </a></h4><br> | |
<input type="text" value="Amsterdam,Washington,Sydney,Beijing,Cairo" data-role="tagsinput"> | |
</td> | |
</tr> | |
</table> |
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
<p>Categoria: <a href="category/{{ remove_accents(post.category) }}">{{ post.category }}</a></p> |
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
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> | |
<ul class="nav navbar-nav"> | |
<li><a href="{{ url_for('main.index') }}">{{ _('Página Inicial') }}</a></li> | |
<li><a href="{{ url_for('main.explore') }}">{{ _('Explorar') }}</a></li> | |
</ul> | |
<ul class="nav navbar-nav navbar-right"> | |
{% if current_user.is_anonymous %} | |
<li><a href="{{ url_for('auth.login') }}">{{ _('Entrar') }}</a></li> | |
<li><a href="{{ url_for('auth.register') }}">{{ _('Inscrever-se') }}</a></li> | |
{% 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
<table> | |
<tr valign="top"> | |
<td> | |
<h4>{{ similar.name }}</h4><br> | |
</td> | |
</tr> | |
</table> |
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
{% extends "bootstrap/base.html" %} | |
{% block html_attribs %} lang="pt-br"{% endblock %} | |
{% block title %}{{ _('Dados Livres') }}{% endblock %} | |
<!-- Required meta tags --> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | |
<!-- Style CSS --> | |
{% block styles %}{{super()}} | |
<link rel="stylesheet" href="{{url_for('static', filename='css/jquery-ui.css')}}"> | |
<link rel="stylesheet" href="{{url_for('static', filename='css/mystyle.css')}}"> |