This commit is contained in:
Christoffer Viken 2017-04-15 18:47:28 +00:00
parent 4669737fe3
commit 1c8f03695a
9 changed files with 70 additions and 561 deletions

View File

@ -1,45 +0,0 @@
Metadata-Version: 1.0
Name: SQLAlchemy
Version: 0.6beta3
Summary: Database Abstraction Library
Home-page: http://www.sqlalchemy.org
Author: Mike Bayer
Author-email: mike_mp@zzzcomputing.com
License: MIT License
Description: SQLAlchemy is:
* The Python SQL toolkit and Object Relational Mapper that gives application developers the full power and flexibility of SQL. SQLAlchemy provides a full suite of well known enterprise-level persistence patterns, designed for efficient and high-performing database access, adapted into a simple and Pythonic domain language.
* extremely easy to use for all the basic tasks, such as: accessing pooled connections, constructing SQL from Python expressions, finding object instances, and commiting object modifications back to the database.
* powerful enough for complicated tasks, such as: eager load a graph of objects and their dependencies via joins; map recursive adjacency structures automatically; map objects to not just tables but to any arbitrary join or select statement; combine multiple tables together to load whole sets of otherwise unrelated objects from a single result set; commit entire graphs of object changes in one step.
* built to conform to what DBAs demand, including the ability to swap out generated SQL with hand-optimized statements, full usage of bind parameters for all literal values, fully transactionalized and consistent updates using Unit of Work.
* modular. Different parts of SQLAlchemy can be used independently of the rest, including the connection pool, SQL construction, and ORM. SQLAlchemy is constructed in an open style that allows plenty of customization, with an architecture that supports custom datatypes, custom SQL extensions, and ORM plugins which can augment or extend mapping functionality.
SQLAlchemy's Philosophy:
* SQL databases behave less and less like object collections the more size and performance start to matter; object collections behave less and less like tables and rows the more abstraction starts to matter. SQLAlchemy aims to accomodate both of these principles.
* Your classes aren't tables, and your objects aren't rows. Databases aren't just collections of tables; they're relational algebra engines. You don't have to select from just tables, you can select from joins, subqueries, and unions. Database and domain concepts should be visibly decoupled from the beginning, allowing both sides to develop to their full potential.
* For example, table metadata (objects that describe tables) are declared distinctly from the classes theyre designed to store. That way database relationship concepts don't interfere with your object design concepts, and vice-versa; the transition from table-mapping to selectable-mapping is seamless; a class can be mapped against the database in more than one way. SQLAlchemy provides a powerful mapping layer that can work as automatically or as manually as you choose, determining relationships based on foreign keys or letting you define the join conditions explicitly, to bridge the gap between database and domain.
SQLAlchemy's Advantages:
* The Unit Of Work system organizes pending CRUD operations into queues and commits them all in one batch. It then performs a topological "dependency sort" of all items to be committed and deleted and groups redundant statements together. This produces the maxiumum efficiency and transaction safety, and minimizes chances of deadlocks. Modeled after Fowler's "Unit of Work" pattern as well as Java Hibernate.
* Function-based query construction allows boolean expressions, operators, functions, table aliases, selectable subqueries, create/update/insert/delete queries, correlated updates, correlated EXISTS clauses, UNION clauses, inner and outer joins, bind parameters, free mixing of literal text within expressions, as little or as much as desired. Query-compilation is vendor-specific; the same query object can be compiled into any number of resulting SQL strings depending on its compilation algorithm.
* Database mapping and class design are totally separate. Persisted objects have no subclassing requirement (other than 'object') and are POPO's : plain old Python objects. They retain serializability (pickling) for usage in various caching systems and session objects. SQLAlchemy "decorates" classes with non-intrusive property accessors to automatically log object creates and modifications with the UnitOfWork engine, to lazyload related data, as well as to track attribute change histories.
* Custom list classes can be used with eagerly or lazily loaded child object lists, allowing rich relationships to be created on the fly as SQLAlchemy appends child objects to an object attribute.
* Composite (multiple-column) primary keys are supported, as are "association" objects that represent the middle of a "many-to-many" relationship.
* Self-referential tables and mappers are supported. Adjacency list structures can be created, saved, and deleted with proper cascading, with no extra programming.
* Data mapping can be used in a row-based manner. Any bizarre hyper-optimized query that you or your DBA can cook up, you can run in SQLAlchemy, and as long as it returns the expected columns within a rowset, you can get your objects from it. For a rowset that contains more than one kind of object per row, multiple mappers can be chained together to return multiple object instance lists from a single database round trip.
* The type system allows pre- and post- processing of data, both at the bind parameter and the result set level. User-defined types can be freely mixed with built-in types. Generic types as well as SQL-specific types are available.
SVN version:
<http://svn.sqlalchemy.org/sqlalchemy/trunk#egg=SQLAlchemy-dev>
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Database :: Front-Ends
Classifier: Operating System :: OS Independent

