<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>gothedistance</author_name>
  <author_url>https://blog.hatena.ne.jp/gothedistance/</author_url>
  <blog_title>Life is Really Short, Have Your Life!!</blog_title>
  <blog_url>https://aroundthedistance.hatenadiary.jp/</blog_url>
  <categories>
    <anon>Python</anon>
  </categories>
  <description>難しいことはありませんでした。以下はMySQLのtruncateという切り捨ての関数を使う例です。 rs = Item.query.\ filter(Item.maker_id == param['maker_id']).\ filter(func.truncate(Item.gedai / Item.price, 1) &lt; 0.6).all() SQLAlchemyのfuncオブジェクトは空気が読めるナイスガイなので、funcの後にDB関数名をそのまま書いて実行することが出来ます。上記の例ですと、「truncate(items.gedai / items.price, %s) SQLに変換さ…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Faroundthedistance.hatenadiary.jp%2Fentry%2F2016%2F03%2F29%2F114826&quot; title=&quot;SQLAlchemyでDB固有の関数を実行する - Life is Really Short, Have Your Life!!&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2016-03-29 11:48:26</published>
  <title>SQLAlchemyでDB固有の関数を実行する</title>
  <type>rich</type>
  <url>https://aroundthedistance.hatenadiary.jp/entry/2016/03/29/114826</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
