
Micaiah
27.12.2016
21:09:07
That'll probably be my plan then
Might have to hack-up manage.py to work with Pony's migrations

Alexander
27.12.2016
21:12:20
Probably in the future we can add some Django-Pony adapter.
Also, there was a projwct which automatically creates Pony entity for each Django model. Maybe it is possible to revive it https://github.com/nnseva/djony

Micaiah
29.12.2016
02:00:51
Oh cool, for now I think I'd probably just not use Django haha. The current project is using hug.

Google

Luckydonald
29.12.2016
04:12:32
Still don't get what hug does

Micaiah
29.12.2016
04:13:15
It takes falcon and does magic

Luckydonald
29.12.2016
04:15:00
Okey, now what does falcon do?

Micaiah
29.12.2016
04:15:16
HTTP APIs

Luckydonald
29.12.2016
04:15:57
Ah, I see.
I use flask, so I just use json...
What are the advantages?

Micaiah
29.12.2016
04:16:27
Its faster, and you don't have to deal with globals
I like flask a lot, but I think I'm gonna switch to hug as my main for now on

Mikki
29.12.2016
13:12:03
Welcome :)

Ilya
29.12.2016
13:13:48
Hi! I saw Pony ORM recently and reading docs now :) About me - study data science on MOOC and making some scientific analytics in my lab.

Bill
29.12.2016
15:44:30
Having defined a field and populated a few records -- I change my mind and decide that the field should have been unique. What must I do to change the field's schema and have that written back to sqlite? Can't find it in the doc. Thanks!

Romet
29.12.2016
15:45:57
you need migrations for that, which are still a work in progress
for now, you have to alter the table manually

Bill
29.12.2016
15:46:29
OK! Thanks again.

Google

Micaiah
29.12.2016
19:26:39
I wish there was a group like this for general Python, but I can't find one.

James
29.12.2016
22:09:49
Kinda tempted to make one, not sure if it'd just be noise though

Micaiah
29.12.2016
22:10:34

James
29.12.2016
22:12:28
Shall I make one and we can try it?

Micaiah
29.12.2016
22:12:39
Sure

James
29.12.2016
22:18:09
https://telegram.me/joinchat/AaGuz0De4WkhL72Cxb5MBA

Lukas
30.12.2016
07:34:11
good morning ?

Luckydonald
30.12.2016
08:50:48
hi

Artur Rakhmatulin
30.12.2016
08:56:58
hello
Someone uses a PonyOrm with oracle without "triggers" for insert into some tables ?
i have old project with bad arhitecture and noone tables havent triggers.
i solved my problem by "before_insert" entity event
with 2 methods "check_trigger" and "create_trigger" )

Alexander
30.12.2016
09:06:21
So you still use triggers, but create them dynamically on first insert?

Artur Rakhmatulin
30.12.2016
09:09:12
Ok, i know i can )
But , does pony to work with Oracle without triggers ?
like a Hibernate Orm in java

Alexander
30.12.2016
09:20:40
Currently Pony relies on triggers when working with Oracle. I think we can add another way of working with identity columns. Please open new issue for that, and provide a link to description how Hibernate does it: https://github.com/ponyorm/pony/issues

Artur Rakhmatulin
30.12.2016
09:21:41
wow
Last question. :)
What happend if i have tables with Data but havent triggers and i start Pony db.generate_mapping(create_tables=True)
That method not erasing my Data? Just creating tgiggers if Table havent it?
Maybe anybody know answer or u Alexander. But i cat test it if you dont.
.
Thank you for your wonderful project! ?
Happy holidays!

Alexander
30.12.2016
09:37:29
If you use create_tables=True option Pony should create missing tables, indexes and trigers. It should not erase any data, so you can try.
But in our next release (which we should release really soon) we change how intermediary many-o-many tables are named. If you use create_table=True option, it is possible that, as part of upgrade to new Pony version, generate_mapping will automatically rename many-to-many tables if table name is not specified explicitly.

Google

Alexander
30.12.2016
09:38:15
Thanks!

Mikki
05.01.2017
17:44:49
Welcome both

Dan
05.01.2017
17:46:17
Hello. I currently work with Django and PonyORM looks very superior to the Django ORM. The syntax looks much nicer, and on migrations, one frustration with Django is that you can't rename a class easily in their migrations. Would love to see a Pony for Django (to deal with existing projects), and Pony with Flask looks like it could be even better than Django. When will pony.js be released?

Micaiah
05.01.2017
17:47:28

Artur Rakhmatulin
05.01.2017
17:52:49
I work on oldest java project with hibernate and old spring, and recently i try fast fix some bags in DB with python and pony, and i say u - java sux if u need fast development
I fell in love with python & ponyOrm

Alexey
05.01.2017
18:15:00


