The Tables Editor is where database schemas come to life — visually. Instead of writing Django model classes by hand, you define fields, relationships, and metadata through a form-based interface. Pytigon generates the model code, creates migrations, and updates the database automatically.
The Tables Editor supports all standard Django field types:
| Field Type | Django Equivalent | Typical Use |
|---|---|---|
| String | CharField |
Short text, up to 255 characters |
| Text | TextField |
Long-form content, descriptions |
| Integer | IntegerField |
Whole numbers |
| Float | FloatField |
Decimal numbers |
| Boolean | BooleanField |
True/false flags |
| Date | DateField |
Calendar dates |
| DateTime | DateTimeField |
Timestamps |
| File | FileField |
Uploaded files |
| Image | ImageField |
Uploaded images |
| Choice | CharField with choices |
Dropdown selections |
| ForeignKey | ForeignKey |
Relationship to another table |
| JSON | JSONField |
Structured data (Pytigon extended) |
Each field can be configured with:
Pytigon adds a jsondata JSON field to every model automatically. This field stores:
You can define fields that are stored inside jsondata rather than as separate database columns. These "virtual" columns behave like regular fields in forms and tables but live in the JSON blob.
For a simple Album table with fields name, artist, and release_date, the Tables Editor generates:
class Album(JSONModel):
name = models.CharField("Name", max_length=128)
artist = models.CharField("Artist", max_length=128)
release_date = models.DateField("Release date", null=True, blank=True)
class Meta:
verbose_name = "Album"
verbose_name_plural = "Albums"
Define a ForeignKey field pointing to another table. Pytigon automatically:
- Creates the database foreign key constraint
- Generates dropdown selectors in forms
- Provides "drill-down" navigation in list views
- Supports on_delete behavior configuration
For relationships that aren't enforced at the database level, Pytigon provides row_related_list — a template-level relationship that links tables through a filter function rather than a SQL foreign key. See the detailed documentation in Relationships between components.
When you save changes in the Tables Editor:
In development mode, this all happens seamlessly — no terminal commands needed.