<div dir="ltr">

Hi all!<div class="entry-content" style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;line-height:1.71429;color:rgb(68,68,68);font-family:"Open Sans",Helvetica,Arial,sans-serif;text-decoration-style:initial;text-decoration-color:initial"><p style="margin:0px 0px 1.71429rem;padding:0px;border:0px;font-size:14px;vertical-align:baseline;line-height:1.71429"><br>In these releases we add support of Python 3.7 and PyPy. Also we changed PonyORM internals significantly in order to add two long-demanded features. The first is<span> </span><a href="https://docs.ponyorm.com/entities.html#hybrid-methods-and-properties" style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;outline:none;color:rgb(159,159,159)">hybrid methods and properties</a>. Now it is possible to define one-line method or property in entity class and use it inside declarative queries. This way it is possible to re-use complex expressions between different queries:</p><pre style="margin:1.71429rem 0px;padding:1.71429rem;border:1px solid rgb(237,237,237);font-size:0.857143rem;vertical-align:baseline;color:rgb(102,102,102);font-family:Consolas,Monaco,"Lucida Console",monospace;line-height:1.71429;overflow:auto"><code style="margin:0px;padding:0px;border:0px;font-size:0.857143rem;vertical-align:baseline;font-family:Consolas,Monaco,"Lucida Console",monospace;line-height:2;display:block">class Person(db.Entity):
    first_name = Required(str)
    last_name = Required(str)
    country = Required(str)
    age = Required(int)

    @property
    def full_name(self):
        return self.first_name + self.last_name

    @property
    def is_adult(self):
        return self.age > 18

...

