Uso de Glom como desarrollador
Cuando cree un nuevo documento, Glom estará ejecutándose a nivel de usuarioDesarrollador. También puede cambiar al nivel de usuario «Desarrollador» después de abrir un documento existente, desde el menú Nivel de usuario. Glom permitirá este cambio sólo si el administrador también lo permite.
- 4.1. Añadir tablas
- 4.2. Editar campos
- 4.3. Ordenando las distribuciones
- 4.4. Crear relaciones
- 4.5. Administración de usuarios
- 4.6. Translations
- 4.7. Defining Reports
4.1. Añadir tablas
You can see the list of existing tables by choosing Tables from the Navigate menu. You will also see this window after connecting to a database server, after creating a new document. To create a new table, click the Add button and enter the name for the new table. Glom will suggest a human-readable title for this table. Operators will see this title instead of the actual table name. You can also mark a tables as hidden from Operators. For instance, Operators should see "Invoice Lines" as related records from the "Invoices" table, but they should never be able to navigate directly to the "Invoice Lines" table.
Puede especificar una tabla como la tabla predeterminada. Esta tabla e mostrará siempre que un operador abra un documento existente, sin preguntarle que seleccione una tabla de la lista.
También puede usar esta ventana para renombrar una tabla existente.
Pulse el botón de Abrir para ver las tablas seleccionadas.
4.2. Editar campos
Elija Campos del menú de Desarrollador. Esto mostrará la lista de campos en la tabla. Las tablas nuevas tienen un campo de clave primaria automáticamente, pero puede cambiar el campo si es necesario.
Click the Add button to add a new field, then enter the name of the new field. Glom will guess an appropriate human-readable title for this field, but you can edit this. Operators will see this title instead of the actual field name.
Para especificar más detalles de un campo, seleccione el campo y pulse en el botón de Detalles.
- 4.2.1. Claves primarias
- 4.2.2. Tipos de campos
- 4.2.3. Campos calculados
4.2.1. Claves primarias
Cada tabla debe tener una, y solamente una, Clave primaria. El valor en este campo debe ser único, lo que quiere decir que cada valor en este campo sólo aparecerá en un sólo registro de la tabla. Por ejemplo, cada registro de la tabla «Clientes» tendrá también un campo «ID del cliente». Este valor se usará para referirse a este cliente en otras tablas, tales como los registros «Proyectos» y «Facturas». Lea la sección Creando relaciones para obtener más información acerca de cómo relacionar tablas entre si.
4.2.2. Tipos de campos
Glom ofrece algunos tipos simples de campos:
Número
Texto
Fecha
Hora
Booleano - tanto cierto como falso
Imagen
4.2.3. Campos calculados
El valor de los campos se puede calcular con términos de otros campos, usando el lenguaje de programación Python. Éste cálculo debería ser la implementación de una función en Python y debería devolver un valor. El valor devuelto se usará como el valor del campo. Este valor se volverá a calcular cada vez que cambie alguno de los campos de los que obtiene sus datos. Por desarrollar: Por ahora ésto sólo funciona para valores predeterminados, y tampoco se pueden usar los valores de los campos en el cálculo.
También puede hacer cálculos para especificar el valor predeterminado de los campos, seleccionado la solapa Valor predeterminado de la ventana Detalles del campo, pulsando sobre la casilla Calcular valor e introduciendo un cálculo en Python. Puede comprobar este cálculo en la ventana Editar.
4.3. Ordenando las distribuciones
Cada tabla tiene una vista de Lista y de Detalles, por omisión ambas muestran todos los campos de la tabla por fecha de creación. Puede editar la distribución escogiendo Distribución del menú de Desarrollador.
- 4.3.1. Arranging the List View
- 4.3.2. Arranging the Details View
4.3.1. Arranging the List View
Para la vista de Lista, puede especificar la secuencia de los campos columna, y también si hay algún campo oculto.
4.3.2. Arranging the Details View
Para la vista de Detalles, puede crear grupos o campos y darlos títulos. Después puede colocar campos en esos grupos y especificar la secuencia de los campos en los grupos. También puede especificar la secuencia de los grupos. Por ejemplo, en una tabla de «Contactos» puede crear un grupo llamado «Nombre», y colocar los campos «Título», «Nombre» y «Apellido» en ese grupo. Puede tener otros grupos para los campos «Direcciones».
4.4. Crear relaciones
Muchas veces las tablas de una base de datos están relacionadas entre sí. Por ejemplo, una tabla de «Facturas» podrá tener un campo «ID del cliente». El valor de ese campo especifica un registro en la tabla «Clientes» el cual tiene el mismo valor. Glom puede mostrar información adicional, como el nombre del cliente, de ese registro relacionado. O puede mostrar una lista de varios registros relacionados - por ejemplo, algún registro de la «Lista de facturas» que está relacionado con otro registro de «Facturas».
Para crear relaciones, escoja Relaciones del menú de Desarrollador. Esto le mostrarA e introduzca un nombre para ella. Debe elegir un campo de la tabla actual y un campo de otra tabla con el que se crear
Puede usar las relaciones en los siguientes lugares.
Para mostrar un campo relacionado en la lista o en la vista detallada.
Para mostrar una lista de registros relacionados en la vista detallada.
Para buscar un valor de un campo en un registro relacionado. Por ejemplo, copie el precio de un «Producto» en el campo «Precio» de un registro de «Facturas».
Para calcular el valor de un campo.
4.5. Administración de usuarios
To define the Operators who can use your database, and to specify what access they have to the various tables, choose Users from the Developer menu.
4.6. Translations
Glom's user interface (and this document) is translated into several languages, as you should see already if you are using your computer with a non-English user interface. In addition, Glom automatically shows and understands numbers and dates according to the current user's local conventions. For instance, a user in the USA might enter a price as 1.99 and a date as 1/13/2008, but a German user of the same database will later see that as 1,99 and 13.1.2008.
However, the Glom system that you create also contains text that must be translated if it will be used by people who speak different languages. For instance, you must provide translations for the titles of your tables, fields, and reports. All of these text items can be seen in a list when you choose Translations from the Developer menu. In this window you can specify the language that you used for the original text, and enter translations for each text item for additional languages. When the Glom system is opened by a user of that language then these text items will be shown in the user interface.
Experienced translators may be more familiar with the .po file format, or you might wish to use the many tools that work with the .po file format. By using the Export button you can create a .po file to use in a separate tool or to send to a translator. You can then import the resulting translation by using the Import button.
4.7. Defining Reports
- 4.7.1. Adding or Editing Reports
- 4.7.2. Editing a Report
4.7.1. Adding or Editing Reports
Glom can produce reports to show specific fields for sets of records, sorted and grouped. For instance, a shop might need a report listing all products sold in one month, grouped by product type, and sorted by price inside each group. Each table has its own reports, which are available to the operator from the Reports menu.
To define a report, or to change the definition of an existing report, choose Reports from the Developer menu.
Notice that each report has an ID as well as a human-readable name. This allows your report to have a translated title when used on a computer that uses a different language.
4.7.2. Editing a Report
A Glom report has three areas:
The Header, which appears at the start of the report
The Main area, in which the records and summary lines are shown, with the actual data from the database.
The Footer, which appears at the end of the report.
Inside an area, such as the Main part, you may add report Parts, such as fields, text, or images. These will usually appear in a row on the printed report, with one row for each record. In the simple case, this will look much like Glom's list view. You can add parts to your report by selecting them from the Available Parts list and then clicking the Add button. The part will then be added to the Parts list, in the selected area.
To specify details for the parts, such as the text or image to display, or to choose the field to display, select the part in the Parts list and click the Edit button. You may also specify field formatting by clicking the Formatting button, just as you would when defining a details or list layout.
Some parts may contain other parts and have extra properties to control how they present their child parts. For instance, the Group By part groups records together by a field. For instance, a products report might group a list of products by product type. You can even add a second sub-grouping inside the main Group By part, by selecting your top-level Group By part in the Parts list while adding a new Group By part from the Available Parts list. For instance, you might group your products by manufacturer, inside each product type group.
To specify the field by which the records should be grouped, select your Group By part in the Parts list and click the Edit button. You can then choose the field by which the records should be grouped, and select the fields by which these records should be sorted within the group. You may also specify some additional fields to be displayed in the group's title row. For instance, you might want to group products by a manufacturer ID, but also show the manufacturer name.
The Vertical Group part may contain other items. For instance, it allows you to arrange fields below each other instead of just one after the other in the horizontal row. This is useful for grouping related fields such as address lines, or just to squeeze more information into the records's row on the report.
When you have finished, click the Close button to save the report's definition. Your report can then be chosen from the Reports menu. See the Printing Reports section for more details.