Added phone number
This commit is contained in:
parent
2d6640b8b9
commit
24d1b7c094
4 changed files with 31 additions and 1 deletions
|
@ -24,7 +24,7 @@ class UserAdminModel(ModelBaseView):
|
||||||
class LocationAdminModel(ModelBaseView):
|
class LocationAdminModel(ModelBaseView):
|
||||||
column_searchable_list = ('name', 'address', 'website')
|
column_searchable_list = ('name', 'address', 'website')
|
||||||
inline_models = None
|
inline_models = None
|
||||||
form_columns = ('name', 'address', 'website')
|
form_columns = ('name', 'address', 'website', 'telephone')
|
||||||
|
|
||||||
|
|
||||||
admin = Admin(app, name='Haldis', url='/admin', template_mode='bootstrap3')
|
admin = Admin(app, name='Haldis', url='/admin', template_mode='bootstrap3')
|
||||||
|
|
26
app/migrations/versions/3243c3538fc_.py
Normal file
26
app/migrations/versions/3243c3538fc_.py
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
"""Add telephone number
|
||||||
|
|
||||||
|
Revision ID: 3243c3538fc
|
||||||
|
Revises: 2d696203e56
|
||||||
|
Create Date: 2015-06-04 18:39:54.895177
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
# revision identifiers, used by Alembic.
|
||||||
|
revision = '3243c3538fc'
|
||||||
|
down_revision = '2d696203e56'
|
||||||
|
|
||||||
|
from alembic import op
|
||||||
|
import sqlalchemy as sa
|
||||||
|
|
||||||
|
|
||||||
|
def upgrade():
|
||||||
|
### commands auto generated by Alembic - please adjust! ###
|
||||||
|
op.add_column('location', sa.Column('telephone', sa.String(length=20), nullable=True))
|
||||||
|
### end Alembic commands ###
|
||||||
|
|
||||||
|
|
||||||
|
def downgrade():
|
||||||
|
### commands auto generated by Alembic - please adjust! ###
|
||||||
|
op.drop_column('location', 'telephone')
|
||||||
|
### end Alembic commands ###
|
|
@ -45,6 +45,7 @@ class Location(db.Model):
|
||||||
name = db.Column(db.String(120), nullable=False)
|
name = db.Column(db.String(120), nullable=False)
|
||||||
address = db.Column(db.String(254))
|
address = db.Column(db.String(254))
|
||||||
website = db.Column(db.String(120))
|
website = db.Column(db.String(120))
|
||||||
|
telephone = db.Column(db.String(20), nullable=True)
|
||||||
products = db.relationship('Product', backref='location', lazy='dynamic')
|
products = db.relationship('Product', backref='location', lazy='dynamic')
|
||||||
orders = db.relationship('Order', backref='location', lazy='dynamic')
|
orders = db.relationship('Order', backref='location', lazy='dynamic')
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,9 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<br/>
|
<br/>
|
||||||
location: <a href="{{ order.location.website }}">{{ order.location.name }}</a><br/>
|
location: <a href="{{ order.location.website }}">{{ order.location.name }}</a><br/>
|
||||||
|
{% if order.location.telephone != None %}
|
||||||
|
telephone: <a href="tel://{{ order.location.telephone }}">{{ order.location.telephone }}</a><br/>
|
||||||
|
{% endif %}
|
||||||
<b>status:</b> {% if order.stoptime %}<span class="time">{{ order.stoptime|countdown }}</span>{% else %}open{% endif %}<br/>
|
<b>status:</b> {% if order.stoptime %}<span class="time">{{ order.stoptime|countdown }}</span>{% else %}open{% endif %}<br/>
|
||||||
total price: {{ total_price|euro }}
|
total price: {{ total_price|euro }}
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue