BEast
Alexander
Sure, we need to fix it
Rozen
questiong!
Rozen
can i have a function defined inside a class that extends from db.Entity?
Rozen
(that uses the database)
Alexander
It is possible to have a method defined inside an entity subclass, but right now it is not possible to use such functions in queries. We plan to fix it
Rozen
it has any sense if..
Rozen
i have a class that has an attribute with defaultvalue 0
Rozen
but i want a class extending the first class
Rozen
with that defaultvalue to be .... 5
Rozen
?
Rozen
i know databases can have asigned default values
Rozen
i change my question
Rozen
there is a way to overload __init__ so i can change one of the defaults values of one of the values with default with another value?
stsouko
def __init__(self, data):
*magic*
super(Entity, self).__init__(attr1=x, attr2=y)
Rozen
thanks :D
Micaiah
https://stateofprogress.blog/choose-sql-d017cfc08870#.tx8i11op2
An article on SQL vs NoSQL that references Pony
Anonymous
welp that was dumb of me. I figured it out. I had default=uuid.uuid4() in my entity definitions but couldn't figure out why it was not creating new UUIDs for each time I created a new object
Anonymous
it's been too long of a day :P
Cristian
Hi i am looking for a ORM to work with sqlite just in readonly mode, i have an existing sqlite db so i want to query it... i see generate_mapping(), i want to know if this will pool and not create tables ?
Micaiah
Cristian
@micaiahparker but dont create tables w/ False?
stsouko
Alexander
By default generate_mapping just check that all necessary tables present in the database and have all necessary columns (without checking column types, etc.)
Pony does not support reflexion from the database yet, so you need to define entities as a Python classes. If you want to have entity/attribute name which differs from corresponding table/column name, you can set table/column name explicitly
Alexander
stsouko
Is it possible to use callable? Good
Lucky
Serge
https://m.facebook.com/story.php?story_fbid=1431212776900553&id=100000355343616
Serge
Sorry for Russian. Hope Facebook will be able to translate it correctly
BEast
Serge
This is hard to translate in any way
Romet
i know enough russian to understand the wordplay, but almost nothing else in that post 😄
Serge
Hmm it looks like the things were more complicated than that, I need to delete this
Alexander
ok ) It was so long ago that nobody remember all the details already )
Serge
Alexander
Sure! :)
Anonymous
Hi guys, I just heard about Pony ORM a few minutes ago.
Can anyone tell me how does it compare to SQLAlchemy?
Thanks!
Micaiah
Anonymous
Thanks for the reply, can you elaborate on "More Pythonic" if you don't mind :)
Micaiah
Sure!
Micaiah
It takes better advantage of Python features like comprehensions, decorators, and with as part of its core API, whereas SQLalchemy is a straight forward C++ styled API, such as PyQt
Micaiah
(plus it has a really cool editor on the website)
Anonymous
Thanks again! I will check that editor
Micaiah
Np
Lucky
Micaiah
I just copy/paste
Anonymous
How is the developement? is it active?
Micaiah
Quite
Anonymous
I see on github that kozlovsky is the only major contributor
Anonymous
I like the idea, I wish it gains more popularity for more active developement
Micaiah
@akozlovsky gets work done haha
Anonymous
@akozlovsky 👏
Anonymous
So, I am still new to Python, is there a specific part that I should learn to make Pony easier for me?
I know some basics on decorators, map, sum and some other functional programming concepts, but I feel like I need to learn more.
Does Pony require a strong functional programming knowledge or will I be fine with just the basics of Python?
Alan
For me, understanding list comprehension was that biggest benefit for pony
Alan
Because queries become so much simpler
Micaiah
Anonymous
Yeah, list comprehensions are awesome!
Lucky
Aye
Rozen
Questiong!
Rozen
if i have ... lets say class A(db.Entity) , Class B(A) and Class C(A), there would be a way to when loaded any of them as A, to know if it's really A B or C?
Micaiah
Look up the python docs for isinstance
Micaiah
Basically
class A(db.Entity):
thing = Required(str)
class B(A):
pass
class C(A):
pass
>>> b = B(thing='thing')
>>> isinstance(b, B)
True
>>> isinstance(b, C)
False
>>> isinstance(A(thing='thing'), C)
False
Lucky
Hey, I have a diagram made on the online editor,
Now I have invoted someone else.
How can he edit stuff?
The "save a copy" button says it doesn't work for free users?
Lucky
But he has no normal "save" button
Lucky
So, what is the purpose off sharing diagrams with users?
Lucky
He can't do anything
Lucky
Or do I need to toggle edit rights for him somewhere?
Lucky
For reference: https://editor.ponyorm.com/user/luckydonald/pbft
Romet
by the way, I know this is probably unimportant but the english text on pony's website is very.. foreign
Romet
is there a way to contribute? as in, suggest changes?
Romet
example: Here is Pony query example: vs Here is an example of a Pony query:
Alexey
hey @luckydonald
currently there is no way for someone else to edit the diagram, the person that you invite can see it in read-only mode
we developed the editor for our internal needs and opened it to public in order to see if it will be useful for someone else
when we found that it actually got traction, we decided to add some other features into it. The work is almost done, we have been adding the following features:
- abiltiy to download a Pony project as a zip file, with models, settings, mixins files in it
- teams - an ability for more than one person to work on a diagram
- ability to assign tag names to diagram snapshots
- Django tab - an ability to get Django project from a diagram
- reflection - an abiltity to build a diagram based on a Pony or Django project
Alexey
also we've replaced knockout.js with Mobx and ReactJS
we tried to use Redux+ReactJS, and found that it is not easy
then we moved to Mobx and never looked back
Romet
Huh.. Mobx doesn't look much easier than Redux
Lucky
Oh, that's great,
Do you need beta testers?
Alexey
I think that we deploy the new interface in beta mode in April-May
Alexey