Menu

Home

MySQL Workbench Django Export Module

This is a Module for MySQL Workbench to export a Django model.py.
Please note: The module is tested with MySQL Workbench 5.2.38 (Linux) only!

Installation

Linux

Copy the DjangoExport.grt.lua to your MySQL Workbench Modules folder. Defaults to

~/.mysql/workbench/modules/

Windows

Copy the DjangoExport.grt.lua to your MySQL Workbench Modules folder. Defaults to

C:\Program Files\MySQL\MySQL Workbench X.X OSS\modules\

How to use

After installing the module, start MySQL Workbench and create your model. Then under
Plugins -> Catalog -> Copy Django model.py to Clipboard

and paste the model in your model.py file

Features

Datatypes

The following MySQL Datatypes are supported:

  • INT
  • BIGINT
  • DECIMAL
  • DATETIME
  • DATE
  • TIME
  • TIMESTAMP
  • BOOL
  • TINYINT
  • FLOAT
  • DOUBLE
  • TINYTEXT
  • VARCHAR
  • TEXT
  • MEDIUMTEXT
  • LONGTEXT

Special Fields

  • DATETIME fields named "created_at" got "auto_now_add=True" to set a date automatically on creation.
  • DATETIME fields named "updated_at" got "auto_now=True" to set a date on every update.

Known Bugs / Pitfalls

  • All n:m tables must be named like table1_has_table2 to detect them

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.