View File

@ -1,499 +0,0 @@
.hgignore
.hgtags
CHANGES
CHANGES_PRE_05
LICENSE
MANIFEST.in
README
README.py3k
README.unittests
distribute_setup.py
ez_setup.py
sa2to3.py
setup.cfg
setup.py
sqla_nose.py
doc/copyright.html
doc/dbengine.html
doc/examples.html
doc/genindex.html
doc/index.html
doc/intro.html
doc/mappers.html
doc/metadata.html
doc/ormtutorial.html
doc/search.html
doc/searchindex.js
doc/session.html
doc/sqlexpression.html
doc/_images/sqla_arch_small.jpg
doc/_sources/copyright.txt
doc/_sources/dbengine.txt
doc/_sources/examples.txt
doc/_sources/index.txt
doc/_sources/intro.txt
doc/_sources/mappers.txt
doc/_sources/metadata.txt
doc/_sources/ormtutorial.txt
doc/_sources/session.txt
doc/_sources/sqlexpression.txt
doc/_sources/reference/index.txt
doc/_sources/reference/dialects/access.txt
doc/_sources/reference/dialects/firebird.txt
doc/_sources/reference/dialects/index.txt
doc/_sources/reference/dialects/informix.txt
doc/_sources/reference/dialects/maxdb.txt
doc/_sources/reference/dialects/mssql.txt
doc/_sources/reference/dialects/mysql.txt
doc/_sources/reference/dialects/oracle.txt
doc/_sources/reference/dialects/postgresql.txt
doc/_sources/reference/dialects/sqlite.txt
doc/_sources/reference/dialects/sybase.txt
doc/_sources/reference/ext/associationproxy.txt
doc/_sources/reference/ext/compiler.txt
doc/_sources/reference/ext/declarative.txt
doc/_sources/reference/ext/horizontal_shard.txt
doc/_sources/reference/ext/index.txt
doc/_sources/reference/ext/orderinglist.txt
doc/_sources/reference/ext/serializer.txt
doc/_sources/reference/ext/sqlsoup.txt
doc/_sources/reference/orm/collections.txt
doc/_sources/reference/orm/index.txt
doc/_sources/reference/orm/interfaces.txt
doc/_sources/reference/orm/mapping.txt
doc/_sources/reference/orm/query.txt
doc/_sources/reference/orm/sessions.txt
doc/_sources/reference/orm/utilities.txt
doc/_sources/reference/sqlalchemy/connections.txt
doc/_sources/reference/sqlalchemy/expressions.txt
doc/_sources/reference/sqlalchemy/index.txt
doc/_sources/reference/sqlalchemy/interfaces.txt
doc/_sources/reference/sqlalchemy/pooling.txt
doc/_sources/reference/sqlalchemy/schema.txt
doc/_sources/reference/sqlalchemy/types.txt
doc/_static/basic.css
doc/_static/default.css
doc/_static/docs.css
doc/_static/doctools.js
doc/_static/file.png
doc/_static/init.js
doc/_static/jquery.js
doc/_static/minus.png
doc/_static/plus.png
doc/_static/pygments.css
doc/_static/searchtools.js
doc/build/Makefile
doc/build/conf.py
doc/build/copyright.rst
doc/build/dbengine.rst
doc/build/examples.rst
doc/build/index.rst
doc/build/intro.rst
doc/build/mappers.rst
doc/build/metadata.rst
doc/build/ormtutorial.rst
doc/build/session.rst
doc/build/sqla_arch_small.jpg
doc/build/sqlexpression.rst
doc/build/testdocs.py
doc/build/builder/__init__.py
doc/build/builder/builders.py
doc/build/builder/util.py
doc/build/reference/index.rst
doc/build/reference/dialects/access.rst
doc/build/reference/dialects/firebird.rst
doc/build/reference/dialects/index.rst
doc/build/reference/dialects/informix.rst
doc/build/reference/dialects/maxdb.rst
doc/build/reference/dialects/mssql.rst
doc/build/reference/dialects/mysql.rst
doc/build/reference/dialects/oracle.rst
doc/build/reference/dialects/postgresql.rst
doc/build/reference/dialects/sqlite.rst
doc/build/reference/dialects/sybase.rst
doc/build/reference/ext/associationproxy.rst
doc/build/reference/ext/compiler.rst
doc/build/reference/ext/declarative.rst
doc/build/reference/ext/horizontal_shard.rst
doc/build/reference/ext/index.rst
doc/build/reference/ext/orderinglist.rst
doc/build/reference/ext/serializer.rst
doc/build/reference/ext/sqlsoup.rst
doc/build/reference/orm/collections.rst
doc/build/reference/orm/index.rst
doc/build/reference/orm/interfaces.rst
doc/build/reference/orm/mapping.rst
doc/build/reference/orm/query.rst
doc/build/reference/orm/sessions.rst
doc/build/reference/orm/utilities.rst
doc/build/reference/sqlalchemy/connections.rst
doc/build/reference/sqlalchemy/expressions.rst
doc/build/reference/sqlalchemy/index.rst
doc/build/reference/sqlalchemy/interfaces.rst
doc/build/reference/sqlalchemy/pooling.rst
doc/build/reference/sqlalchemy/schema.rst
doc/build/reference/sqlalchemy/types.rst
doc/build/static/docs.css
doc/build/static/init.js
doc/build/templates/genindex.mako
doc/build/templates/layout.mako
doc/build/templates/page.mako
doc/build/templates/search.mako
doc/build/templates/site_base.mako
doc/build/templates/static_base.mako
doc/build/texinputs/sphinx.sty
doc/reference/index.html
doc/reference/dialects/access.html
doc/reference/dialects/firebird.html
doc/reference/dialects/index.html
doc/reference/dialects/informix.html
doc/reference/dialects/maxdb.html
doc/reference/dialects/mssql.html
doc/reference/dialects/mysql.html
doc/reference/dialects/oracle.html
doc/reference/dialects/postgresql.html
doc/reference/dialects/sqlite.html
doc/reference/dialects/sybase.html
doc/reference/ext/associationproxy.html
doc/reference/ext/compiler.html
doc/reference/ext/declarative.html
doc/reference/ext/horizontal_shard.html
doc/reference/ext/index.html
doc/reference/ext/orderinglist.html
doc/reference/ext/serializer.html
doc/reference/ext/sqlsoup.html
doc/reference/orm/collections.html
doc/reference/orm/index.html
doc/reference/orm/interfaces.html
doc/reference/orm/mapping.html
doc/reference/orm/query.html
doc/reference/orm/sessions.html
doc/reference/orm/utilities.html
doc/reference/sqlalchemy/connections.html
doc/reference/sqlalchemy/expressions.html
doc/reference/sqlalchemy/index.html
doc/reference/sqlalchemy/interfaces.html
doc/reference/sqlalchemy/pooling.html
doc/reference/sqlalchemy/schema.html
doc/reference/sqlalchemy/types.html
examples/__init__.py
examples/adjacency_list/__init__.py
examples/adjacency_list/adjacency_list.py
examples/association/__init__.py
examples/association/basic_association.py
examples/association/proxied_association.py
examples/beaker_caching/__init__.py
examples/beaker_caching/advanced.py
examples/beaker_caching/environment.py
examples/beaker_caching/fixture_data.py
examples/beaker_caching/helloworld.py
examples/beaker_caching/local_session_caching.py
examples/beaker_caching/meta.py
examples/beaker_caching/model.py
examples/beaker_caching/relation_caching.py
examples/custom_attributes/__init__.py
examples/custom_attributes/custom_management.py
examples/custom_attributes/listen_for_events.py
examples/derived_attributes/__init__.py
examples/derived_attributes/attributes.py
examples/dynamic_dict/__init__.py
examples/dynamic_dict/dynamic_dict.py
examples/elementtree/__init__.py
examples/elementtree/adjacency_list.py
examples/elementtree/optimized_al.py
examples/elementtree/pickle.py
examples/elementtree/test.xml
examples/elementtree/test2.xml
examples/elementtree/test3.xml
examples/graphs/__init__.py
examples/graphs/directed_graph.py
examples/inheritance/__init__.py
examples/inheritance/concrete.py
examples/inheritance/polymorph.py
examples/inheritance/single.py
examples/large_collection/__init__.py
examples/large_collection/large_collection.py
examples/nested_sets/__init__.py
examples/nested_sets/nested_sets.py
examples/poly_assoc/__init__.py
examples/poly_assoc/poly_assoc.py
examples/poly_assoc/poly_assoc_fk.py
examples/poly_assoc/poly_assoc_generic.py
examples/postgis/__init__.py
examples/postgis/postgis.py
examples/sharding/__init__.py
examples/sharding/attribute_shard.py
examples/versioning/__init__.py
examples/versioning/history_meta.py
examples/versioning/test_versioning.py
examples/vertical/__init__.py
examples/vertical/dictlike-polymorphic.py
examples/vertical/dictlike.py
lib/SQLAlchemy.egg-info/PKG-INFO
lib/SQLAlchemy.egg-info/SOURCES.txt
lib/SQLAlchemy.egg-info/dependency_links.txt
lib/SQLAlchemy.egg-info/entry_points.txt
lib/SQLAlchemy.egg-info/top_level.txt
lib/sqlalchemy/__init__.py
lib/sqlalchemy/exc.py
lib/sqlalchemy/interfaces.py
lib/sqlalchemy/log.py
lib/sqlalchemy/pool.py
lib/sqlalchemy/processors.py
lib/sqlalchemy/queue.py
lib/sqlalchemy/schema.py
lib/sqlalchemy/topological.py
lib/sqlalchemy/types.py
lib/sqlalchemy/util.py
lib/sqlalchemy/cextension/processors.c
lib/sqlalchemy/cextension/resultproxy.c
lib/sqlalchemy/connectors/__init__.py
lib/sqlalchemy/connectors/mxodbc.py
lib/sqlalchemy/connectors/pyodbc.py
lib/sqlalchemy/connectors/zxJDBC.py
lib/sqlalchemy/databases/__init__.py
lib/sqlalchemy/dialects/__init__.py
lib/sqlalchemy/dialects/postgres.py
lib/sqlalchemy/dialects/type_migration_guidelines.txt
lib/sqlalchemy/dialects/access/__init__.py
lib/sqlalchemy/dialects/access/base.py
lib/sqlalchemy/dialects/firebird/__init__.py
lib/sqlalchemy/dialects/firebird/base.py
lib/sqlalchemy/dialects/firebird/kinterbasdb.py
lib/sqlalchemy/dialects/informix/__init__.py
lib/sqlalchemy/dialects/informix/base.py
lib/sqlalchemy/dialects/informix/informixdb.py
lib/sqlalchemy/dialects/maxdb/__init__.py
lib/sqlalchemy/dialects/maxdb/base.py
lib/sqlalchemy/dialects/maxdb/sapdb.py
lib/sqlalchemy/dialects/mssql/__init__.py
lib/sqlalchemy/dialects/mssql/adodbapi.py
lib/sqlalchemy/dialects/mssql/base.py
lib/sqlalchemy/dialects/mssql/information_schema.py
lib/sqlalchemy/dialects/mssql/mxodbc.py
lib/sqlalchemy/dialects/mssql/pymssql.py
lib/sqlalchemy/dialects/mssql/pyodbc.py
lib/sqlalchemy/dialects/mssql/zxjdbc.py
lib/sqlalchemy/dialects/mysql/__init__.py
lib/sqlalchemy/dialects/mysql/base.py
lib/sqlalchemy/dialects/mysql/mysqlconnector.py
lib/sqlalchemy/dialects/mysql/mysqldb.py
lib/sqlalchemy/dialects/mysql/oursql.py
lib/sqlalchemy/dialects/mysql/pyodbc.py
lib/sqlalchemy/dialects/mysql/zxjdbc.py
lib/sqlalchemy/dialects/oracle/__init__.py
lib/sqlalchemy/dialects/oracle/base.py
lib/sqlalchemy/dialects/oracle/cx_oracle.py
lib/sqlalchemy/dialects/oracle/zxjdbc.py
lib/sqlalchemy/dialects/postgresql/__init__.py
lib/sqlalchemy/dialects/postgresql/base.py
lib/sqlalchemy/dialects/postgresql/pg8000.py
lib/sqlalchemy/dialects/postgresql/psycopg2.py
lib/sqlalchemy/dialects/postgresql/pypostgresql.py
lib/sqlalchemy/dialects/postgresql/zxjdbc.py
lib/sqlalchemy/dialects/sqlite/__init__.py
lib/sqlalchemy/dialects/sqlite/base.py
lib/sqlalchemy/dialects/sqlite/pysqlite.py
lib/sqlalchemy/dialects/sybase/__init__.py
lib/sqlalchemy/dialects/sybase/base.py
lib/sqlalchemy/dialects/sybase/mxodbc.py
lib/sqlalchemy/dialects/sybase/pyodbc.py
lib/sqlalchemy/dialects/sybase/pysybase.py
lib/sqlalchemy/engine/__init__.py
lib/sqlalchemy/engine/base.py
lib/sqlalchemy/engine/ddl.py
lib/sqlalchemy/engine/default.py
lib/sqlalchemy/engine/reflection.py
lib/sqlalchemy/engine/strategies.py
lib/sqlalchemy/engine/threadlocal.py
lib/sqlalchemy/engine/url.py
lib/sqlalchemy/ext/__init__.py
lib/sqlalchemy/ext/associationproxy.py
lib/sqlalchemy/ext/compiler.py
lib/sqlalchemy/ext/declarative.py
lib/sqlalchemy/ext/horizontal_shard.py
lib/sqlalchemy/ext/orderinglist.py
lib/sqlalchemy/ext/serializer.py
lib/sqlalchemy/ext/sqlsoup.py
lib/sqlalchemy/orm/__init__.py
lib/sqlalchemy/orm/attributes.py
lib/sqlalchemy/orm/collections.py
lib/sqlalchemy/orm/dependency.py
lib/sqlalchemy/orm/dynamic.py
lib/sqlalchemy/orm/evaluator.py
lib/sqlalchemy/orm/exc.py
lib/sqlalchemy/orm/identity.py
lib/sqlalchemy/orm/interfaces.py
lib/sqlalchemy/orm/mapper.py
lib/sqlalchemy/orm/properties.py
lib/sqlalchemy/orm/query.py
lib/sqlalchemy/orm/scoping.py
lib/sqlalchemy/orm/session.py
lib/sqlalchemy/orm/shard.py
lib/sqlalchemy/orm/state.py
lib/sqlalchemy/orm/strategies.py
lib/sqlalchemy/orm/sync.py
lib/sqlalchemy/orm/unitofwork.py
lib/sqlalchemy/orm/uowdumper.py
lib/sqlalchemy/orm/util.py
lib/sqlalchemy/sql/__init__.py
lib/sqlalchemy/sql/compiler.py
lib/sqlalchemy/sql/expression.py
lib/sqlalchemy/sql/functions.py
lib/sqlalchemy/sql/operators.py
lib/sqlalchemy/sql/util.py
lib/sqlalchemy/sql/visitors.py
lib/sqlalchemy/test/__init__.py
lib/sqlalchemy/test/assertsql.py
lib/sqlalchemy/test/config.py
lib/sqlalchemy/test/engines.py
lib/sqlalchemy/test/entities.py
lib/sqlalchemy/test/noseplugin.py
lib/sqlalchemy/test/orm.py
lib/sqlalchemy/test/pickleable.py
lib/sqlalchemy/test/profiling.py
lib/sqlalchemy/test/requires.py
lib/sqlalchemy/test/schema.py
lib/sqlalchemy/test/testing.py
lib/sqlalchemy/test/util.py
test/__init__.py
test/binary_data_one.dat
test/binary_data_two.dat
test/aaa_profiling/__init__.py
test/aaa_profiling/test_compiler.py
test/aaa_profiling/test_memusage.py
test/aaa_profiling/test_orm.py
test/aaa_profiling/test_pool.py
test/aaa_profiling/test_resultset.py
test/aaa_profiling/test_zoomark.py
test/aaa_profiling/test_zoomark_orm.py
test/base/__init__.py
test/base/test_dependency.py
test/base/test_except.py
test/base/test_utils.py
test/dialect/__init__.py
test/dialect/test_access.py
test/dialect/test_firebird.py
test/dialect/test_informix.py
test/dialect/test_maxdb.py
test/dialect/test_mssql.py
test/dialect/test_mxodbc.py
test/dialect/test_mysql.py
test/dialect/test_oracle.py
test/dialect/test_postgresql.py
test/dialect/test_sqlite.py
test/dialect/test_sybase.py
test/engine/__init__.py
test/engine/_base.py
test/engine/test_bind.py
test/engine/test_ddlevents.py
test/engine/test_execute.py
test/engine/test_metadata.py
test/engine/test_parseconnect.py
test/engine/test_pool.py
test/engine/test_reconnect.py
test/engine/test_reflection.py
test/engine/test_transaction.py
test/ex/__init__.py
test/ex/test_examples.py
test/ext/__init__.py
test/ext/test_associationproxy.py
test/ext/test_compiler.py
test/ext/test_declarative.py
test/ext/test_horizontal_shard.py
test/ext/test_orderinglist.py
test/ext/test_serializer.py
test/ext/test_sqlsoup.py
test/orm/__init__.py
test/orm/_base.py
test/orm/_fixtures.py
test/orm/test_association.py
test/orm/test_assorted_eager.py
test/orm/test_attributes.py
test/orm/test_backref_mutations.py
test/orm/test_bind.py
test/orm/test_cascade.py
test/orm/test_collection.py
test/orm/test_compile.py
test/orm/test_cycles.py
test/orm/test_defaults.py
test/orm/test_deprecations.py
test/orm/test_dynamic.py
test/orm/test_eager_relations.py
test/orm/test_evaluator.py
test/orm/test_expire.py
test/orm/test_extendedattr.py
test/orm/test_generative.py
test/orm/test_instrumentation.py
test/orm/test_lazy_relations.py
test/orm/test_lazytest1.py
test/orm/test_manytomany.py
test/orm/test_mapper.py
test/orm/test_merge.py
test/orm/test_naturalpks.py
test/orm/test_onetoone.py
test/orm/test_pickled.py
test/orm/test_query.py
test/orm/test_relationships.py
test/orm/test_scoping.py
test/orm/test_selectable.py
test/orm/test_session.py
test/orm/test_subquery_relations.py
test/orm/test_transaction.py
test/orm/test_unitofwork.py
test/orm/test_utils.py
test/orm/test_versioning.py
test/orm/inheritance/__init__.py
test/orm/inheritance/test_abc_inheritance.py
test/orm/inheritance/test_abc_polymorphic.py
test/orm/inheritance/test_basic.py
test/orm/inheritance/test_concrete.py
test/orm/inheritance/test_magazine.py
test/orm/inheritance/test_manytomany.py
test/orm/inheritance/test_poly_linked_list.py
test/orm/inheritance/test_polymorph.py
test/orm/inheritance/test_polymorph2.py
test/orm/inheritance/test_productspec.py
test/orm/inheritance/test_query.py
test/orm/inheritance/test_selects.py
test/orm/inheritance/test_single.py
test/perf/cascade_speed.py
test/perf/insertspeed.py
test/perf/masscreate.py
test/perf/masscreate2.py
test/perf/masseagerload.py
test/perf/massload.py
test/perf/massload2.py
test/perf/masssave.py
test/perf/objselectspeed.py
test/perf/objupdatespeed.py
test/perf/ormsession.py
test/perf/poolload.py
test/perf/sessions.py
test/perf/stress_all.py
test/perf/stresstest.py
test/perf/threaded_compile.py
test/perf/wsgi.py
test/sql/__init__.py
test/sql/_base.py
test/sql/test_case_statement.py
test/sql/test_columns.py
test/sql/test_compiler.py
test/sql/test_constraints.py
test/sql/test_defaults.py
test/sql/test_functions.py
test/sql/test_generative.py
test/sql/test_labels.py
test/sql/test_query.py
test/sql/test_quote.py
test/sql/test_returning.py
test/sql/test_rowcount.py
test/sql/test_selectable.py
test/sql/test_types.py
test/sql/test_unicode.py
test/zblog/__init__.py
test/zblog/blog.py
test/zblog/mappers.py
test/zblog/tables.py
test/zblog/test_zblog.py
test/zblog/user.py

