Skip to content

Commit

Permalink
minor formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Bart Mosley authored and Bart Mosley committed Nov 21, 2011
1 parent 2fc3a2b commit f50a8a1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions model.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class ModelBase(type):
'''
def __new__(cls, name, bases, attrs):

if name == 'Model' or name == 'View':
return super(ModelBase, cls).__new__(cls, name, bases, attrs)

Expand All @@ -37,6 +38,7 @@ def __new__(cls, name, bases, attrs):

if not getattr(new_class.Meta, 'table', None):
new_class.Meta.table = name.lower()

new_class.Meta.table_safe = escape(new_class.Meta.table)

# Assume id is the default
Expand All @@ -62,6 +64,7 @@ def __new__(cls, name, bases, attrs):
if getattr(new_class.Meta, 'inner_join', None):
#Allows simple, two table joins on a single key
table_key = "t0"

new_class.Meta.table_safe = " AS ".join((escape(new_class.Meta.table),
table_key))
new_class.t0 = (new_class.Meta.table, [f[0] for f in q.description])
Expand Down

0 comments on commit f50a8a1

Please sign in to comment.