Dan
05.01.2017
18:18:26
Thank you. In your Talk Python To Me interview you also mentioned database reflection. Where does that feature stand priority-wise? If you have migrations and reflection, then I could see reworking existing Django projects with Pony/Flask. (Incidentally, Django has reflection(https://docs.djangoproject.com/en/1.10/ref/django-admin/#django-admin-inspectdb)

Alexey
05.01.2017
18:31:57
Dan,
Migrations are almost ready, we release it in a matter of weeks. The reflection is the priority, we combine it with the https://editor.ponyorm.com, so that you can launch the reflection tool and get the database diagram and the classes.

Luckydonald
05.01.2017
20:42:53

Mikki
06.01.2017
06:52:23
Welcome!

Dan
06.01.2017
16:23:16

Micaiah
06.01.2017
18:15:22

Kittex2
06.01.2017
22:27:35
I want to use pony, but I can't while it still doesn't have migrations.

Micaiah
06.01.2017
22:28:17

Mikki
08.01.2017
16:18:50
Welcome

Evgeniy
08.01.2017
16:40:54
i be suprised see telegram group in site))

Михаил
10.01.2017
13:12:06
how about thread safe?

Google

Михаил
10.01.2017
13:15:13
should we expect asyncio/tornado support in near future?

Alexey
10.01.2017
13:17:06

Михаил
10.01.2017
13:22:24
it's a main reason I didn't migrate on pony

Anton
10.01.2017
13:23:01
In order not to block asyncio ioloop, you can run queries in separate threads. Here is a small example of PonyORM query in aiohttp handler: https://gist.github.com/grudko/4c1dcd2a2eb29bc3d98cd19bfd916cbd

Alexander
10.01.2017
13:26:14
Most queries that retrieve objects by primary keys can be run synchronously from asyncio/tornado, and it will be faster than using async protocol

Luckydonald
10.01.2017
13:27:09

Anton
10.01.2017
13:27:25
Oh, I used threadpool from https://github.com/agronholm/asyncio_extras

Luckydonald
10.01.2017
13:29:11
Maybe I should learn async

Alexander
10.01.2017
13:29:48
The pattern @agrudko suggests may be helpful if db_session contains long queries (analytics, aggregation, etc.)

Alexey
10.01.2017
14:53:43
Pony ORM Release 0.7.1: Python 3.6 support and some bugfixes https://blog.ponyorm.com/2017/01/10/pony-orm-release-0-7-1/
yay ?

Michael
10.01.2017
14:54:37
❤

Romet
10.01.2017
15:29:09
Nice! Great job.

Luckydonald
10.01.2017
15:38:29

Micaiah
10.01.2017
16:31:46
Woohoo!
7.1 doesn't come with migrations correct?

Alexey
10.01.2017
18:42:48

Micaiah
10.01.2017
18:43:21

Марк ☢
10.01.2017
18:53:56
see yellow ribbon

Alexey
10.01.2017
19:02:19

Vasiliy
12.01.2017
11:25:49
Hello everybody. I use Pony for connect to the remote Postgres database. Periodically, the database connection is lost and Pony returns an exception:
File "... / lib / python2.7 / site-packages / pony / orm / core.py", line 1566, in close
try: provider.rollback (connection, cache)
File "<auto generated wrapper of rollback () function>", line 2, in rollback
File "... / lib / python2.7 / site-packages / pony / orm / dbapiprovider.py", line 59, in wrap_dbapi_exceptions
raise InterfaceError (e)
RollbackException: InterfaceError: connection already closed
After that, Pony automatic reconnect, but my function call is aborted.
Is it possible to test the connection and forced to reconnect? I have not found the necessary methods in Pony docs. Maybe you need to look at psycopg2 docs?

Google


Alexander
12.01.2017
11:42:40
Hi Vasiliy! Pony should be able to reconnect automatically, if the connection was lost not in the middle of transaction.
I think that your problem caused by the following sequense of actions:
1) An application code performs some query;
2) Due to some problem in configuration (for example, an insufficient size of some buffer) the server drops the connection, and Pony gets an exception from psycopg2;
3) Exception unrolling leads to exiting from db_session;
4) Pony tries to handle exit from db_session and attempts to peform rollback, assuming that the connection is stlii active;
5) At this moment we got another exception, "connection already closed" which masks previous exception.
I think we need to improve handling of rollback so it does not mask previous exception in case the connection is closed already.
Regarding your situation, I think the right way is not to attempt to reconnect, but to prevent an exception which lead to connection closing. After we fix handling of rollback, you should be able to see this original exception and will be able to fix its root


Святослав
12.01.2017
11:45:34
Hi. I have a question about ready to use in production.
Can i safely upgrade my database schema? I saw migrations not implemtented in before.

Alexander
12.01.2017
11:46:09
We are working on migration tool right now. It should be released really soon

Святослав
12.01.2017
11:46:57
Without this tool only way it's handmade migration?

Alexander
12.01.2017
11:51:14
If you add a new entity or many-to-many relationship, and you call generate_mapping with create_tables=True, Pony will issue CREATE TABLE commands automatically. If you add a new attribute to previous entity, right now you need to perform ALTER TABLE command manually. Typically such commands are pretty simple, but with migration tool it will be easier to write and execute them