View File

@ -1 +0,0 @@

View File

@ -1,3 +0,0 @@
[nose.plugins.0.10]
sqlalchemy = sqlalchemy.test.noseplugin:NoseSQLAlchemy

View File

@ -1 +0,0 @@
sqlalchemy

View File

@ -1,4 +1,4 @@
db_url = 'sqlite:///foo.db'
db_url = 'postgres://CVi@127.0.0.1/pvv_vv'
quit_allowed = True
stop_allowed = False
show_tracebacks = True
@ -6,3 +6,6 @@ input_encoding = 'utf8'
low_credit_warning_limit = -100
user_recent_transaction_limit = 100
label_type = "29x90"
label_rotate = True

View File

@ -1,9 +0,0 @@
purchase|2015-10-03 21:08:05.286035|PVV-Skjorte|robertem|100|None
purchase|2015-10-03 21:16:35.679021||robertem|-400|Purchased products for PVVVV, adjusted credit 400
purchase|2015-10-03 21:22:19.528745||robertem|-400|Purchased products for PVVVV, adjusted credit 400
purchase|2015-10-03 21:24:45.340144||robertem|-400|Purchased products for PVVVV, adjusted credit 400
purchase|2015-10-03 21:27:21.983816||robertem|-400|Purchased products for PVVVV, adjusted credit 400
purchase|2015-10-03 21:28:34.638811||robertem|-580|Purchased products for PVVVV, adjusted credit 580
purchase|2015-10-03 21:35:09.332596||robertem|3000|manually adjusted credit
purchase|2015-10-03 21:42:43.106350|PVV-Skjorte|robertem|90|None
purchase|2015-10-03 21:44:17.109271|PVV-Skjorte|robertem|90|None

