Added branch 1.0.
[wolnelektury.git] / apps / djangosphinx / apis / api275 / templates / source-multiple.conf
1 source {{ source_name }}
2 {
3     type                = {{ database_engine }}
4     strip_html          = 0
5     index_html_attrs    =
6     sql_host            = {{ database_host }}
7     sql_user            = {{ database_user }}
8     sql_pass            = {{ database_password }}
9     sql_db              = {{ database_name }}
10     sql_port            = {{ database_port }}
11     log                 = {{ log_file }}
12
13     sql_query_pre       =
14     sql_query_post      =
15     sql_query           = \
16 {% for table_name, content_type in tables %}
17         SELECT {{ field_names|join:", " }}, {{ content_type.id }} as content_type \
18         FROM `{{ table_name }}`{% if not loop.last %} UNION \{% endif %}
19 {% endfor %}
20 {% if group_columns %}
21     # ForeignKey's
22 {% for field_name in group_columns %}    sql_attr_uint       = {{ field_name }}
23 {% endfor %}{% endif %}
24 {% if date_columns %}
25     # DateField's and DateTimeField's
26 {% for field_name in date_columns %}    sql_attr_timestamp   = {{ field_name }}
27 {% endfor %}{% endif %}
28 {% if bool_columns %}
29     # BooleanField's
30 {% for field_name in bool_columns %}    sql_attr_bool        = {{ field_name }}
31 {% endfor %}{% endif %}
32 {% if float_columns %}
33     # FloatField's and DecimalField's
34 {% for field_name in float_columns %}    sql_attr_float       = {{ field_name }}
35 {% endfor %}{% endif %}
36 }