<div dir="ltr">Hi Chris!<br><div class="gmail_extra"><br></div><div class="gmail_extra">This behavior is "by design". The LongStr type is intended for very long strings, such as the description of a product or the content of an article. We typically don't want to load such an attribute each time the object itself is loaded. Hence, LongStr attributes marked as "lazy" by default.<br><br></div><div class="gmail_extra">The `show()` method of the query result does not display lazy attributes. Firstly, because such attributes are not loaded by default, and we don't want to send additional queries. And secondly, because the content of such attribute can be really large for displaying inside formatted table cell.<br></div><div class="gmail_extra"><br></div><div class="gmail_extra">If you truly want to display such an attribute, you have several options:<br><br></div><div class="gmail_extra">1) You can use `str` type instead of `LongStr` if the content of the attribute is not really large.<br></div><div class="gmail_extra"><br></div><div class="gmail_extra">2) You can mark attribute as a non-lazy, if you want to load it with the typical query:<br><br></div><div class="gmail_extra"> attr1 = Required(LongStr, lazy=False)<br><br></div><div class="gmail_extra">Currently it is not possible to force the query to load lazy attributes along with the normal attributes. In the future we plan to add the way to explicitly load some lazy attributes with the query. After that the `show()` method probably should display such attributes along with the other attributes.<br></div><div class="gmail_extra"><br></div><div class="gmail_extra">Regards,<br></div><div class="gmail_extra">Alexander Kozlovsky<br><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Dec 10, 2014 at 10:56 PM, Chris Wood <span dir="ltr"><<a href="mailto:c.c.wood@gmail.com" target="_blank">c.c.wood@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Alexey,<br>
<br>
thanks for the reply; I should have been clearer about when I was<br>
calling show()! I was trying to call it to show what data was in a<br>
table in my database:<br>
<br>
>>> from pony.orm import *<br>
>>> db = Database()<br>
>>> class Entity1(db.Entity):<br>
... attr1 = Required(LongStr)<br>
...<br>
>>> db.bind('sqlite',':memory:')<br>
>>> db.generate_mapping(create_tables=True)<br>
>>> show(E1)<br>
class E1(Entity1):<br>
id = PrimaryKey(int, auto=True)<br>
attr1 = Required(LongStr)<br>
>>> test_data_entry = Entity1(attr1="test!")<br>
>>> data = select(p for p in Entity1)[:]<br>
>>> data.show()<br>
id<br>
--<br>
1<br>
<br>
compared with<br>
<br>
>>> from pony.orm import *<br>
>>> db = Database()<br>
>>> class Entity2(db.Entity):<br>
... attr2 = Required(str)<br>
...<br>
>>> db.bind('sqlite',':memory:')<br>
>>> db.generate_mapping(create_tables=True)<br>
>>> show(Entity2)<br>
class Entity2(Entity):<br>
id = PrimaryKey(int, auto=True)<br>
attr1 = Required(str)<br>
>>> test_data_entry= Entity2(attr2="test!")<br>
>>> data = select(p for p in Entity2)[:]<br>
>>> data.show()<br>
id|attr2<br>
--+-----<br>
1 |test!<br>
<br>
<br>
It seems that the column which is defined as a LongStr isn't<br>
displayed, but one that is displayed as a str is?<br></blockquote></div></div></div>