Turbogears - bernardopnunes/SoftwareEngineeringSDUW GitHub Wiki

Groups:

  1. The Hateful Eight

Guide

Overview

TurboGears is a great Web site development framework for the Python programming language. It is made up of a number of subprojects that help us bring together many important components to provide an integrated Web development framework for front-end to back-end Web development.

It help developers integrate many major components into a Web framework that provides front-end to back-end Web integration. The code is hosted on Github under the MIT open source license

Design

TurboGears is a great Web site development framework for the Python programming language.

It is made up of a number of subprojects that help us bring together many important components to provide an integrated Web development framework for front-end to back-end Web development.

Turbogears support through ORM

  • SQLite
  • MySQL
  • Postgres
  • Firebird
  • MS SQL Server
  • Oracle

Advantages

  1. Rapid development
  2. ROR mode
  3. Have certain time accumulation and corresponding development tools and modules
  4. Support Ajax, I18N
  5. Less development work
  6. Python language, fast installation and layout

Disadvantages

TurboGears is made up of multiple projects, using multiple licenses. SQLObject (ORM tool) is protected with the LGPL (Lesser General Public License), which means that any direct modifications to SQLObject need to be contributed back to the project. This license does not require applications that use it to be open source. However, some companies will ban lgpl-protected software.

Code Examples

class Category(SQLObject):
    name = StringCol(length=64)
    parent = ForeignKey('Category', default=None)
    subcategories = MultipleJoin('Category', joinColumn='parent_id')
    products = MultipleJoin('Product')
 
class Product(SQLObject):
    name = StringCol(length=64)
    sku = StringCol(length=64)
    price = CurrencyCol(notNone=True, default=0.0)
    category = ForeignKey('Category')
~/dev/TG-Commerce$ tg-admin sql sql
Using database URI sqlite:///home/ubuntu/dev/TG-Commerce/tgcommerce.db
CREATE TABLE category (
    id INTEGER PRIMARY KEY,
    name VARCHAR(64),
    parent_id INT
);
 
CREATE TABLE product (
    id INTEGER PRIMARY KEY,
    name VARCHAR(64),
    sku VARCHAR(64),
    price DECIMAL(10, 2) NOT NULL,
    category_id INT
/dev$ tg-admin quickstart
Enter project name: TG Commerce
Enter package name [tgcommerce]:
Selected and implied templates:
  turbogears#turbogears  web framework
 
Variables:
  package:  tgcommerce
  project:  TG-Commerce
Creating template turbogears
  Creating ./TG-Commerce/
 
    ... (output snipped) ...

Reference

https://blog.csdn.net/Yaxing_Wang/article/details/82108434

https://www.cnblogs.com/zeug/p/10549955.html

https://blog.csdn.net/iteye_16821/article/details/81616137

https://www.leiue.com/what-is-turbogears

⚠️ **GitHub.com Fallback** ⚠️