The Z Layout
I’m definitely going to use this technique on my next business site: Understanding the Z-Layout in Web Design
I’m definitely going to use this technique on my next business site: Understanding the Z-Layout in Web Design
I’m getting more comfortable with Flask, so I decided to experiment with Google App Engine + Flask + HandsOnTable.
I made a small app that takes the contents of the 2nd column and matches it to the rows of the first column. I’ve found myself doing this a few times by manually creating two python lists and comparing them in IDLE, so it saves me that work.
Here’s the code: https://github.com/pawl/2ColumnMatch
from sqlalchemy import create_engine, MetaData, Table
engine = create_engine('sqlite:///cars.db', echo=False)
metadata = MetaData(bind=engine)
table = Table('cars', metadata)
stmt = table.select()
for row in stmt.execute():
print row
This page has a great example of when to use the Entity-Attribute-Value data model: http://stackoverflow.com/questions/7933596/django-dynamic-model-fields
I’m planning to use it for an application I’m making which has user defined fields.
http://stackoverflow.com/questions/8947616/python-sqlalchemy-get-column-names-dynamically
Rob Wouter’s answer really helped me out:
You can either find the columns by calling
result.keys()or you can access them through callingv.keys()inside the for loop. Here’s an example usingitems():for v in result: for column, value in v.items(): print('{0}: {1}'.format(column, value))
The documentation says: “Keyword arguments can be specified by specifying the last argument as a dictionary”
So you will need to change this:
__table_args__ = (
{'sqlite_autoincrement': True},
UniqueConstraint('filename', 'path')
)
to this:
__table_args__ = (
UniqueConstraint('filename', 'path'),
{'sqlite_autoincrement': True}
)
Make sure you have a row id number as your primary key for your child table. Having a composite primary key didn’t seem to save when I was editing the form.
Awesome site for finding the best prices on PC parts: http://pcpartpicker.com/
This line in jquery.jpanelmenu.js is the cause:
$('body > *').not(jP.menu + ', ' + jP.options.excludedPanelContent).wrapAll('<div class="' + 'jPanelMenu-panel' + '"/>');
You will need to comment it out and wrap everything in your body tag manually with:
<div class="jPanelMenu-panel" style="position: relative; left: 0px;">
</div>
The end result will look like:
<body>
<div class="jPanelMenu-panel" style="position: relative; left: 0px;">
all your code....
</div>
</body>
This page helped me figure it out: doctype.com: trying jQuery wrapAll seems to wrap content twice