Skip to content

Commit dd2ace8

Browse files
committed
setup edits
1 parent 567e6f4 commit dd2ace8

File tree

4 files changed

+56
-8
lines changed

4 files changed

+56
-8
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
flask-sqlacodegen
22
=================
33

4-
Fork of <a href="https://pypi.python.org/pypi/sqlacodegen">sqlacodegen</a> by Alex Gronholm. Based off of version 1.1.6.
4+
GitHub page: [flask-sqlacodegen](https://github.com/ksindi/flask-sqlacodegen)
5+
6+
Fork of [sqlacodegen](https://pypi.python.org/pypi/sqlacodegen) by Alex Gronholm. Based off of version 1.1.6.
57

68
What's different:
7-
* Use the command `flask-sqlacodgen` instead of `sqlacodegen`.
9+
810
* Support for Flask-SQLAlchemy syntax using `--flask` option:
9-
- SQLAlchemy class is instantiated (i.e. `db = SQLAlchemy()`).
10-
- Flask-SQLAlchemy columns are used (e.g. `db.Integer`).
11-
- Metadata is only implicit in tables.
1211
* Defaults to generating backrefs in relationships. `--nobackref` still included as option in case backrefs are not wanted.
1312
* Naming of backrefs is class name in snake_case (as opposed to CamelCase) and is pluralized if it's Many-to-One or Many-to-Many using <a href="https://pypi.python.org/pypi/inflect">inflect</a>.
1413
* Generate explicit primary joins. I deal with pretty complicated tables that need explicit primary joins.
1514
* If column has a server_default set it to `FetchValue()` instead of trying to determine what that value is. Original code did not set the right server defaults in my setup.
1615
* `--ignore-cols` ignores special columns when generating association tables. Original code requires all columns to be foreign keys in order to generate association table. Example: `--ignore-cols id,inserted,updated`.
16+
* Use the command `flask-sqlacodgen` instead of `sqlacodegen`.
1717

1818
## Install
1919

README.rst

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
flask-sqlacodegen
2+
=================
3+
4+
GitHub page:
5+
`flask-sqlacodegen <https://github.com/ksindi/flask-sqlacodegen>`__
6+
7+
Fork of `sqlacodegen <https://pypi.python.org/pypi/sqlacodegen>`__ by
8+
Alex Gronholm. Based off of version 1.1.6.
9+
10+
What's different:
11+
12+
- Support for Flask-SQLAlchemy syntax using ``--flask`` option:
13+
- Defaults to generating backrefs in relationships. ``--nobackref``
14+
still included as option in case backrefs are not wanted.
15+
- Naming of backrefs is class name in snake\_case (as opposed to
16+
CamelCase) and is pluralized if it's Many-to-One or Many-to-Many
17+
using inflect.
18+
- Generate explicit primary joins. I deal with pretty complicated
19+
tables that need explicit primary joins.
20+
- If column has a server\_default set it to ``FetchValue()`` instead of
21+
trying to determine what that value is. Original code did not set the
22+
right server defaults in my setup.
23+
- ``--ignore-cols`` ignores special columns when generating association
24+
tables. Original code requires all columns to be foreign keys in
25+
order to generate association table. Example:
26+
``--ignore-cols id,inserted,updated``.
27+
- Use the command ``flask-sqlacodgen`` instead of ``sqlacodegen``.
28+
29+
Install
30+
-------
31+
32+
With pip:
33+
34+
::
35+
36+
pip install flask-sqlacodegen
37+
38+
Without pip:
39+
40+
::
41+
42+
git clone https://github.com/ksindi/flask-sqlacodegen.git
43+
cd flask-sqlacodegen/
44+
python setup.py install
45+

setup.cfg

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
[metadata]
2+
description-file = README.md
3+
14
[pep8]
25
max-line-length = 120
36
exclude = .tox
@@ -6,5 +9,5 @@ exclude = .tox
69
pep8maxlinelength = 120
710
addopts = --tb=short
811

9-
[wheel]
10-
universal = 1
12+
[bdist_wheel]
13+
universal=1

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def run_tests(self):
2525
setup(
2626
name='flask-sqlacodegen',
2727
description='Automatic model code generator for SQLAlchemy with Flask support',
28-
long_description=open('README.md').read(),
28+
long_description=open('README.rst').read(),
2929
version=sqlacodegen.version,
3030
author='Kamil Sindi',
3131
classifiers=[

0 commit comments

Comments
 (0)