From 8c79176598020449d84e23d432579a9d0717808c Mon Sep 17 00:00:00 2001 From: kyle roux Date: Sat, 14 Jun 2014 18:32:57 -0700 Subject: [PATCH] fixed sqlalchemy declarative import in base.models file --- base/forms.py | 5 +++-- base/models.py | 3 ++- base/templates/blocks/auth_header.html | 8 ++++---- base/templates/blocks/login_form.html | 14 ++++++++------ base/templates/blocks/messages.html | 8 ++++---- base/templates/blocks/navigation.html | 16 +++++++++------- base/templates/layout.html | 15 ++++++++++----- base/templates/macros/form_helpers.html | 8 ++++---- ext.py | 2 +- 9 files changed, 45 insertions(+), 34 deletions(-) diff --git a/base/forms.py b/base/forms.py index 188d436..431c01a 100644 --- a/base/forms.py +++ b/base/forms.py @@ -10,8 +10,9 @@ :license: BSD, see LICENSE for more details. """ -from flask.ext.wtf import Form, TextField, Required, PasswordField -from wtforms.validators import Email +from flask.ext.wtf import Form +from wtforms.fields import TextField,PasswordField +from wtforms.validators import Email, Required class LoginForm(Form): diff --git a/base/models.py b/base/models.py index 9036cc2..788bc4d 100644 --- a/base/models.py +++ b/base/models.py @@ -11,6 +11,7 @@ """ from flask.ext.login import UserMixin +from sqlalchemy.ext.declarative import declared_attr from werkzeug.security import generate_password_hash, check_password_hash from ext import db @@ -18,7 +19,7 @@ class CRUDMixin(object): __table_args__ = {'extend_existing': True} - id = db.Column(db.Integer, primary_key=True) + id = db.Column(db.Integer,db.Sequence('user_id_seq'),primary_key=True) @classmethod def get_by_id(cls, id): diff --git a/base/templates/blocks/auth_header.html b/base/templates/blocks/auth_header.html index 2d981d5..bc84fc3 100644 --- a/base/templates/blocks/auth_header.html +++ b/base/templates/blocks/auth_header.html @@ -5,9 +5,9 @@
{% else %} @@ -17,4 +17,4 @@ -{% endif %} \ No newline at end of file +{% endif %} diff --git a/base/templates/blocks/login_form.html b/base/templates/blocks/login_form.html index ca7e0d0..05ae380 100644 --- a/base/templates/blocks/login_form.html +++ b/base/templates/blocks/login_form.html @@ -2,13 +2,15 @@ {% if current_user.is_anonymous() %} -
+ {{ form.hidden_tag() }} - {{ common_form_field(form.email, class_='input common-form__input') }} - {{ common_form_field(form.password, class_='input common-form__input') }} -
- - + {{ common_form_field(form.email, class_='form-control') }} + {{ common_form_field(form.password, class_='form-control') }} +
+ +
{% else %} diff --git a/base/templates/blocks/messages.html b/base/templates/blocks/messages.html index 2e02890..23396c1 100644 --- a/base/templates/blocks/messages.html +++ b/base/templates/blocks/messages.html @@ -1,11 +1,11 @@ {% with messages = get_flashed_messages() %} {% if messages %} -
-
    +
    +
      {% for message in messages %} -
    • {{ message }}
    • +
    • {{ message }}
    • {% endfor %}
    {% endif %} -{% endwith %} \ No newline at end of file +{% endwith %} diff --git a/base/templates/blocks/navigation.html b/base/templates/blocks/navigation.html index 5d33c66..9b9720f 100644 --- a/base/templates/blocks/navigation.html +++ b/base/templates/blocks/navigation.html @@ -1,16 +1,18 @@ {% from "macros/form_helpers.html" import render_field %} - diff --git a/base/templates/layout.html b/base/templates/layout.html index 3a51e53..3686b7d 100644 --- a/base/templates/layout.html +++ b/base/templates/layout.html @@ -4,15 +4,18 @@ {% block page_title %}Flask Kit{% endblock %} {% block css %} - {% assets "css_base" %} + {#{% assets "css_base" %} - {% endassets %} + {% endassets %}#} + + + {% endblock %} - {% block js %} + {% block js %}{# {% assets "js_base" %} - {% endassets %} + {% endassets %}#} {% endblock %} @@ -42,6 +45,8 @@

    for great good

    {% block footer %} {% include 'blocks/footer.html' %} + + {% endblock %} - \ No newline at end of file + diff --git a/base/templates/macros/form_helpers.html b/base/templates/macros/form_helpers.html index 7838ef6..2b77092 100644 --- a/base/templates/macros/form_helpers.html +++ b/base/templates/macros/form_helpers.html @@ -1,13 +1,13 @@ {% macro common_form_field(field) %} -
    +
    {% if field.label.text %} -