from codenerix.forms import GenForm
class NameForm(GenForm):
    class Meta:
        exclude = []
    @staticmethod
    def __groups__(self):
        return [
            (
                _(u'groupName'), 12,
                ['attr1', 6],
                ['attr2', 6],
                ['attr3', 6],
            )
        ]
GenForm is a Codenerix generic class used to define a custom form. This class inherits from Django class forms.Form.
Warning
GenForm inherits from forms.Form, so attributes declaration is a little different than in other classes. In GenForm all attributes are put into class Meta:
Autofill is an attribute designed to fill foreignkey attributes with data based in a textbox, other information of the form or an AngularJS function. The structure is a dictionary with the attribute name as key and a list as value. This list consists in the following ordered fields:
Optionals fields) The rest of fields are filters used to send the pk of a the selected attribute. Usually is used to take the value of an attribute and perform the search using it. There is two options to use this filters:autofill = {
    # Search of attr3 based in attr2
    'attr3': ['select', 3, related_name_foreignkey_url,'attr2'],
    # Search based in his own pk.
    'attr5': ['select', 3, related_name_foreignkey_url,'__pk__'],
    # Search based in his own pk and attr2.
    'attr4': ['select', 3, related_name_foreignkey_url,'__pk__', 'attr2'],
}
This method is used to define the order and layout of the form fields. Its goal is to be used as an styling tool for the forms.
def __groups__(self):
    groups = [
        (
            _('Group name'), 12,
            ['attr1', 6, '#23fe33', '#005476', 'left', True, _('Alternative label')],
            ['attr2', 6, None, None, True],
            ['attr3', 3],
            ['attr4', 12, None, None, None, None, None, ['ng-change=function()']],
        )
    ]
    return groups
Groups return a list of tuples. Each tuple represent in template a different box. Each tuple have next structure:
Name of the box.
Number of columns which the box takes. Remember: max númber of columns it's 12
from codenerix.forms import GenForm
class NameForm(GenForm):
    class Meta:
        exclude = []
    def __groups__(self):
        return [
            (
                _(u'groupName'), 12,
                ['attr1', 6],
                ['attr2', 6],
                ['attr3', 6],
            )
        ]
    @staticmethod
    def __groups_details__():
        return [
            (
                _(u'groupName'), 12,
                ['attr1', 6],
                ['attr2', 6],
                ['attr3', 6],
            )
        ]
from codenerix.forms import GenForm
class NameForm(GenForm):
    class Meta:
        # attr3 is a foreignkey field, and start to search with 3 characters with condition epecified in view of related name.
        autofill = {
            'attr3': ['select', 3, related_name_foreignkey_url, 'attr2'],
        }
    def __groups__(self):
        return [
            (
                _(u'nameGroup'), 12,
                ['attr1', 6, '#23fe33', '#005476', 'left', True, _('Alternative label')],
                ['attr2', 6, None, None, True],
                ['attr3', 3],
                ['attr4', 12, None, None, None, None, None, ['ng-change=function()']],
            )
        ]
    @staticmethod
    def __groups_details__():
        return [
            (
                _(u'nameGroup'), 12,
                ['attr1', 6],
                ['attr2', 6],
                ['attr3', 6],
            )
        ]