parent
10dff6e266
commit
86eb8992cd
8
gui.py
8
gui.py
|
@ -1,6 +1,7 @@
|
|||
from django_coreprotect.models import CoWorld, GUIResult
|
||||
from django_coreprotect.utils import safe_int, checkbox
|
||||
from datetime import datetime
|
||||
from django.db import connection
|
||||
|
||||
|
||||
class GUIForm:
|
||||
|
@ -173,8 +174,11 @@ def gui_results(form):
|
|||
|
||||
# Chest Use
|
||||
if form.chest_use:
|
||||
concat = 'CONCAT(cc.amount, " ", cmm.material)'
|
||||
if connection.vendor == "sqlite":
|
||||
concat = 'cc.amount || " " || cmm.material'
|
||||
queries.append('''SELECT
|
||||
0 AS id, "container" AS type, cc.time AS unix, cu.user AS player, cc.action, cc.amount || " " || cmm.material AS data, cc.x, cc.y, cc.z, cw.world
|
||||
0 AS id, "container" AS type, cc.time AS unix, cu.user AS player, cc.action, {concat} AS data, cc.x, cc.y, cc.z, cw.world
|
||||
FROM co_container cc
|
||||
JOIN co_user cu ON cc.user = cu.rowid
|
||||
JOIN co_material_map cmm ON cc.type = cmm.rowid
|
||||
|
@ -185,7 +189,7 @@ def gui_results(form):
|
|||
{coords}
|
||||
{blocks}
|
||||
{time}
|
||||
'''.format(worlds=worlds_clause, players=players_clause, coords=coords_clause, blocks=blocks_clause, time=time_clause))
|
||||
'''.format(concat=concat, worlds=worlds_clause, players=players_clause, coords=coords_clause, blocks=blocks_clause, time=time_clause))
|
||||
|
||||
# Commands
|
||||
if form.command:
|
||||
|
|
Loading…
Reference in New Issue