<commit_before>#!/usr/bin/env python
# encoding: utf-8


class Table(object):

    def config_db(self, pkg):
        tbl = pkg.table('card', pkey='id', name_long='!!Card',
                        name_plural='!!Cards', caption_field='name')
        self.sysFields(tbl)

        tbl.column('name', name_short='Name',
                   validate_notnull=True, validate_case='c',
                   validate_notnull_error='!!Mandatory field')

        tbl.column('description', name_long='!!Description')
        tbl.column('position', dtype='I', name_long='!!Position')

        tbl.column(
            'list_id', size='22', group='_',
            name_long='!!list id'
            ).relation(
                'list.id', relation_name='card_list',
                mode='foreignkey', onDelete='cascade'
            )

        tbl.column(
            'owner_user_id', size='22', group='_',
            name_long='!!Owner'
            ).relation(
                'adm.user.id', relation_name='card_user',
                mode='foreignkey', onDelete='cascade'
            )
        tbl.aliasColumn('username', relation_path='@owner_user_id.username',
                        name_long='!!Username')<commit_msg>Add usefull alisa column to card model<commit_after>#!/usr/bin/env python
# encoding: utf-8


class Table(object):

    def config_db(self, pkg):
        tbl = pkg.table('card', pkey='id', name_long='!!Card',
                        name_plural='!!Cards', caption_field='name')
        self.sysFields(tbl)

        tbl.column('name', name_short='Name',
                   validate_notnull=True, validate_case='c',
                   validate_notnull_error='!!Mandatory field')

        tbl.column('description', name_long='!!Description')
        tbl.column('position', dtype='I', name_long='!!Position')

        tbl.column(
            'list_id', size='22', group='_',
            name_long='!!list id'
            ).relation(
                'list.id', relation_name='card_list',
                mode='foreignkey', onDelete='cascade'
            )

        tbl.column(
            'owner_user_id', size='22', group='_',
            name_long='!!Owner'
            ).relation(
                'adm.user.id', relation_name='card_user',
                mode='foreignkey', onDelete='cascade'
            )
        tbl.aliasColumn('username', relation_path='@owner_user_id.username',
                        name_long='!!Username')
        tbl.aliasColumn('list_name', relation_path='@list_id.name',
                        name_long='!!List Name')
        tbl.aliasColumn('list_board_id', relation_path='@list_id.board_id',
                        name_long='!!List Board id')
{'fraction_non_alphanumeric': 0.1515490854796566, 'fraction_numerical': 0.003732736095558044, 'mean_word_length': 2.0804597701149423, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3921669', 'n_tokens_mistral': 812, 'n_tokens_neox': 748, 'n_words': 116}