(self, obj: TableGroup)
| 119 | return obj |
| 120 | |
| 121 | def add_table_group(self, obj: TableGroup) -> TableGroup: |
| 122 | if obj in self.table_groups: |
| 123 | raise DatabaseValidationError(f'{obj} is already in the database.') |
| 124 | for table_group in self.table_groups: |
| 125 | if table_group.name == obj.name: |
| 126 | raise DatabaseValidationError(f'TableGroup {obj.name} is already in the database.') |
| 127 | |
| 128 | self._set_database(obj) |
| 129 | self.table_groups.append(obj) |
| 130 | return obj |
| 131 | |
| 132 | def add_project(self, obj: Project) -> Project: |
| 133 | if self.project: |