62
test.py Normal file
View File

@ -0,0 +1,62 @@
import os
import datetime
from PIL import ImageFont
from brother_ql.devicedependent import label_type_specs
from printer_helpers import print_bar_code
#label_type = "29x90"
#rotate = True
#barcode_value = "7050122105438"
#barcode_text = "Chips"
#printer_type = "QL-700"
from PIL import Image, ImageMode, ImageDraw
def print_name_label(text, margin=10, rotate=False, label_type="62", printer_type="QL-700",):
if not rotate:
width, height = label_type_specs[label_type]['dots_printable']
else:
height, width = label_type_specs[label_type]['dots_printable']
font_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), "ChopinScript.ttf")
fs = 2000
tw, th = width, height
if width == 0:
while th + 2*margin > height:
font = ImageFont.truetype(font_path, fs)
tw, th = font.getsize(text)
fs -= 1
width = tw+2*margin
elif height == 0:
while tw + 2*margin > width:
font = ImageFont.truetype(font_path, fs)
tw, th = font.getsize(text)
fs -= 1
height = th+2*margin
else:
while tw + 2*margin > width or th + 2*margin > height:
font = ImageFont.truetype(font_path, fs)
tw, th = font.getsize(text)
fs -= 1
xp = (width//2)-(tw//2)
yp = (height//2)-(th//2)
im = Image.new("RGB", (width, height), (255, 255, 255))
dr = ImageDraw.Draw(im)
dr.text((xp, yp), text, fill=(0, 0, 0), font=font)
now = datetime.datetime.now()
date = now.strftime("%Y-%m-%d")
dr.text((0, 0), date, fill=(0, 0, 0))
base_path = os.path.dirname(os.path.realpath(__file__))
fn = os.path.join(base_path, "bar_codes", text + ".png")
im.save(fn, "PNG")
print_name_label("chrivi", label_type="29x90", rotate=True)

View File

@ -1,3 +1,5 @@
import re
from db import Product, User
from printer_helpers import print_bar_code, print_name_label
from text_interface.helpermenus import Menu
@ -19,9 +21,9 @@ Put it up somewhere in the vicinity.
thing = self.input_thing('Prodct/User> ')
if isinstance(thing, Product):
if len(thing.bar_code) == 13:
if re.match(r"^[0-9]{13}$", thing.bar_code):
bar_type = "ean13"
elif len(thing.bar_code) == 8:
elif re.match(r"^[0-9]{8}$", thing.bar_code):
bar_type = "ean8"
else:
bar_type = "code39"