5. Steps to Add new MLS
The scenario for this case describes the addition of a new mls. This is just an overview of the steps that need to happen, it doesn’t go into the details of what attributes to set on each new entry or how to write the model. To know how to set attribute, make sure to check the implementation of existing mlss and follow it.
add the new mls token under the class MLSMixin (pearlcertification/core/mixins/mls.py)
add the new mls token to the MLS_CHOICES dictionary.
Depending on the state the MLS is in, add a new choice to
<state>_CHOICESin the same mixin. By adding the MLS to<state>_CHOICES, it will appear for any RE agent creating a home in that state via PQS/REA.If there is no existing
<state>_CHOICESfor the MLS, create one and then add the corresponding if statement topearlcertification.core.abstract.models.AbstractMls.get_mls_by_stateadd the new mls token to the MLS_NAMES dictionary
create a new package “new_mls” under reports/utils/mls.
create a new package “gfields” under “new_mls” package: It will contains the new mls’s GreenField classes. The classes are grouped by categories, for each category you need to create a new module.
The above are the main steps for adding the new mls package. The rest goes in some details of creating and setting the mls characteristics (GreenField)
before creating a new “GreenField” class, always make sure to check if we have a class similar or have the same logic in reports/utils/mls/common_gfields.
now, after creating the “GreenField” classes we need to create a new module “gfields_categories.py under reports/utils/mls/new_mls.
add, in gfields_categories.py, the new GreenFieldCategory classes.
create, in gfields_categories.py, two new methods get_new_mls_green_fields(home) and get_green_field_categories().
update the “MLS_REPORTS_METHOD” dictionary in the method generate_mls_report under reports/utils/mls/report.py: Add CertificationRequest.NEW_MLS_TOKEN: get_new_mls_green_fields.