Commit 1b68268ab0d76c65c0cbf8ab7b71f8789b6382c5
1 parent
728fc7e6
Exists in
master
comment no codigo desnecessario criado pelo scafold do pyramid
git-svn-id: http://svn.brlight.net/svn/lightbase-neo/trunk/LBBulk@750 29b92fdf-8c97-4584-b987-84e8d3c556fa
Showing
2 changed files
with
42 additions
and
43 deletions
Show diff stats
lbbulk/model/Registro.py
... | ... | @@ -11,8 +11,8 @@ bulk_sources = Table('lb_bulk_sources', metadata, |
11 | 11 | |
12 | 12 | bulk_upload = Table('lb_bulk_upload', metadata, |
13 | 13 | Column('id_reg', Integer, primary_key=True), |
14 | - Column('chave_externa', String) | |
15 | - Column('id_source', Integer, ForeignKey('lb_bulk_sources.id_source')), | |
14 | + Column('chave_externa', String), | |
15 | + Column('id_source', Integer, ForeignKey('lb_bulk_sources.id_source')) | |
16 | 16 | ) |
17 | 17 | |
18 | 18 | # define a join between them. This |
... | ... | @@ -23,5 +23,4 @@ registro = join(bulk_sources, bulk_upload) |
23 | 23 | # map to it |
24 | 24 | class Registro(Base): |
25 | 25 | __table__ = registro |
26 | - | |
27 | 26 | id_source = column_property(bulk_sources.c.id_source, bulk_upload.c.id_source) |
28 | 27 | \ No newline at end of file | ... | ... |
lbbulk/scripts/initializedb.py
1 | -import os | |
2 | -import sys | |
3 | -import transaction | |
4 | - | |
5 | -from sqlalchemy import engine_from_config | |
6 | - | |
7 | -from pyramid.paster import ( | |
8 | - get_appsettings, | |
9 | - setup_logging, | |
10 | - ) | |
11 | - | |
12 | -from pyramid.scripts.common import parse_vars | |
13 | - | |
14 | -from ..models import ( | |
15 | - DBSession, | |
16 | - MyModel, | |
17 | - Base, | |
18 | - ) | |
19 | - | |
20 | - | |
21 | -def usage(argv): | |
22 | - cmd = os.path.basename(argv[0]) | |
23 | - print('usage: %s <config_uri> [var=value]\n' | |
24 | - '(example: "%s development.ini")' % (cmd, cmd)) | |
25 | - sys.exit(1) | |
26 | - | |
27 | - | |
28 | -def main(argv=sys.argv): | |
29 | - if len(argv) < 2: | |
30 | - usage(argv) | |
31 | - config_uri = argv[1] | |
32 | - options = parse_vars(argv[2:]) | |
33 | - setup_logging(config_uri) | |
34 | - settings = get_appsettings(config_uri, options=options) | |
35 | - engine = engine_from_config(settings, 'sqlalchemy.') | |
36 | - DBSession.configure(bind=engine) | |
37 | - Base.metadata.create_all(engine) | |
38 | - with transaction.manager: | |
39 | - model = MyModel(name='one', value=1) | |
40 | - DBSession.add(model) | |
1 | +# import os | |
2 | +# import sys | |
3 | +# import transaction | |
4 | + | |
5 | +# from sqlalchemy import engine_from_config | |
6 | + | |
7 | +# from pyramid.paster import ( | |
8 | +# get_appsettings, | |
9 | +# setup_logging, | |
10 | +# ) | |
11 | + | |
12 | +# from pyramid.scripts.common import parse_vars | |
13 | + | |
14 | +# from ..models import ( | |
15 | +# DBSession, | |
16 | +# MyModel, | |
17 | +# Base, | |
18 | +# ) | |
19 | + | |
20 | + | |
21 | +# def usage(argv): | |
22 | +# cmd = os.path.basename(argv[0]) | |
23 | +# print('usage: %s <config_uri> [var=value]\n' | |
24 | +# '(example: "%s development.ini")' % (cmd, cmd)) | |
25 | +# sys.exit(1) | |
26 | + | |
27 | + | |
28 | +# def main(argv=sys.argv): | |
29 | +# if len(argv) < 2: | |
30 | +# usage(argv) | |
31 | +# config_uri = argv[1] | |
32 | +# options = parse_vars(argv[2:]) | |
33 | +# setup_logging(config_uri) | |
34 | +# settings = get_appsettings(config_uri, options=options) | |
35 | +# engine = engine_from_config(settings, 'sqlalchemy.') | |
36 | +# DBSession.configure(bind=engine) | |
37 | +# Base.metadata.create_all(engine) | |
38 | +# with transaction.manager: | |
39 | +# model = MyModel(name='one', value=1) | |
40 | +# DBSession.add(model) | ... | ... |