Rozen
probably define a new entitiy that holds everything you want to gather?
A
I thought about that but it felt gimmicky. Guess theres no other choice
Ben
Sergey
PSoftware 👨🏻💻
good morning
PSoftware 👨🏻💻
how to register more than 1 record with ponyorm
PSoftware 👨🏻💻
¿?
PSoftware 👨🏻💻
one consult, before y after in pony
PSoftware 👨🏻💻
?
Alexander
PSoftware 👨🏻💻
yes
Alexander
In a loop
PSoftware 👨🏻💻
yes
PSoftware 👨🏻💻
more of 15millon register
Alexander
Loop of batch
PSoftware 👨🏻💻
I want to upload this information to my database
PSoftware 👨🏻💻
error: (2002, "Can't connect to server on 'localhost' (10048)")
PSoftware 👨🏻💻
disconnect for limit max_connection
PSoftware 👨🏻💻
helpme!
PSoftware 👨🏻💻
please
Alexander
It is not pony related case, you should disconnect them manually (since it is a localhost)
PSoftware 👨🏻💻
the same happens a remote
Oualid
any update for pony? (migration, async-await )
Ben
Alexander
I merged Python 3.11 support into the main branch. Need a bit more time for the actual release, I think we can do it tomorrow
Ben
That's amazing news thanks a lot!
Christian
Seconded, that's great to hear!
Miko
Alexander
Miko
I know, but I also see many merge requests that seems to be hanging, and it matters to me how you see the project going forward.
Alexander
Oh thats true
Miko
We could do something like https://github.com/faust-streaming/faust if that's what you mean?
Permalink Bot
Alexander
We need to think how to make it accessible to everyone
Miko
Sure
yg
excuse me, how to update multi values at one time ?
yg
there is no update syntax ?
Vitaliy
To update multiple attributes on single entity instance you can use .set() method, for example User[1].set(firstname='Blabal', lastname='Blabloff'). Bulk (dirty) update is not supported.
yg
thanks~ i will
yg
i will try
yg
sorry my fault, actually i want to update multi entity by one condition, eg:
update users set status='online' where id > 100;
PSoftware 👨🏻💻
Ben
Or any way I can help make a Github action to publish to Pypi?
plusi
Hi folks, are you planning to support async operations?
Miko
Bulk?
Putting implementation aside, I was wondering what would be a syntax for bulk update? One cool feature of Pony is its Pythonic natural expression. Any ideas how to make bulk in a similar spirit?
Ben
Has anybody seen that error before: pony.orm.decompiling.DecompileError: Unsupported operation: EXTENDED_ARG
Ben
Since migrating to Python 3.11 with the current main branch
Alexander
Ben
Let me try to figure out which generator it comes from
Ben
it's a bit burried in the traceback of my test suite
Denis
Hello. Is the project still supported? When can we expect an update?
Alexander
Hi, we expect to be able to do a release with Python 3.11 support this Saturday
Denis
This is great news. I really like pony orm, but the lack of updates has cast doubt on its continued use.
Ben
Alexander
PonyORM 0.7.17 release with Python 3.11 support is out:
https://github.com/ponyorm/pony/releases/tag/v0.7.17
Radim
great work! thank you Alex
Dañiel
Thank you!
Alexander
Since we dropped lower python version I think of 0.8 tag but it's okay i think
Alexander
Too late, I think
Ben
Thanks so much! That's amazing news!
Vitaliy
🥳 Greatest news!!!
anand
Thanks Alex !! 🎉
Christian
Amo
Good job. Thanks
Sergey
Miko
😍
Henri
Hi! That's great news! 👌
Henri
I have a question.
Here is my query:
def query(self):
query = ProductVariation.select(product=self.product)
if not self.is_shop_owner:
query = query.where(lambda p: p.active is True)
query = query.sort_by(ProductVariation.sku)
self.product_variation_count = len(query)
return query[:]
And I get this error:
E TypeError: Lambda argument `p` does not correspond to any variable in original query
What do I wrong?
PSoftware 👨🏻💻
query = ProductVariation.select(lambda a: a.product==self.product)
Alexander
Alexander
Consider the following query:
query = select(
a
for a in EntityA
for b in EntityB
if a.attr1 == b.attr2
)
Let's suppose you want to filter the result of the query. You have two similar methods for this: filter and where. Both of them expect the lambda function as an argument. But the meaning of lambda arguments in these methods is different.
The filter method is like a filter function in Python. When you use the filter method, lambda receives items from the previous query result:
query2 = query.filter(lambda x: x.attr3 > 0) # x is an instance of EntityA
In this example, x is actually a from the first query result. You can name lambda argument for the filter function as you wish, so the next example works the same way as the previous one:
query2 = query.filter(lambda y: y.attr3 > 0) # y is an instance of EntityA
Using the filter method is convenient because you can use any names for lambda arguments.
Alexander
Now back to your question:
Henri
Thanks a lot! That makes sense. I thought you use only the first letter and that what it says in the docs. But to use all capital letters makes more sense.