def model(self):

        T = current.T
        db = current.db

        crud_strings = current.response.s3.crud_strings

        define_table = self.define_table

        # =====================================================================
        # Data Collection
        #
        tablename = "dc_collection"
        define_table(tablename,
                     self.super_link("doc_id", "doc_entity"),
                     self.dc_template_id(),
                     s3_date(default = "now"),
                     self.gis_location_id(),
                     self.org_organisation_id(),
                     self.pr_person_id(
                        default = current.auth.s3_logged_in_person(),
                     ),
                     s3_comments(),
                     *s3_meta_fields())

        # Configuration
        self.configure(tablename,
                       super_entity = "doc_entity",
                       orderby = "dc_collection.date desc",
                       )

        # Components
        self.add_components(tablename,
                            dc_answer = "collection_id",
                            )

        # CRUD strings
        crud_strings[tablename] = Storage(
            label_create = T("Create Data Collection"),
            title_display = T("Data Collection Details"),
            title_list = T("Data Collections"),
            title_update = T("Edit Data Collection"),
            title_upload = T("Import Data Collections"),
            label_list_button = T("List Data Collections"),
            label_delete_button = T("Delete Data Collection"),
            msg_record_created = T("Data Collection added"),
            msg_record_modified = T("Data Collection updated"),
            msg_record_deleted = T("Data Collection deleted"),
            msg_list_empty = T("No Data Collections currently registered"))

        # @todo: representation including template name, location and date
        #        (not currently required since always hidden)
        represent = S3Represent(lookup=tablename,
                                fields=["date"],
                                )

        # Reusable field
        collection_id = S3ReusableField("collection_id", tablename % "reference %s",
                                        label = T("Data Collection"),
                                        represent = represent,
                                        requires = IS_ONE_OF(db, "dc_collection.id",
                                                             represent,
                                                             ),
                                        comment = S3PopupLink(f="collection",
                                                              tooltip=T("Add a new data collection"),
                                                              ),
                                        )

        # =====================================================================
        # Data Collection Answer
        #
        tablename = "dc_answer"
        define_table(tablename,
                     collection_id(),
                     self.dc_question_id(),
                     Field("answer", "json",
                           requires = IS_EMPTY_OR(IS_JSON()),
                           # @todo: representation? (based the question model)
                           # @todo: widget? (based the question model)
                           ),
                     s3_comments(),
                     *s3_meta_fields())

        # CRUD strings
        crud_strings[tablename] = Storage(
            label_create = T("Create Answer"),
            title_display = T("Answer Details"),
            title_list = T("Answers"),
            title_update = T("Edit Answer"),
            title_upload = T("Import Answers"),
            label_list_button = T("List Answers"),
            label_delete_button = T("Delete Answer"),
            msg_record_created = T("Answer added"),
            msg_record_modified = T("Answer updated"),
            msg_record_deleted = T("Answer deleted"),
            msg_list_empty = T("No Answers currently registered"))

        # =====================================================================
        # Pass names back to global scope (s3.*)
        return dict(dc_collection_id = collection_id,
                    )

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