UML2Python – Full code generator for Python Applications

The service has now been discontinued but I’ve released the core source code under an OS license. Read the details here.


The UMLtoPython/Django tool automatically generates full-fledged Python/Django applications from UML class diagrams.

The generated application offers all basic CRUD (Create/Read/Update/Delete) functionalities to show and manipulate the application data (see the examples below). More specifically, the service generates the models.py and admin.py files required by Django in order to automatically generate all the CRUD functionality for the application.

The fully functional generated web application will contain (without writing a single line of Python code!)

  • Forms to create, update and delete objects
  • Pages listing all existing objects. Lists are paginated and sortable
  • Form Validation checks (to guarantee that all mandatory attributes are filled, that the input text can be converted to the expected data type, that foreign keys are respected,…)
  • Easy management of associated objects (e.g. possibility to add a related object during the creation of another one)
  • Flash messages that give immediate feedback to the user
  • Easy customization (e.g. changing the default CSS template)

Instructions


This tool is implemented as a service (SaaS). Simply upload the xmi file storing your UML class diagram, (optionally) indicate configuration parameters for the generation and, you will get as a result the files needed to immediately run your application!. The XMI model is removed after the generation, so you do not need to worry about the confidentiality of your designs

PYTHON/DJANGO CODE GENERATION IN TWO STEPS

Step 1: Provide input UML model
Select the input UML file and indicate the UML tool used to draw that UML model

Step 2: Configure the generation
Indicate the configuration options to be used during the generation process

and just like that, the resulting Django files are ready for download!!

Examples


Let’s see an example OF a Django application generated by this service. Given the following UML model (represented, FOR instance, by this ArgoUML 0.24 XMI file )

Example

the service will generate this ZIP file WITH a model.py AND an admin.py files (results may vary depending ON the configuration options chosen during the generation).

These files can THEN be passed ON TO the Django framework TO generate the FULL CRUD application without writing a single line OF Python code. This application includes ALL the expected functionalities (AS ordering AND filtering options, dropdown boxes FOR relationship fields, adequate UI controls depending ON the field TYPE,…). FOR instance, the NEXT image shows the generated book creation form

As you can see, the form includes INPUT validation checks (e.g. IN this CASE, we entered a wrong VALUE FOR the INTEGER field NUMBER OF pages), support FOR many-TO-many associations (multi-selection OF the book authors), dropdown lists FOR one-TO-many associations (e.g. publishers association) AND INPUT widgets linked TO the field TYPE (e.g. published DATE) among many other things!

Executing the service


Useit for free!!

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Powered by WordPress