def model(self):

        T = current.T
        db = current.db

        configure = self.configure
        define_table = self.define_table
        set_method = self.set_method

        # ---------------------------------------------------------------------
        # Twitter Search Query
        #
        tablename = "msg_twitter_search"
        define_table(tablename,
                     Field("keywords", "text",
                           label = T("Keywords"),
                           ),
                     # @ToDo: Allow setting a Point & Radius for filtering by geocode
                     #self.gis_location_id(),
                     Field("lang",
                           # Set in controller
                           #default = current.response.s3.language,
                           label = T("Language"),
                           ),
                     Field("count", "integer",
                           default = 100,
                           label = T("# Results per query"),
                           ),
                     Field("include_entities", "boolean",
                           default = False,
                           label = T("Include Entity Information?"),
                           represent = s3_yes_no_represent,
                           comment = DIV(_class="tooltip",
                                         _title="%s|%s" % (T("Entity Information"),
                                                           T("This is required if analyzing with KeyGraph."))),
                           ),
                     # @ToDo: Rename or even move to Component Table
                     Field("is_processed", "boolean",
                           default = False,
                           label = T("Processed with KeyGraph?"),
                           represent = s3_yes_no_represent,
                           ),
                     Field("is_searched", "boolean",
                           default = False,
                           label = T("Searched?"),
                           represent = s3_yes_no_represent,
                           ),
                     *s3_meta_fields())

        configure(tablename,
                  list_fields = ["keywords",
                                 "lang",
                                 "count",
                                 #"include_entities",
                                 ],
                  )

        # Reusable Query ID
        represent = S3Represent(lookup=tablename, fields=["keywords"])
        search_id = S3ReusableField("search_id", tablename % "reference %s",
                    label = T("Search Query"),
                    ondelete = "CASCADE",
                    represent = represent,
                    requires = IS_EMPTY_OR(
                                IS_ONE_OF_EMPTY(db, "msg_twitter_search.id")
                                ),
                    )

        set_method("msg", "twitter_search",
                   method = "poll",
                   action = self.twitter_search_poll)

        set_method("msg", "twitter_search",
                   method = "keygraph",
                   action = self.twitter_keygraph)

        set_method("msg", "twitter_result",
                   method = "timeline",
                   action = self.twitter_timeline)

        # ---------------------------------------------------------------------
        # Twitter Search Results
        #
        # @ToDo: Store the places mentioned in the Tweet as linked Locations
        #
        tablename = "msg_twitter_result"
        define_table(tablename,
                     # Instance
                     self.super_link("message_id", "msg_message"),
                     # Just present for Super Entity
                     #self.msg_channel_id(),
                     search_id(),
                     s3_datetime(default="now",
                                 label = T("Tweeted on"),
                                 ),
                     Field("tweet_id",
                           label = T("Tweet ID")),
                     Field("lang",
                           label = T("Language")),
                     Field("from_address",
                           label = T("Tweeted by")),
                     Field("body",
                           label = T("Tweet")),
                     # @ToDo: Populate from Parser
                     #Field("category",
                     #      writable = False,
                     #      label = T("Category"),
                     #      ),
                     #Field("priority", "integer",
                     #      writable = False,
                     #      label = T("Priority"),
                     #      ),
                     self.gis_location_id(),
                     # Just present for Super Entity
                     #Field("inbound", "boolean",
                     #      default = True,
                     #      readable = False,
                     #      writable = False,
                     #      ),
                     *s3_meta_fields())

        configure(tablename,
                  list_fields = [#"category",
                                 #"priority",
                                 "body",
                                 "from_address",
                                 "date",
                                 "location_id",
                                 ],
                  #orderby=~table.priority,
                  super_entity = "msg_message",
                  )

        # ---------------------------------------------------------------------
        return {}

    # -----------------------------------------------------------------------------
dataset/ETHPy150Open sahana/eden/modules/s3db/msg.py/S3TwitterSearchModel.model/swapped operands of `%`