def create_forms(self):
        self._info("    Forms  ")
        self._info("===========")

        # Check if forms.py exists
        if path.exists('{0}{1}/forms.py'.format(self.SCAFFOLD_APPS_DIR, self.app)):
            self._info('exists\t{0}{1}/forms.py'.format(self.SCAFFOLD_APPS_DIR, self.app), 1)
        else:
            with open("{0}{1}/forms.py".format(self.SCAFFOLD_APPS_DIR, self.app), 'w') as fp:
                fp.write("from django import forms\n")
            self._info('create\t{0}{1}/forms.py'.format(self.SCAFFOLD_APPS_DIR, self.app), 1)

        # Check if form entry already exists

        with open("{0}{1}/forms.py".format(self.SCAFFOLD_APPS_DIR, self.app), 'r') as fp:
            content = fp.read()
        if "class {0}Form".format(self.model) in content:
            self._info('exists\t{0}{1}/forms.py\t{2}'.format(
                self.SCAFFOLD_APPS_DIR, self.app, self.model.lower()), 1)
        else:
            with open("{0}{1}/forms.py".format(self.SCAFFOLD_APPS_DIR, self.app), 'a') as fp:
                fp.write(FORM_CONTENT % {'app': self.app, 'model': self.model})
            self._info('added\t{0}{1}/forms.py\t{2}'.format(
                self.SCAFFOLD_APPS_DIR, self.app, self.model.lower()), 1)
dataset/ETHPy150Open Tivix/django-common/django_common/scaffold.py/Scaffold.create_forms/original