Skip to content

Commit 1cd9d55

Browse files
committed
Initial commit
0 parents  commit 1cd9d55

30 files changed

+4216
-0
lines changed

.gitignore

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
*.pyc
2+
3+
# Packages
4+
*.egg
5+
*.egg-info
6+
dist
7+
build
8+
_build
9+
.cache
10+
11+
# Installer logs
12+
pip-log.txt
13+
14+
# Unit test / coverage reports
15+
.coverage
16+
.tox
17+
nosetests.xml
18+
19+
.DS_Store
20+
.idea/*
21+
22+
/test.py
23+
/test_*.py

.travis.yml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
language: python
2+
3+
python:
4+
- "2.7"
5+
- "3.5"
6+
7+
install:
8+
- pip install -r tests-requirements.txt
9+
10+
script: py.test tests/

CHANGELOG.md

+252
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,252 @@
1+
## 0.8.2
2+
3+
##### Fixes
4+
5+
###### ORM
6+
7+
- Fixing a possible `Memory Error: stack overflow` error when accessing relations.
8+
- Fixing builder copying process to avoir issues with `PyMySQL`(thanks to [ihumanable](https://github.com/ihumanable)).
9+
10+
###### Commands
11+
12+
- Fixing the `-n/--no-interaction` option not automatically confirming questions.
13+
- Removing the check character in migration commands output to avoid errors on Windows.
14+
15+
###### Connection
16+
17+
- Updating connectors to raise an exception when backend packages are missing.
18+
- Adding standard name resolution to the `purge` method (thanks to [ihumanable](https://github.com/ihumanable)).
19+
20+
###### DBAL
21+
22+
- Fixing setting foreign key constraint name for MySQL.
23+
- Handling missing `constraint_name` for sqlite (thanks to [ihumanable](https://github.com/ihumanable)).
24+
25+
26+
## 0.8.1
27+
28+
##### Fixes
29+
30+
###### ORM
31+
32+
- Removing call to `Model._boot_columns()` to avoid errors for column types not supported by the dbal.
33+
34+
###### Schema Builder
35+
36+
- Fixing `Blueprint.char()` method (thanks to [ihumanable](https://github.com/ihumanable)).
37+
- Fixing `Fluent` behavior.
38+
39+
###### Commands
40+
41+
- Fixing `orator` command not working on Windows.
42+
- Fixing `migrate:status` command not switching databases.
43+
44+
###### Connection
45+
46+
- Fixing a bug when calling `Connnection.disconnect()` after a reconnection when not using read/write connections.
47+
- Fixing `MySQLConnection.get_server_version()` method to be compatible with `PyMySQL` (thanks to [gdraynz](https://github.com/gdraynz)).
48+
49+
## 0.8
50+
51+
##### Improvements
52+
53+
###### ORM
54+
55+
- [#30](https://github.com/sdispater/orator/issues/30) Support for default values
56+
- [#29](https://github.com/sdispater/orator/issues/29) Supporting only one timetamp column on models
57+
- [#26](https://github.com/sdispater/orator/issues/26) Adding support for extra conditions on relationships
58+
- Adding `@scope` decorator to define query scopes.
59+
- Improving global scopes
60+
61+
###### Schema builder
62+
63+
- Adding support for a `use_current()` on timestamps
64+
- Improving dbal to support SQLite fully.
65+
- Improving fluents
66+
67+
###### Query Builder
68+
69+
- [#28](https://github.com/sdispater/orator/issues/28) Making where_in() method accept Collection instances
70+
71+
###### Commands
72+
73+
- Adding a `make:model` command
74+
75+
###### Connection
76+
77+
- Using unicode by default for mysql and postgres.
78+
- Improves how queries are run in `Connection` class
79+
80+
###### Collections
81+
82+
- Adds `flatten()` method to `Collection` class
83+
84+
##### Fixes
85+
86+
###### ORM
87+
88+
- Fixes `Model.get_foreign_key()` method
89+
- Fixes soft deletes
90+
- Avoid going through \_\_setattr\_\_ method when setting timestamps
91+
92+
###### Schema Builder
93+
94+
- [#33](https://github.com/sdispater/orator/issues/33) [SQLite] Renaming or dropping columns loses NULL constraint
95+
- [#32](https://github.com/sdispater/orator/issues/32) [SQLite] Renaming or dropping columns fails when columns' name is a keyword
96+
- [#31](https://github.com/sdispater/orator/issues/31) [SQLite] Changing columns loses default column values.
97+
98+
###### Query Builder
99+
100+
- Fixes query grammar default columns value
101+
102+
###### Connection
103+
104+
- Fixing `Connection._try_again_if_caused_by_lost_connection()` not being called
105+
- Preventing default connection being set to None
106+
- Fixing json type behavior for Postgres
107+
108+
###### Migrations
109+
- Fixing migration stubs
110+
111+
112+
### 0.7.1
113+
114+
(November 30th, 2015)
115+
116+
##### Improvements
117+
118+
- [#20](https://github.com/sdispater/orator/issues/20) Collections have been improved (New methods added)
119+
- Commands have been improved
120+
- The `to_dict` methods on the `Model`, `Collection` classes and paginators are now deprecated. Use `serialize` instead.
121+
122+
##### Fixes
123+
124+
* [#22](https://github.com/sdispater/orator/issues/22) Model.fill() and other methods now accept a dictionary in addition to keyword arguments.
125+
* MySQL charset config value was not used when connecting. This is now fixed. (Thanks to [@heavenshell](https://github.com/heavenshell))
126+
* [#24](https://github.com/sdispater/orator/issues/24) Dynamic properties called the wrong methods when accessing the related items.
127+
128+
129+
### 0.7
130+
131+
(November 10th, 2015)
132+
133+
##### Improvements
134+
135+
- [#15](https://github.com/sdispater/orator/issues/9) Execute migrations inside a transaction.
136+
- [#13](https://github.com/sdispater/orator/issues/9) Support database seeding and model factories.
137+
- [#9](https://github.com/sdispater/orator/issues/9) Support for SQLite foreign keys.
138+
- Relationships decorators.
139+
- Morph relationships now using a name (default being the table name) rather than a class name.
140+
141+
##### Fixes
142+
143+
- [#14](https://github.com/sdispater/orator/issues/14) Changing columns with SchemaBuilder does not work with some types.
144+
- [#16](https://github.com/sdispater/orator/issues/16) The last page of LengthAwarePaginator is not calculated properly in Python 2.7.
145+
- Avoid an error when psycopg2 is not installed.
146+
- Fix dynamic properties for eagerloaded relationships.
147+
148+
149+
### 0.6.4
150+
151+
(July 7th, 2015)
152+
153+
##### Fixes
154+
155+
- [#11](https://github.com/sdispater/orator/issues/11) Paginator.resolve_current_page() raises and error on Python 2.7.
156+
157+
158+
### 0.6.3
159+
160+
(June 30th, 2015)
161+
162+
##### Improvements
163+
164+
- [#10](https://github.com/sdispater/orator/issues/10) Remove hard dependencies in commands.
165+
166+
##### Fixes
167+
168+
- [#8](https://github.com/sdispater/orator/issues/8) Reconnection on lost connection does not properly work.
169+
170+
171+
### 0.6.2
172+
173+
(June 9nd, 2015)
174+
175+
##### Fixes
176+
177+
- Fixes a bug when results rather than the relation was returned
178+
- Starting a new query from a BelongsToMany relation does not maintain pivot columns.
179+
- Model.set_table() method does not properly handle pivot classes.
180+
- Model.fresh() method raises an error for models retrieved from relations.
181+
182+
183+
### 0.6.1
184+
185+
(June 2nd, 2015)
186+
187+
- Fixes a lot of problems that broke relations behavior in 0.6.
188+
- Adds raw() method to orm builder passthru.
189+
190+
### 0.6
191+
192+
(May 31th, 2015)
193+
194+
- Adds pagination support
195+
- Adds model events support
196+
- Implements Model.load() method
197+
- Adds to_json() method to collections
198+
- Makes to_json() methods consistent.
199+
- Fixes how relations are retrieved from strings
200+
- Fixes classes lookup in morph_to() method
201+
- Fixes mutators not being called when initiating models
202+
- Improves models attributes lookup
203+
- Removes DynamicProperty class. Relations are dynamic themselves.
204+
205+
### 0.5
206+
207+
(May 24th, 2015)
208+
209+
- Adds database migrations
210+
- Adds mutators and accessors
211+
- Fix BelongsToMany.save_many() default joinings value
212+
213+
### 0.4
214+
215+
(April 28th, 2015)
216+
217+
- Adds Schema Builder
218+
- Adds scopes support
219+
- Adds support for related name in relationships declaration
220+
221+
### 0.3.1
222+
223+
(April 19th, 2015)
224+
225+
- Fix MySQLdb compatibiity issues
226+
- Fix wrong default key value for Builder.lists() method
227+
228+
### 0.3
229+
230+
(April 3th, 2015)
231+
232+
- Query logging
233+
- Polymorphic relations
234+
- Adds support for Model.has() method
235+
- Adds support for callbacks in eager load conditions
236+
- Adds support for multi-threaded applications by default
237+
238+
239+
### 0.2
240+
241+
(March 31th, 2015)
242+
243+
- Adds actual ORM with relationships and eager loading
244+
- Adds chunk support for QueryBuilder
245+
- Properly close connections when using reconnect() and disconnect() methods
246+
247+
248+
### 0.1
249+
250+
(March 18th, 2015)
251+
252+
- Initial release

LICENSE

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Copyright (c) 2015 Sébastien Eustace
2+
3+
Permission is hereby granted, free of charge, to any person obtaining
4+
a copy of this software and associated documentation files (the
5+
"Software"), to deal in the Software without restriction, including
6+
without limitation the rights to use, copy, modify, merge, publish,
7+
distribute, sublicense, and/or sell copies of the Software, and to
8+
permit persons to whom the Software is furnished to do so, subject to
9+
the following conditions:
10+
11+
The above copyright notice and this permission notice shall be
12+
included in all copies or substantial portions of the Software.
13+
14+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

MANIFEST.in

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
include README.rst LICENSE
2+
recursive-exclude tests *
3+
recursive-exclude benchmark *

Makefile

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# This file is part of orator
2+
# https://github.com/sdispater/orator
3+
4+
# Licensed under the MIT license:
5+
# http://www.opensource.org/licenses/MIT-license
6+
# Copyright (c) 2015 Sébastien Eustace
7+
8+
# lists all available targets
9+
list:
10+
@sh -c "$(MAKE) -p no_targets__ | \
11+
awk -F':' '/^[a-zA-Z0-9][^\$$#\/\\t=]*:([^=]|$$)/ {\
12+
split(\$$1,A,/ /);for(i in A)print A[i]\
13+
}' | grep -v '__\$$' | grep -v 'make\[1\]' | grep -v 'Makefile' | sort"
14+
# required for list
15+
no_targets__:
16+
17+
# install all dependencies
18+
setup: setup-python
19+
20+
# test your application (tests in the tests/ directory)
21+
test:
22+
@py.test tests -sq
23+
24+
# run tests against all supported python versions
25+
tox:
26+
@tox

README.rst

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Pendulum
2+
########
3+
4+
.. image:: https://travis-ci.org/sdispater/pendulum.png
5+
:alt: Orator Build status
6+
:target: https://travis-ci.org/sdispater/pendulum
7+
8+
Dates and times for Python made easy.

0 commit comments

Comments
 (0)