No description, website, or topics provided.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
isfilled
test
.gitignore
.travis.yml
CHANGELOG.md
MANIFEST.in
README.md
app_test_runner.py
setup.py

README.md

Is Filled Build Status

Create rules for Models and ModelForms filledness.

Models validate while ModelForms present use-cases. Fills give insight on Model/ModelForm fields.

Why?

People are interested in different details. Create rules to accomodate each. Best used together with On Condition to send notifications on fill completions.

Usage

Create a Model, which inherits FillsMixin. If you have a ModelForm, then adding a Fills checks the fields of the Form instead of the Model.

class Employee(models.Model, FillsMixin):
    name = models.CharField(max_length=255)
    expert_in = models.CharField(max_length=255, blank=True, null=True)
    starting_date = models.DateField(blank=True, null=True)
    editor_of_choice = models.CharField(max_length=255, blank=True, null=True)
    github_account = models.CharField(max_length=255, blank=True, null=True)

class EmployeeForm(forms.ModelForm):
    class Meta:
        model = Employee
        exclude = []

class EmployeeSkillsForm(forms.ModelForm):
    class Meta:
        model = Employee
        fields = ['expert_in', 'editor_of_choice',]

class EmployeeFills(Filled):
    form = EmployeeForm

class EmployeeSkillsFills(Filled):
    form = EmployeeSkillsForm

Create Fills against Model:

Fill.objects.create(name="employee-hr",
                     model="test.Employee",)

Fill.objects.create(name="employee-manager-bob",
                     model="test.Employee",
                     fields="starting_date, expert_in",)

Create Fills against ModelForm:

Fill.objects.create(name="employee-hr",
                     fill="test.test_fills.EmployeeFills",)

Fill.objects.create(name="employee-team",
                     fill="test.test_fills.EmployeeSkillsFills",)

Filledness status:

instance = Employee.objects.get(pk=1))
all_fills_filled, contexts = instance.check_fills()