dodotable.schema — table schema

class dodotable.schema.Cell(col, row, data, _repr=<class 'str'>, classes=())

테이블의 셀을 나타내는 클래스

Parameters:
  • col (int) – column 위치
  • row (int) – row 위치
  • data – 셀에 채워질 데이터
class dodotable.schema.Column(label, attr, order_by=(), filters=None, _repr=<class 'str'>, sortable=True, visible=True, classes=())

테이블의 열을 나타내는 클래스

Parameters:
  • label (str) – 컬럼 레이블
  • attr (str) – 가져올 attribute 이름
  • order_by (list) – 정렬 기준
  • filters (list) – 정렬 기준
  • _repr (function) – 보여질 형식
  • sortable (bool) – 정렬 가능 여부
  • visible (bool) – 테이블에 해당 칼럼이 보일지 말지의 여부. 해당 값이 False여도 :class:`~dodotable.condition.IlikeSet`의 필터에는 보이므로 검색에는 사용할 수 있습니다.
class dodotable.schema.LinkedColumn(*args, **kwargs)

링크가 걸려야 하는 열 나타내는 클래스

Parameters:
  • label (str) – 컬럼 레이블
  • attr (str) – 가져올 attribute 이름
  • or function endpoint (str) – 걸릴 링크 형식
  • order_by (list) – 정렬 기준
class dodotable.schema.ObjectColumn(label, attr, order_by=(), filters=None, _repr=<class 'str'>, sortable=True, visible=True, classes=())

Get __cell_.data as result instead of attribute.

class dodotable.schema.Queryable

Query 로 변환 가능한 객체

쿼리를 내뱉는 모든 필더들은 Queryable 을 상속받고 __query__() 를 구현하여 sqlalchemy 쿼리로 사용할 수 있도록 변환해야합니다.

class dodotable.schema.Renderable

jinja에서 바로 렌더링되는 클래스의 상위 클래스

jinja에서는 __html__ 를 호출하여 렌더링을 하므로 Renderable 을 상속받아 __html__() 을 구현하는 경우 바로 렌더링 할 수 있습니다.

class SomeElem(Renderable):

    def __html__(self):
         return "<h1>Hello World</h1>"
{{ SomeElem() }} <!-- == <h1>Hello World</h1> -->
class dodotable.schema.Row

테이블에 행을 나타내는 클래스

append(cell)

행에 cell을 붙입니다.

class dodotable.schema.Table(cls, label, unit_label='row', columns=None, sqlalchemy_session=None)

데이터를 나타내는 테이블의 틀

Parameters:
  • cls
  • label
  • columns
  • sqlalchemy_session
query

쿼리를 만듭니다.

Returns:
class dodotable.schema.Schema
Parameters:environment (Environment) –