-
Notifications
You must be signed in to change notification settings - Fork 2
/
params.json
7 lines (7 loc) · 7.61 KB
/
params.json
1
2
3
4
5
6
7
{
"name": "Plasta",
"tagline": "Framework in Python for rapid deployment of CRUD operations",
"body": "<img src=\"https://raw.github.com/informaticameg/plasta/master/resources/plasta.png\" />\r\n\r\nPlasta is a framework written in Python for rapid deployment of [CRUDs](http://en.wikipedia.org/wiki/Create,_read,_update_and_delete) in a simple way, in a few steps and in few lines of code.\r\n\r\nIs designed with the MVC pattern and the DRY (Don't Repeat Yourself) development technique.\r\n\r\n## Sinopsis\r\n\r\nIn software engineering we often find the task of performing various CRUD (Create, read, update and delete) in the development of a typical management system or application. This leads to the repetitive task of writing the same operations over and over again for each CRUD being performed, increasing deployment time, lines of code, risk of errors and increased maintenance.\r\nPlasta born to cover the task of automating these processes.\r\n\r\nIt focuses on both deployment and maintenanceof an aplication is minimized, for this the core of Plasta is designed so that at any time, if necessary, you can reimplement any method that does not meet our interests. Leaving it open to the possibility of a more comfortable development.\r\n\r\n## Technical features\r\n\r\n- [Storm](https://storm.canonical.com/) ORM in the persistence.\r\n\r\n- [PyQt4](https://www.riverbankcomputing.com/software/pyqt/download) in GUIs.\r\n\r\n## [Structure of a CRUD](https://github.com/informaticameg/plasta/blob/master/doc/en/first_package.md#creating-the-first-package-plasta)\r\n\r\nEach CRUD is made up of a Python package, that contains the follow structure:\r\n* Object Class (e.g.: People).\r\n* Manager Class (e.g.: PeopleManager)\r\n* Main Class of the CRUD (e.g.: PeopleGUI)\r\n* Adding a Record Class (e.g.: AddPeople)\r\n* Qt's .ui File for <add people> screen.\r\n\r\nThen the resulting package would be something like this:\r\n```\r\n/people\r\n|--- __init__.py\r\n|--- manager.py\r\n|--- gui.py\r\n|--- add.py\r\n|--- add.ui\r\n```\r\n\r\n**1. Creating the __init__.py file**\r\n\r\nHere define your class attributes\r\n\r\n```python\r\nfrom storm.locals import *\r\n\r\nclass People (object):\r\n\r\n\t# table name in the database for this object\r\n\t__storm_table__ = \"peoples\"\r\n\r\n\t# attributes of the class\r\n\tide = Int(primary = True)\r\n\tnames = Unicode(allow_none = False)\r\n\tphone = Unicode()\r\n\taddress = Unicode()\r\n\tzone = Int()\r\n\r\n def __init__(self, names, phone, address, zone):\r\n self.names = names\r\n self.phone = phone\r\n self.address = address\r\n self.zone = zone\r\n\r\n\t# value to be displayed when you invoke this function\r\n\tdef __str__(self):\r\n\t\treturn self.names\r\n```\r\n\r\n**2. Creating the manager.py file**\r\n\r\nOnce the Person object made, we create the controller class\r\nfor this object.\r\n\r\n```python\r\nfrom plasta.logic.manager import BaseManager\r\nfrom people import People\r\n\r\nclass PeopleManager( BaseManager ):\r\n\r\n\tdef __init__( self, store, reset = False ):\r\n\t\tBaseManager.__init__( self, store, reset )\r\n\t\t# object to be handled by this controller\r\n\t\tself.CLASS = People\r\n\t\tself._start_operations()\r\n\r\n```\r\n\r\n**3. Creating the gui.py file**\r\n\r\n```python\r\nfrom plasta.gui import BaseGUI\r\nfrom people import People\r\nfrom people.add import AddPeople\r\n\r\nclass PeopleGUI(BaseGUI):\r\n\r\n\tdef __init__(self, manager, managers = []):\r\n\t\t# calls the base class constructor\r\n\t\tBaseGUI.__init__(self, manager, managers)\r\n\r\n\t\t# class display to add and edit dialogs\r\n\t\tself.DialogAddClass = AddPeople\r\n\r\n\t\t# attributes used as filters\r\n self.addFiler(u'Names', People.names)\r\n self.addFiler(u'Phone', People.phone)\r\n self.addFiler(u'Address', People.address)\r\n self.addFiler(u'Zone', People.zone)\r\n\r\n # columns / attributes shown in the list\r\n self.addTableColumn(u'Names', People.names)\r\n self.addTableColumn(u'Phone', People.phone)\r\n self.addTableColumn(u'Address', People.address)\r\n self.addTableColumn(u'Zone', People.zone, alignment='C')\r\n\r\n\t\t# performs operations start to lift the window\r\n\t\tself._start_operations()\r\n```\r\n\r\n**4. Creating the add.py file**\r\n\r\nFinally create the add.py file, and its contents would be this:\r\n\r\n```python\r\nfrom os.path import join, abspath, dirname\r\nfrom plasta.gui.add_window import BaseAdd\r\nfrom people import People\r\n\r\nclass AddPeople(BaseAdd):\r\n\r\n def __init__(self, manager, itemToEdit = False, managers = []):\r\n # base class constructor\r\n BaseAdd.__init__(self, manager, itemToEdit)\r\n # read and get up ui file information\r\n self.loadUI(join(abspath(dirname(__file__)),'add.ui'))\r\n\r\n # here indicate what interface widget\r\n # it corresponds to an attribute of the class\r\n self.linkToAttribute(self.leNames, People.names)\r\n self.linkToAttribute(self.lePhone, People.phone)\r\n self.linkToAttribute(self.leAddress, People.address)\r\n self.linkToAttribute(self.leZone, People.zone)\r\n\r\n self._start_operations()\r\n```\r\nWooyla, the resulting crud would look like:\r\n\r\n<img src=\"https://raw.github.com/informaticameg/plasta/master/resources/peoples_crud.png\" />\r\n\r\nUsing the Plasta generator to create this package, the command would be:\r\n\r\n`$ python plastagen g crud -u people names phone address zone`\r\n\r\nFor more details see [Creating the first package Plasta](https://github.com/informaticameg/plasta/blob/master/doc/en/first_package.md#creating-the-first-package-plasta)\r\n\r\n## [Introduction](https://github.com/informaticameg/Plasta/blob/master/doc/en/introduction.md)\r\n\r\n* [Licence](https://github.com/informaticameg/Plasta/blob/master/doc/en/introduction.md#licence)\r\n* [Components](https://github.com/informaticameg/Plasta/blob/master/doc/en/introduction.md#components)\r\n* [Terminologies](https://github.com/informaticameg/Plasta/blob/master/doc/en/introduction.md#terminologies)\r\n* [Conventions](https://github.com/informaticameg/Plasta/blob/master/doc/en/introduction.md#conventions)\r\n\r\n## [Getting started](https://github.com/informaticameg/Plasta/blob/master/doc/en/getting_started.md)\r\n\r\n* [Install](https://github.com/informaticameg/Plasta/blob/master/doc/en/install.md)\r\n\r\n* [Choosing the structure of the application](https://github.com/informaticameg/Plasta/blob/master/doc/en/getting_started.md#choosing-the-structure-of-the-application)\r\n* [Plasta generator](https://github.com/informaticameg/Plasta/blob/master/doc/en/getting_started.md#plasta-generator)\r\n* [Creating the first package Plasta](https://github.com/informaticameg/plasta/blob/master/doc/en/first_package.md#creating-the-first-package-plasta)\r\n\r\n## [API](https://github.com/informaticameg/plasta/blob/master/doc/en/api.md)\r\n\r\n## [Use cases](https://github.com/informaticameg/plasta/blob/master/doc/en/uses_cases.md)\r\n\r\n* Create an object containing references\r\n* Passing reference from one model to another\r\n* Change the order of attributes displayed in the list\r\n* Rename the attributes displayed in the list\r\n* Change the main attribute of the class 'ide' by other\r\n* Formatting attributes in the list\r\n\r\n## [Example Apps](https://github.com/informaticameg/plasta/blob/master/doc/en/example_apps.md)\r\n\r\n* Contact list\r\n* Movements manager\r\n\r\nDocumentation available in Spanish [here](https://github.com/informaticameg/plasta/blob/master/doc/es/index.md)",
"google": "UA-75819764-1",
"note": "Don't delete this file! It's used internally to help with page regeneration."
}