Skip to content

Commit

Permalink
New view relation selector for class based session views
Browse files Browse the repository at this point in the history
  • Loading branch information
joamag committed Apr 15, 2019
1 parent 1610577 commit 75de8e0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/appier_extras/parts/admin/models/base.py
Expand Up @@ -42,6 +42,7 @@
import time
import random
import string
import inspect
import hashlib
import logging
import datetime
Expand Down Expand Up @@ -325,6 +326,8 @@ def apply_views(cls, object, owner = None):
if appier.legacy.is_str(view):
view_cls = owner.get_model(view)
view = view_cls.view_r
is_class = inspect.isclass(view)
if is_class: view = view.view_r
is_callable = hasattr(view, "__call__")
if is_callable: view = view(target = cls, owner = owner)
object.update(view)
Expand Down

0 comments on commit 75de8e0

Please sign in to comment.