query = select(p for p in Person if p.is_adult)
</code></pre><p style="margin:0px 0px 1.71429rem;padding:0px;border:0px;font-size:14px;vertical-align:baseline;line-height:1.71429">The second feature is the possibility to base query on a previous query. This way it is possible to construct complex queries gradually. In previous versions of Pony it was possible to add conditions by using<span> </span><code style="margin:0px;padding:0px;border:0px;font-size:0.857143rem;vertical-align:baseline;font-family:Consolas,Monaco,"Lucida Console",monospace;line-height:2">query.filter</code><span> </span>method:</p><pre style="margin:1.71429rem 0px;padding:1.71429rem;border:1px solid rgb(237,237,237);font-size:0.857143rem;vertical-align:baseline;color:rgb(102,102,102);font-family:Consolas,Monaco,"Lucida Console",monospace;line-height:1.71429;overflow:auto"><code style="margin:0px;padding:0px;border:0px;font-size:0.857143rem;vertical-align:baseline;font-family:Consolas,Monaco,"Lucida Console",monospace;line-height:2;display:block">query2 = query.filter(lambda person: person.country == 'USA')
</code></pre><p style="margin:0px 0px 1.71429rem;padding:0px;border:0px;font-size:14px;vertical-align:baseline;line-height:1.71429">but<span> </span><code style="margin:0px;padding:0px;border:0px;font-size:0.857143rem;vertical-align:baseline;font-family:Consolas,Monaco,"Lucida Console",monospace;line-height:2">query.filter</code><span> </span>function cannot change the result type of query. Now you have full flexibility for making your query:</p><pre style="margin:1.71429rem 0px;padding:1.71429rem;border:1px solid rgb(237,237,237);font-size:0.857143rem;vertical-align:baseline;color:rgb(102,102,102);font-family:Consolas,Monaco,"Lucida Console",monospace;line-height:1.71429;overflow:auto"><code style="margin:0px;padding:0px;border:0px;font-size:0.857143rem;vertical-align:baseline;font-family:Consolas,Monaco,"Lucida Console",monospace;line-height:2;display:block">query3 = select(x.full_name for x in query2 if x.last_name.startswith('A'))
</code></pre><p style="margin:0px 0px 1.71429rem;padding:0px;border:0px;font-size:14px;vertical-align:baseline;line-height:1.71429">Implementing this two features was not easy, because SQL and Python have different namespace rules, and mapping Python name to SQL aliases is a non-trivial task for complex queries.</p><p style="margin:0px 0px 1.71429rem;padding:0px;border:0px;font-size:14px;vertical-align:baseline;line-height:1.71429">Also we added a<span> </span><code style="margin:0px;padding:0px;border:0px;font-size:0.857143rem;vertical-align:baseline;font-family:Consolas,Monaco,"Lucida Console",monospace;line-height:2">pony.flask</code><span> </span>subpackage wich provide<span> </span><a href="https://docs.ponyorm.com/integration_with_flask.html" style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;outline:none;color:rgb(159,159,159)">integration with Flask</a>, so extensions like Flask-Login can work with Pony.</p><p style="margin:0px 0px 1.71429rem;padding:0px;border:0px;font-size:14px;vertical-align:baseline;line-height:1.71429">From now on we will concentrate on migration tool and hopefully release it soon.</p><p style="margin:0px 0px 1.71429rem;padding:0px;border:0px;font-size:14px;vertical-align:baseline;line-height:1.71429">Here is the detailed changelog:</p><h1 style="margin:1.71429rem 0px;padding:0px;border:0px;font-size:1.5rem;vertical-align:baseline;clear:both;line-height:1.5">Pony ORM Release 0.7.4 (2018-07-23)</h1><h2 style="margin:1.71429rem 0px;padding:0px;border:0px;font-size:1.28571rem;vertical-align:baseline;clear:both;line-height:1.6">Major features</h2><ul style="margin:0px 0px 1.71429rem;padding:0px;border:0px;font-size:14px;vertical-align:baseline;list-style:disc outside;line-height:1.71429"><li style="margin:0px 0px 0px 2.57143rem;padding:0px;border:0px;font-size:14px;vertical-align:baseline"><a href="https://docs.ponyorm.com/entities.html#hybrid-methods-and-properties" style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;outline:none;color:rgb(159,159,159)">Hybrid methods and properties</a><span> </span>added</li><li style="margin:0px 0px 0px 2.57143rem;padding:0px;border:0px;font-size:14px;vertical-align:baseline">Allow to base queries on another queries:<span> </span><code style="margin:0px;padding:0px;border:0px;font-size:0.857143rem;vertical-align:baseline;font-family:Consolas,Monaco,"Lucida Console",monospace;line-height:2">select(x.a for x in prev_query if x.b)</code></li><li style="margin:0px 0px 0px 2.57143rem;padding:0px;border:0px;font-size:14px;vertical-align:baseline">Added support of Python 3.7</li><li style="margin:0px 0px 0px 2.57143rem;padding:0px;border:0px;font-size:14px;vertical-align:baseline">Added support of PyPy</li><li style="margin:0px 0px 0px 2.57143rem;padding:0px;border:0px;font-size:14px;vertical-align:baseline"><code style="margin:0px;padding:0px;border:0px;font-size:0.857143rem;vertical-align:baseline;font-family:Consolas,Monaco,"Lucida Console",monospace;line-height:2">group_concat()</code><span> </span>aggregate function added</li><li style="margin:0px 0px 0px 2.57143rem;padding:0px;border:0px;font-size:14px;vertical-align:baseline"><code style="margin:0px;padding:0px;border:0px;font-size:0.857143rem;vertical-align:baseline;font-family:Consolas,Monaco,"Lucida Console",monospace;line-height:2">pony.flask</code><span> </span>subpackage added for<span> </span><a href="https://docs.ponyorm.com/integration_with_flask.html" style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;outline:none;color:rgb(159,159,159)">integration with Flask</a></li></ul><h2 style="margin:1.71429rem 0px;padding:0px;border:0px;font-size:1.28571rem;vertical-align:baseline;clear:both;line-height:1.6">Other features</h2><ul style="margin:0px 0px 1.71429rem;padding:0px;border:0px;font-size:14px;vertical-align:baseline;list-style:disc outside;line-height:1.71429"><li style="margin:0px 0px 0px 2.57143rem;padding:0px;border:0px;font-size:14px;vertical-align:baseline"><code style="margin:0px;padding:0px;border:0px;font-size:0.857143rem;vertical-align:baseline;font-family:Consolas,Monaco,"Lucida Console",monospace;line-height:2">distinct</code><span> </span>option added to aggregate functions</li><li style="margin:0px 0px 0px 2.57143rem;padding:0px;border:0px;font-size:14px;vertical-align:baseline">Support of explicit casting to<span> </span><code style="margin:0px;padding:0px;border:0px;font-size:0.857143rem;vertical-align:baseline;font-family:Consolas,Monaco,"Lucida Console",monospace;line-height:2">float</code><span> </span>and<span> </span><code style="margin:0px;padding:0px;border:0px;font-size:0.857143rem;vertical-align:baseline;font-family:Consolas,Monaco,"Lucida Console",monospace;line-height:2">bool</code><span> </span>in queries</li></ul><h2 style="margin:1.71429rem 0px;padding:0px;border:0px;font-size:1.28571rem;vertical-align:baseline;clear:both;line-height:1.6">Improvements</h2><ul style="margin:0px 0px 1.71429rem;padding:0px;border:0px;font-size:14px;vertical-align:baseline;list-style:disc outside;line-height:1.71429"><li style="margin:0px 0px 0px 2.57143rem;padding:0px;border:0px;font-size:14px;vertical-align:baseline">Apply<span> </span><code style="margin:0px;padding:0px;border:0px;font-size:0.857143rem;vertical-align:baseline;font-family:Consolas,Monaco,"Lucida Console",monospace;line-height:2">@cut_traceback</code><span> </span>decorator only when<span> </span><code style="margin:0px;padding:0px;border:0px;font-size:0.857143rem;vertical-align:baseline;font-family:Consolas,Monaco,"Lucida Console",monospace;line-height:2">pony.MODE</code><span> </span>is ‘INTERACTIVE’</li></ul><h2 style="margin:1.71429rem 0px;padding:0px;border:0px;font-size:1.28571rem;vertical-align:baseline;clear:both;line-height:1.6">Bugfixes</h2><ul style="margin:0px 0px 1.71429rem;padding:0px;border:0px;font-size:14px;vertical-align:baseline;list-style:disc outside;line-height:1.71429"><li style="margin:0px 0px 0px 2.57143rem;padding:0px;border:0px;font-size:14px;vertical-align:baseline">In SQLite3<span> </span><code style="margin:0px;padding:0px;border:0px;font-size:0.857143rem;vertical-align:baseline;font-family:Consolas,Monaco,"Lucida Console",monospace;line-height:2">LIKE</code><span> </span>is case sensitive now</li><li style="margin:0px 0px 0px 2.57143rem;padding:0px;border:0px;font-size:14px;vertical-align:baseline"><a href="https://github.com/ponyorm/pony/issues/249" style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;outline:none;color:rgb(159,159,159)">#249</a>: Fix incorrect mixin used for Timedelta</li><li style="margin:0px 0px 0px 2.57143rem;padding:0px;border:0px;font-size:14px;vertical-align:baseline"><a href="https://github.com/ponyorm/pony/issues/251" style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;outline:none;color:rgb(159,159,159)">#251</a>: correct dealing with qualified table names</li><li style="margin:0px 0px 0px 2.57143rem;padding:0px;border:0px;font-size:14px;vertical-align:baseline"><a href="https://github.com/ponyorm/pony/issues/301" style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;outline:none;color:rgb(159,159,159)">#301</a>: Fix aggregation over JSON Column</li><li style="margin:0px 0px 0px 2.57143rem;padding:0px;border:0px;font-size:14px;vertical-align:baseline"><a href="https://github.com/ponyorm/pony/issues/306" style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;outline:none;color:rgb(159,159,159)">#306</a>: Support of frozenset constants added</li><li style="margin:0px 0px 0px 2.57143rem;padding:0px;border:0px;font-size:14px;vertical-align:baseline"><a href="https://github.com/ponyorm/pony/issues/308" style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;outline:none;color:rgb(159,159,159)">#308</a>: Fixed an error when assigning JSON attribute value to the same attribute:<span> </span><code style="margin:0px;padding:0px;border:0px;font-size:0.857143rem;vertical-align:baseline;font-family:Consolas,Monaco,"Lucida Console",monospace;line-height:2">obj.json_attr = obj.json_attr</code></li><li style="margin:0px 0px 0px 2.57143rem;padding:0px;border:0px;font-size:14px;vertical-align:baseline"><a href="https://github.com/ponyorm/pony/issues/313" style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;outline:none;color:rgb(159,159,159)">#313</a>: Fix missed retry on exception raised during<span> </span><code style="margin:0px;padding:0px;border:0px;font-size:0.857143rem;vertical-align:baseline;font-family:Consolas,Monaco,"Lucida Console",monospace;line-height:2">db_session.__exit__</code></li><li style="margin:0px 0px 0px 2.57143rem;padding:0px;border:0px;font-size:14px;vertical-align:baseline"><a href="https://github.com/ponyorm/pony/issues/314" style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;outline:none;color:rgb(159,159,159)">#314</a>: Fix AttributeError: ‘NoneType’ object has no attribute ‘seeds’</li><li style="margin:0px 0px 0px 2.57143rem;padding:0px;border:0px;font-size:14px;vertical-align:baseline"><a href="https://github.com/ponyorm/pony/issues/315" style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;outline:none;color:rgb(159,159,159)">#315</a>: Fix attribute lifting for JSON attributes</li><li style="margin:0px 0px 0px 2.57143rem;padding:0px;border:0px;font-size:14px;vertical-align:baseline"><a href="https://github.com/ponyorm/pony/issues/321" style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;outline:none;color:rgb(159,159,159)">#321</a>: Fix KeyError on<span> </span><code style="margin:0px;padding:0px;border:0px;font-size:0.857143rem;vertical-align:baseline;font-family:Consolas,Monaco,"Lucida Console",monospace;line-height:2">obj.delete()</code></li><li style="margin:0px 0px 0px 2.57143rem;padding:0px;border:0px;font-size:14px;vertical-align:baseline"><a href="https://github.com/ponyorm/pony/issues/325" style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;outline:none;color:rgb(159,159,159)">#325</a>: duplicating percentage sign in raw SQL queries without parameters</li><li style="margin:0px 0px 0px 2.57143rem;padding:0px;border:0px;font-size:14px;vertical-align:baseline"><a href="https://github.com/ponyorm/pony/issues/331" style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;outline:none;color:rgb(159,159,159)">#331</a>: Overriding<span> </span><code style="margin:0px;padding:0px;border:0px;font-size:0.857143rem;vertical-align:baseline;font-family:Consolas,Monaco,"Lucida Console",monospace;line-height:2">__len__</code>in entity fails</li><li style="margin:0px 0px 0px 2.57143rem;padding:0px;border:0px;font-size:14px;vertical-align:baseline"><a href="https://github.com/ponyorm/pony/issues/336" style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;outline:none;color:rgb(159,159,159)">#336</a>: entity declaration serialization</li><li style="margin:0px 0px 0px 2.57143rem;padding:0px;border:0px;font-size:14px;vertical-align:baseline"><a href="https://github.com/ponyorm/pony/issues/357" style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;outline:none;color:rgb(159,159,159)">#357</a>: reconnect after PostgreSQL server closed the connection unexpectedly</li><li style="margin:0px 0px 0px 2.57143rem;padding:0px;border:0px;font-size:14px;vertical-align:baseline">Fix Python implementation of<span> </span><code style="margin:0px;padding:0px;border:0px;font-size:0.857143rem;vertical-align:baseline;font-family:Consolas,Monaco,"Lucida Console",monospace;line-height:2">between()</code><span> </span>function and rename arguments:<span> </span><code style="margin:0px;padding:0px;border:0px;font-size:0.857143rem;vertical-align:baseline;font-family:Consolas,Monaco,"Lucida Console",monospace;line-height:2">between(a, x, y)</code>-><span> </span><code style="margin:0px;padding:0px;border:0px;font-size:0.857143rem;vertical-align:baseline;font-family:Consolas,Monaco,"Lucida Console",monospace;line-height:2">between(x, a, b)</code></li><li style="margin:0px 0px 0px 2.57143rem;padding:0px;border:0px;font-size:14px;vertical-align:baseline">Fix retry handling: in PostgreSQL and Oracle an error can be raised during commit</li><li style="margin:0px 0px 0px 2.57143rem;padding:0px;border:0px;font-size:14px;vertical-align:baseline">Fix optimistic update checks for composite foreign keys</li><li style="margin:0px 0px 0px 2.57143rem;padding:0px;border:0px;font-size:14px;vertical-align:baseline">Don’t raise<span> </span><code style="margin:0px;padding:0px;border:0px;font-size:0.857143rem;vertical-align:baseline;font-family:Consolas,Monaco,"Lucida Console",monospace;line-height:2">OptimisticCheckError</code><span> </span>if<span> </span><code style="margin:0px;padding:0px;border:0px;font-size:0.857143rem;vertical-align:baseline;font-family:Consolas,Monaco,"Lucida Console",monospace;line-height:2">db_session</code><span> </span>is not optimistic</li><li style="margin:0px 0px 0px 2.57143rem;padding:0px;border:0px;font-size:14px;vertical-align:baseline">Handling incorrect datetime values in MySQL</li><li style="margin:0px 0px 0px 2.57143rem;padding:0px;border:0px;font-size:14px;vertical-align:baseline">Improved ImportError exception messages when MySQLdb, pymysql, psycopg2 or psycopg2cffi driver was not found</li><li style="margin:0px 0px 0px 2.57143rem;padding:0px;border:0px;font-size:14px;vertical-align:baseline"><code style="margin:0px;padding:0px;border:0px;font-size:0.857143rem;vertical-align:baseline;font-family:Consolas,Monaco,"Lucida Console",monospace;line-height:2">desc()</code><span> </span>function fixed to allow reverse its effect by calling<span> </span><code style="margin:0px;padding:0px;border:0px;font-size:0.857143rem;vertical-align:baseline;font-family:Consolas,Monaco,"Lucida Console",monospace;line-height:2">desc(desc(x))</code></li><li style="margin:0px 0px 0px 2.57143rem;padding:0px;border:0px;font-size:14px;vertical-align:baseline"><code style="margin:0px;padding:0px;border:0px;font-size:0.857143rem;vertical-align:baseline;font-family:Consolas,Monaco,"Lucida Console",monospace;line-height:2">__contains__</code><span> </span>method should check if objects belong to the same db_session</li><li style="margin:0px 0px 0px 2.57143rem;padding:0px;border:0px;font-size:14px;vertical-align:baseline">Fix<span> </span><code style="margin:0px;padding:0px;border:0px;font-size:0.857143rem;vertical-align:baseline;font-family:Consolas,Monaco,"Lucida Console",monospace;line-height:2">pony.MODE</code><span> </span>detection;<span> </span><code style="margin:0px;padding:0px;border:0px;font-size:0.857143rem;vertical-align:baseline;font-family:Consolas,Monaco,"Lucida Console",monospace;line-height:2">mod_wsgi</code><span> </span>detection according to official doc</li><li style="margin:0px 0px 0px 2.57143rem;padding:0px;border:0px;font-size:14px;vertical-align:baseline">A lot of inner fixes</li></ul><h1 style="margin:1.71429rem 0px;padding:0px;border:0px;font-size:1.5rem;vertical-align:baseline;clear:both;line-height:1.5">Pony ORM Release 0.7.5 (2018-07-24)</h1><h2 style="margin:1.71429rem 0px;padding:0px;border:0px;font-size:1.28571rem;vertical-align:baseline;clear:both;line-height:1.6">Bugfixes</h2><ul style="margin:0px 0px 1.71429rem;padding:0px;border:0px;font-size:14px;vertical-align:baseline;list-style:disc outside;line-height:1.71429"><li style="margin:0px 0px 0px 2.57143rem;padding:0px;border:0px;font-size:14px;vertical-align:baseline"><code style="margin:0px;padding:0px;border:0px;font-size:0.857143rem;vertical-align:baseline;font-family:Consolas,Monaco,"Lucida Console",monospace;line-height:2">query.where</code><span> </span>and<span> </span><code style="margin:0px;padding:0px;border:0px;font-size:0.857143rem;vertical-align:baseline;font-family:Consolas,Monaco,"Lucida Console",monospace;line-height:2">query.filter</code><span> </span>method bug introduced in 0.7.4 was fixed</li></ul></div>

<br>--<br>Best regards,<br>PonyORM team</div>