@factory.lazy_attribute
    def election_id(self):
        datestr = self.start_date.strftime("%Y-%m-%d")
        return "%s-%s-%s" % (self.state.lower(), datestr, self.election_type)
dataset/ETHPy150Open openelections/openelections-core/openelex/tests/factories.py/ContestFactory.election_id/original