def import_subjects(self, force):
        """
        Create subject models out of the configuration.

        @param force: Should the Subject settings be written if the model already exist?
        @returns: A flag indicating if the import was successful.
        """
        subjs = self.store.filter_subjects()
        for subj in subjs:
            if subj.attrib in 'aliasfor':
                continue

            attributes = {
                'name': subj.get('id').lower()[:50],
                'is_displayed': subj.get('displayed')=='true',
                'sort_key': subj.get('sortkey')
            }
                
            obj, created, changed, message = check_and_update(Subject, overwrite=force, **attributes)

            for locale in [l[0] for l in settings.LANGUAGES]:
                po = self.poutils[locale]
                po.add_or_update(
                    msgid=u'%s short label' % attributes['name'],
                    msgstr=subj.get('short_name') or '',
                    occurs=[(os.path.abspath(self.store.datafile), subj.sourceline,)]
                )
                po.add_or_update(
                    msgid=u'%s label' % attributes['name'],
                    msgstr=subj.get('name') or '',
                    occurs=[(os.path.abspath(self.store.datafile), subj.sourceline,)]
                )
                po.add_or_update(
                    msgid=u'%s long description' % attributes['name'],
                    msgstr='',
                    occurs=[(os.path.abspath(self.store.datafile), subj.sourceline,)]
                )

            if changed and not force:
                logger.info(message)
            else:
                logger.debug(message)

        for subj in subjs:
            numerator_name = name=subj.get('id').lower()[:50]
            try:
                numerator = Subject.objects.get(name=numerator_name)
            except Exception, ex:
                logger.info('Subject "%s" was not found.', numerator_name)
                raise

            denominator = None
            denominator_name = subj.get('percentage_denominator')
            if denominator_name:
                denominator_name = denominator_name.lower()[:50]
                try:
                    denominator = Subject.objects.get(name=denominator_name)
                except Exception, ex:
                    logger.info('Subject "%s" was not found.', denominator_name)
                    raise

            numerator.percentage_denominator = denominator
            numerator.save()

            logger.debug('Set denominator on "%s" to "%s"', numerator.name, denominator_name)

        return True
dataset/ETHPy150Open PublicMapping/DistrictBuilder/django/publicmapping/redistricting/config.py/ConfigImporter.import_subjects/swapped operands of `in`