Gom.Sorting¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
None
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent |
r |
Class Details¶
- class Gom.Sorting(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- add(resource_type, property_name, sorting_mode)¶
- Parameters:
resource_type (
GObject.GType
) – A subclass ofGom.Resource
.property_name (
str
) – A string.sorting_mode (
Gom.SortingMode
) – AGom.SortingMode
.
Add a new ORDER BY clause to the sorting object.
This allows chaining ORDER BY clauses, adding them one at a time, rather than passing them all to the constructor.
Example:
GomSorting *sorting = g_object_new (GOM_TYPE_SORTING, NULL); gom_sorting_add (sorting, EPISODE_TYPE_RESOURCE, "season-number", GOM_SORTING_DESCENDING); gom_sorting_add (sorting, EPISODE_TYPE_RESOURCE, "episode-number", GOM_SORTING_ASCENDING);
The above example maps to the following SQL statement:
ORDER BY 'episodes'.'season-number' DESC, 'episodes'.'episode-number'
- get_sql(table_map)¶
- Parameters:
table_map ({
object
:object
}) – AGLib.HashTable
.- Returns:
A string containing the SQL query corresponding to this self.
- Return type: