stsouko
Thank You
Alexander
Sure
Pedro
Merry xmas.
Pedro
Im trying Pony and was wondering if there's a way to convert entities to some pod like NamedTuple so I can get the data out of a db_session
Pedro
if there's no such a thing maybe I can build something with _columns_ would that make sense?
Pedro
another thing is that I tried to make an additional index and seems that this is not supported, I only saw compound index or index through unique
Alexander
Hi! If you want to specify non-unique index, you can add index=True or index="index_name" to attribute options You can extract attribute values using to_dict() method: https://docs.ponyorm.com/api_reference.html?highlight=to_dict#Entity.to_dict
Pedro
I will try, thanks
Pedro
Merry Xmas
Alexander
Merry Xmas!
Genesis Shards Community
Hola
Genesis Shards Community
Buenas tardes
Alexander
Hi
Genesis Shards Community
tienen tutoriales en Youtube?
Alexander
No, just documentation
Alexander
https://docs.ponyorm.com/
Rozen
tienen tutoriales en Youtube?
mind to speak in english here from now on (please)
Genesis Shards Community
Genesis Shards Community
Polls
Alexander
Happy new year everyone!
Alexey
Happy new year everyone!
๐ŸŽ‰๐ŸŽ„๐Ÿ‘๐Ÿ˜€
Alexander
Happy New Year! ๐ŸŽ‰๐ŸŽ‰๐ŸŽ‰
Carel
Happy New Years !!! May you all get a pony !!!
Jim
Pony new year ๐ŸŽ‰๐ŸŽ‰๐ŸŽ‰
Pedro
Livan
feliz navidad a todos
Angel
Merry christmas and ๐Ÿฅณ
Genesis Shards Community
Feliz año nuevo
Genesis Shards Community
feliz navidad a todos
De dónde eres?
Angel
Saludos
Anonymous
Happy New year!!!
Livan
happy new year from havana cuba
Lucky
Frohes Neues! ๐ŸŽ†
Rozen
Hi! there is any url explaining how migrations work?
Jim
https://github.com/ponyorm/pony/blob/orm-migrations/pony/migrate/README.md
Permalink Bot
https://github.com/ponyorm/pony/blob/orm-migrations/pony/migrate/README.md
Permanent link to the file pony/migrate/README.md mentioned. (?)
Rozen
aa
Rozen
thanks
Rozen
i forgot it was on a branch
Lucky
https://github.com/ponyorm/pony/blob/orm-migrations/pony/migrate/README.md
Will it support rolling back versions with a backwards function?
Alexander
It would be nice, but I think it will be added later
Alexander
Did anyone work with Flask-Admin with Pony. Was there some problems?
Alexander
Someone said he was unable to work with Pony and Flask-Admin together. He didn't bring any details, so I ask if anyone used it.
Livan
how to use pony orm whit mongodb
Alexander
PonyORM only supports relational databases at this moment: PostgreSQL, SQLite, MySQL, Oracle
Livan
uff, when use pymongo module?
Livan
sorry by my inglesh
Alexander
You can use PyMongo to connect to MongoDB from Python, but this is not related to PonyORM. This chat is about PonyORM, not about PyMongo
Livan
yes, i question if pony orm suport mongodb
Valentin
I thought that ORM is about relational database, when mongo isn't one.
Valentin
I heard that you can do it with some mysql->mongo proxy, but this is not a good idea)
Alexander
Ah, ok. I hope PonyORM will support MongoDB eventually, but not in the nearest year or two In principle it is possible to implement such support, because PonyORM itself uses Entity-Relationship model which can be mapped to both relational model and hierarchical model (used in NoSQL databases such as MongoDB). But it requres big internal changes
Livan
๐Ÿ‘
Alexander
We were never at this point
Anzor
Hey! How can I set default per page value to be used with .page(1) method?
Matthew
https://docs.ponyorm.com/api_reference.html#Query.page
Matthew
.page(1, pagesize=20)
Anzor
@matthewrobertbell sorry, looked twice but didn't see. Thanks!
Anzor
Doesn't Pony set ON DELETE/UPDATE CASCADE when it adds foreign keys?
Alexander
No
Alexander
Probably it should
Anzor
@metaprogrammer aha! Thanks! I thought I have missed something again
Alexander
But when Pony deletes object with all its dependent objects, it loads them all in memory in be sure that IdentityMap cache is in valid state and all before_delete / after_delete hooks are processed for all dependent objects
Alexander
So, as Pony loads all objects into memory before deletion, ON CASCADE option is not useful for Pony. But it may be useful for raw sql delete queries
Matthew
Maybe useful for delete(bulk=True) ?
Anzor
But when Pony deletes object with all its dependent objects, it loads them all in memory in be sure that IdentityMap cache is in valid state and all before_delete / after_delete hooks are processed for all dependent objects
Yep, it works that way, but sometimes you have to make some updates directly and I was wondering why I couldn't just delete a row that is referenced from another table
Anzor
i.e. via psql
Alexander
Maybe useful for delete(bulk=True) ?
Yes, I think we should specify CASCADE option #todo But after that it will be possible to have object in db_session cache which is already deleted from the database due to cascade deletion from its parent object
Anzor
Ya, not so easy. Why I'd like to have this enabled by default is because I have create_tables enabled while actively developing and when making many deployments I want to be fully abstract from details
Jim
hi. is MyEntity.select()[:] equivalent to MyEntity.select()[None:None] ?
Alexander
yes
Abhijit
hello everyone, just a noob question... does ponyorm supports MSSQL, and if yes can someone point me to doc/same usage of it...
Alexander
Hi! At this moment PonyORM does not support MS SQL yet
Abhijit
ohh okkay, thanks for replying quickly, appreciate that @metaprogrammer
Grigory
Hi! Is there a way to define 'shortcuts' in Pony objects, so it is possible to get the value of the related entity's key directly, like this? class Parend(db.Enitty): val = orm.Optional ('Child' , reverse='par') shortcut = orm.Shortcut('Child', 'pk') class Child(db.Entity): pk = orm.PrimaryKey(str) par = orm.Set('Parent') c1 = Child(pk='bla') p1 = Parent(val=c1) >>> print p1.val >>>Child[u'bla'] >>>print p1.shortcut >>> bla Thanks!