from zope.interface import Interface
from zope import schema
from sparc.event import IEvent

from sparc.db import MessageFactory as _

#DB Query String
class IQuery(Interface):
    """A database query"""
    query = schema.Text(
            title=_(u"A query to find events"),
            description=(u"Identifies the network address of the impacted host"),
            required = True
            )

#DB Query Results
class IQueryResultSet(IQuery):
    """A database query with results"""
    def __iter__():
        """Iterator of IResult objects"""

class IResult(Interface):
    """A single database query result (i.e. a row)"""

class ITableResult(IResult):
    """A single database query result represented as a Python dictionary whose
    key values are instances of ITableResultMultiValue or ITableResultValue

    Sample implementation:
        >>> from zope.interface import implements
        >>> class MyColumnarResult(dict):
        ...     implements(IColumnarResult)
    """

#DB Query Result Values
class ITableResultValue(Interface):
    """A value from a database query result (i.e. a table cell)"""
    def __unicode__():
        """Return unicode string representation of value"""

class ITableResultMultiValue(Interface):
    """A value for a ITableResult key that allows for multi-value fields"""
    def __iter__():
        """Iterator of unicode capable values"""

#DB Query Event
class IQueryEvent(IEvent, IQueryResultSet):
    """A point-in-time executed query with results"""

@@ -634,26 +634,28 @@
 %0A%0Aclass ITab
-le
+ular
 Result(IResu
@@ -770,26 +770,28 @@
 nces of ITab
-le
+ular
 ResultMultiV
@@ -798,26 +798,28 @@
 alue or ITab
-le
+ular
 ResultValue%0A
@@ -1021,26 +1021,28 @@
 s%0Aclass ITab
-le
+ular
 ResultValue(
@@ -1210,26 +1210,28 @@
 %0A%0Aclass ITab
-le
+ular
 ResultMultiV
@@ -1272,18 +1272,20 @@
 r a ITab
-le
+ular
 Result k

update interface names to match Tabular instead of Table