mirror of
https://github.com/SpiceBot/SpiceBot.git
synced 2026-11-13 06:59:53 -05:00
more filtering test
This commit is contained in:
parent
b402287cb1
commit
64e5dbcfd3
@ -27,9 +27,9 @@ class PluginValues(BASE):
|
|||||||
"""
|
"""
|
||||||
__tablename__ = 'plugin_values'
|
__tablename__ = 'plugin_values'
|
||||||
plugin = Column(String(255), primary_key=True)
|
plugin = Column(String(255), primary_key=True)
|
||||||
key = Column(String(255), primary_key=True)
|
category = Column(String(255), primary_key=True)
|
||||||
|
key = Column(String(255))
|
||||||
value = Column(String(255))
|
value = Column(String(255))
|
||||||
category = Column(String(255))
|
|
||||||
|
|
||||||
|
|
||||||
class SpiceDB(object):
|
class SpiceDB(object):
|
||||||
@ -225,7 +225,7 @@ class SpiceDB(object):
|
|||||||
try:
|
try:
|
||||||
result = session.query(PluginValues) \
|
result = session.query(PluginValues) \
|
||||||
.filter(PluginValues.plugin == plugin)\
|
.filter(PluginValues.plugin == plugin)\
|
||||||
.filter_by(category=category) \
|
.filter(PluginValues.category == category)\
|
||||||
.filter(PluginValues.key == key) \
|
.filter(PluginValues.key == key) \
|
||||||
.one_or_none()
|
.one_or_none()
|
||||||
# PluginValues exists, update
|
# PluginValues exists, update
|
||||||
@ -250,7 +250,7 @@ class SpiceDB(object):
|
|||||||
try:
|
try:
|
||||||
result = session.query(PluginValues) \
|
result = session.query(PluginValues) \
|
||||||
.filter(PluginValues.plugin == plugin)\
|
.filter(PluginValues.plugin == plugin)\
|
||||||
.filter_by(category=category) \
|
.filter(PluginValues.category == category)\
|
||||||
.filter(PluginValues.key == key) \
|
.filter(PluginValues.key == key) \
|
||||||
.one_or_none()
|
.one_or_none()
|
||||||
if result is not None:
|
if result is not None:
|
||||||
@ -269,7 +269,7 @@ class SpiceDB(object):
|
|||||||
try:
|
try:
|
||||||
result = session.query(PluginValues) \
|
result = session.query(PluginValues) \
|
||||||
.filter(PluginValues.plugin == plugin)\
|
.filter(PluginValues.plugin == plugin)\
|
||||||
.filter_by(category=category) \
|
.filter(PluginValues.category == category)\
|
||||||
.filter(PluginValues.key == key) \
|
.filter(PluginValues.key == key) \
|
||||||
.one_or_none()
|
.one_or_none()
|
||||||
# PluginValues exists, delete
|
# PluginValues exists, delete
|
||||||
@ -290,7 +290,7 @@ class SpiceDB(object):
|
|||||||
try:
|
try:
|
||||||
result = session.query(PluginValues) \
|
result = session.query(PluginValues) \
|
||||||
.filter(PluginValues.plugin == plugin)\
|
.filter(PluginValues.plugin == plugin)\
|
||||||
.filter_by(category=category) \
|
.filter(PluginValues.category == category)\
|
||||||
.filter(PluginValues.key == key) \
|
.filter(PluginValues.key == key) \
|
||||||
.one_or_none()
|
.one_or_none()
|
||||||
# ChannelValue exists, update
|
# ChannelValue exists, update
|
||||||
@ -318,7 +318,7 @@ class SpiceDB(object):
|
|||||||
try:
|
try:
|
||||||
result = session.query(PluginValues) \
|
result = session.query(PluginValues) \
|
||||||
.filter(PluginValues.plugin == plugin)\
|
.filter(PluginValues.plugin == plugin)\
|
||||||
.filter_by(category=category) \
|
.filter(PluginValues.category == category)\
|
||||||
.filter(PluginValues.key == key) \
|
.filter(PluginValues.key == key) \
|
||||||
.one_or_none()
|
.one_or_none()
|
||||||
# ChannelValue exists, update
|
# ChannelValue exists, update
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user