registry.dbtmako 3.76 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
% if vreg:

<div id="registry-store">
    <div class="row">
        <div class="col-md-3">
            <nav id="registry-store-categories">
                <ul class="nav nav-pills nav-stacked">
                    % for category in sorted(vreg.keys()):
                    <li role="presentation"><a href="#detail-${category}">${category}</a></li>
                    % endfor
                </ul>
            </nav>
        </div>

        <div class="col-md-9">
            % for category, data in sorted(vreg.items(), key=lambda x: x[0]):
            <div class="anchor">
                <a class="anchor" id="detail-${category}"></a>
                <h4>${category.title()}</h4>
                <table class="table table-bordered table-striped">
                    % for key, values in sorted(data.items(), key=lambda x: x[0]):
                    <tr>
                        <th>${key}</th>
                        <td>
                            <ul>
                                % for value in values:
                                <li>
                                    % if isinstance(value, type):
                                    ${value.__module__}.${value.__name__}
                                    % else:
                                    ${value}
                                    % endif

                                    <ul>
                                        % if hasattr(value, "cw_etype"):
                                        <li>regid: '${value.cw_etype}'</li>
                                        % elif hasattr(value, "__regid__"):
                                        <li>regid: '${value.__regid__}'</li>
                                        % endif

                                        % if hasattr(value, "__select__"):
                                            <li>select: '${value.__select__}'</li>
                                            % if hasattr(value.__select__, "func_name"):
                                            <li>select name: '${value.__select__.func_name}'</li>
                                            % endif
                                            % if hasattr(value.__select__, "score"):
                                            <li>select score: '${value.__select__.score}'</li>
                                            % endif
                                        % endif

                                        <li>registries: ${value.__registries__}</li>

                                        % if hasattr(value, "rest_attr"):
                                        <li>rest_attr: '${value.rest_attr}'</li>
                                        % endif

                                        % if hasattr(value, "fetch_attrs"):
                                        <li>fetch_attrs: '${value.fetch_attrs}'</li>
                                        % endif

                                        % if hasattr(value, "cw_skip_copy_for"):
                                        <li>cw_skip_copy_for: '${value.cw_skip_copy_for}'</li>
                                        % endif

                                        % if hasattr(value, "e_schema"):
                                        <li>e_schema: '${value.e_schema}'</li>
                                        % endif
                                    </ul>
                                </li>
                                % endfor
                            </ul>
                        </td>
                    </tr>
                    % endfor
                </table>
            </div>
            % endfor
        </div>
    </div>
</div>

% else:
<p>No registry store got collected, is it a bug?</p>
% endif

<style>
a.anchor {
    display: block;
    position: relative;
    top: -150px;
    visibility: hidden;
}
</style>