Gom.Sorting

g GObject.InitiallyUnowned GObject.InitiallyUnowned Gom.Sorting Gom.Sorting GObject.InitiallyUnowned->Gom.Sorting GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

add (resource_type, property_name, sorting_mode)

get_sql (table_map)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

None

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent

GObject.Object

r

Class Details

class Gom.Sorting(**kwargs)
Bases:

GObject.InitiallyUnowned

Abstract:

No

Structure:

Gom.SortingClass

add(resource_type, property_name, sorting_mode)
Parameters:

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}) – A GLib.HashTable.

Returns:

A string containing the SQL query corresponding to this self.

Return type:

str