GData.Query¶
- Subclasses:
GData.CalendarQuery
,GData.ContactsQuery
,GData.DocumentsDriveQuery
,GData.DocumentsQuery
,GData.FreebaseQuery
,GData.FreebaseSearchQuery
,GData.FreebaseTopicQuery
,GData.PicasaWebQuery
,GData.TasksQuery
,GData.YouTubeQuery
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
|
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w |
Author search string. |
||
r/w |
Category search string. |
||
r/w |
An ETag against which to check. |
||
r/w |
Should the server be strict about the query? |
||
r/w |
The maximum number of entries to return. |
||
r/w |
Maximum date for returned entries to be published. |
||
r/w |
Minimum date for returned entries to be published. |
||
r/w |
Query terms for which to search. |
||
r/w |
One-based result start index. |
||
r/w |
Maximum date for updates on returned entries. |
||
r/w |
Minimum date for updates on returned entries. |
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent |
r |
Class Details¶
- class GData.Query(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
All the fields in the
GData.Query
structure are private and should never be accessed directly.- classmethod new(q)¶
- Parameters:
- Returns:
a new
GData.Query
- Return type:
Creates a new
GData.Query
with itsGData.Query
:q
property set to q.
- classmethod new_with_limits(q, start_index, max_results)¶
- Parameters:
- Returns:
a new
GData.Query
- Return type:
Creates a new
GData.Query
with itsGData.Query
:q
property set to q, and the limits start_index and max_results applied.
- get_author()¶
-
Gets the
GData.Query
:author
property.
- get_categories()¶
-
Gets the
GData.Query
:categories
property.
- get_etag()¶
-
Gets the
GData.Query
:etag
property.New in version 0.2.0.
- get_max_results()¶
- Returns:
the maximum results property, or 0 if it is unset
- Return type:
Gets the
GData.Query
:max-results
property.
- get_published_max()¶
- Returns:
the published-max property, or -1
- Return type:
Gets the
GData.Query
:published-max
property. If the property is unset, -1 will be returned.
- get_published_min()¶
- Returns:
the published-min property, or -1
- Return type:
Gets the
GData.Query
:published-min
property. If the property is unset, -1 will be returned.
- get_q()¶
-
Gets the
GData.Query
:q
property.
- get_query_uri(feed_uri)¶
- Parameters:
feed_uri (
str
) – the feed URI on which to build the query URI- Returns:
a query URI; free with
GLib.free
()- Return type:
Builds a query URI from the given base feed URI, using the properties of the
GData.Query
. This function will take care of all necessary URI escaping, so it should not be done beforehand.The query URI is what functions like
GData.Service.query
() use to query the online service.
- get_start_index()¶
- Returns:
the start index property, or 0 if it is unset
- Return type:
Gets the
GData.Query
:start-index
property.
- get_updated_max()¶
- Returns:
the updated-max property, or -1
- Return type:
Gets the
GData.Query
:updated-max
property. If the property is unset, -1 will be returned.
- get_updated_min()¶
- Returns:
the updated-min property, or -1
- Return type:
Gets the
GData.Query
:updated-min
property. If the property is unset, -1 will be returned.
- is_strict()¶
- Returns:
the strict property
- Return type:
Gets the
GData.Query
:is-strict
property.New in version 0.2.0.
- next_page()¶
Changes the state of the
GData.Query
such that whenGData.Query.get_query_uri
() is next called, it will build the query URI for the next page in the result set.Ideally, the URI of the next page is retrieved from a feed automatically when
GData.Service.query
() is called, butGData.Query.next_page
() will fall back to usingGData.Query
:start-index
to emulate true pagination if this fails.You should not implement pagination manually using
GData.Query
:start-index
.
- previous_page()¶
-
Changes the state of the
GData.Query
such that whenGData.Query.get_query_uri
() is next called, it will build the query URI for the previous page in the result set.See the documentation for
GData.Query.next_page
() for an explanation of how query URIs from the feeds are used to this end.
- set_author(author)¶
-
Sets the
GData.Query
:author
property of theGData.Query
to the new author string, author.Set author to
None
to unset the property in the query URI.
- set_categories(categories)¶
-
Sets the
GData.Query
:categories
property of theGData.Query
to the new category string, categories.Set categories to
None
to unset the property in the query URI.
- set_etag(etag)¶
-
Sets the
GData.Query
:etag
property of theGData.Query
to the new ETag, etag.Set etag to
None
to not check against the server-side ETag.New in version 0.2.0.
- set_is_strict(is_strict)¶
- Parameters:
is_strict (
bool
) – the new strict value
Sets the
GData.Query
:is-strict
property of theGData.Query
to the new strict value, is_strict.New in version 0.2.0.
- set_max_results(max_results)¶
- Parameters:
max_results (
int
) – the new maximum results value, or 0
Sets the
GData.Query
:max-results
property of theGData.Query
to the new maximum results value, max_results.Set max_results to 0 to unset the property in the query URI.
- set_published_max(published_max)¶
- Parameters:
published_max (
int
) – the new maximum publish time, or -1
Sets the
GData.Query
:published-max
property of theGData.Query
to the new maximum publish time, published_max.Set published_max to -1 to unset the property in the query URI.
- set_published_min(published_min)¶
- Parameters:
published_min (
int
) – the new minimum publish time, or -1
Sets the
GData.Query
:published-min
property of theGData.Query
to the new minimum publish time, published_min.Set published_min to -1 to unset the property in the query URI.
- set_q(q)¶
-
Sets the
GData.Query
:q
property of theGData.Query
to the new query string, q.Set q to
None
to unset the property in the query URI.
- set_start_index(start_index)¶
- Parameters:
start_index (
int
) – the new start index, or 0
Sets the
GData.Query
:start-index
property of theGData.Query
to the new one-based start index, start_index.Set start_index to 0 to unset the property in the query URI.
- set_updated_max(updated_max)¶
- Parameters:
updated_max (
int
) – the new maximum update time, or -1
Sets the
GData.Query
:updated-max
property of theGData.Query
to the new maximum update time, updated_max.Set updated_max to -1 to unset the property in the query URI.
- set_updated_min(updated_min)¶
- Parameters:
updated_min (
int
) – the new minimum update time, or -1
Sets the
GData.Query
:updated-min
property of theGData.Query
to the new minimum update time, updated_min.Set updated_min to -1 to unset the property in the query URI.
- do_get_query_uri(feed_uri, query_uri, params_started) virtual¶
- Parameters:
feed_uri (
str
) –query_uri (
GLib.String
) –params_started (
bool
) –
Property Details¶
- GData.Query.props.author¶
-
An entry author. The service returns entries where the author name and/or e-mail address match your query string.
- GData.Query.props.categories¶
-
A category filter.
You can query on multiple categories by listing multiple categories separated by slashes. The service returns all entries that match all of the categories (like using AND between terms). For example: Fritz/Laurie returns entries that match both categories (“Fritz” and “Laurie”).
To do an OR between terms, use a pipe character (
|
). For example: Fritz\%7CLaurie returns entries that match either category.An entry matches a specified category if the entry is in a category that has a matching term or label, as defined in the Atom specification. (Roughly, the “term” is the internal string used by the software to identify the category, while the “label” is the human-readable string presented to a user in a user interface.)
To exclude entries that match a given category, use the form -categoryname.
To query for a category that has a scheme – such as
<category scheme="urn:google.com" term="public"/>
– you must place the scheme in curly braces before the category name. For example: {urn:google.com}public. To match a category that has no scheme, use an empty pair of curly braces. If you don’t specify curly braces, then categories in any scheme will match.The above features can be combined. For example: A|-{urn:google.com}B/-C means (A OR (NOT B)) AND (NOT C).
- GData.Query.props.etag¶
-
The ETag against which to check for updates. If the server-side ETag matches this one, the requested feed hasn’t changed, and is not returned unnecessarily.
Setting any of the other query properties will unset the ETag, as ETags match against entire queries. If the ETag should be used in a query, it must be set again using
GData.Query.set_etag
() after setting any other properties.New in version 0.2.0.
- GData.Query.props.is_strict¶
-
Strict query parameter checking. If this is enabled, an error will be returned by the online service if a parameter is not recognised.
New in version 0.2.0.
- GData.Query.props.max_results¶
-
Maximum number of results to be retrieved. Most services have a default
GData.Query
:max-results
size imposed by the server; if you wish to receive the entire feed, specify a large number such asGObject.G_MAXUINT
for this property.Use 0 to not specify a maximum number of results.
- GData.Query.props.published_max¶
-
Upper bound on the entry publish date, exclusive.
- GData.Query.props.published_min¶
-
Lower bound on the entry publish date, inclusive.
- GData.Query.props.q¶
-
A full-text query string.
When creating a query, list search terms separated by spaces, in the form term1 term2 term3. (As with all of the query parameter values, the spaces must be URL encoded.) The service returns all entries that match all of the search terms (like using AND between terms). Like Google’s web search, a service searches on complete words (and related words with the same stem), not substrings.
To search for an exact phrase, enclose the phrase in quotation marks: “exact phrase”.
To exclude entries that match a given term, use the form -term.
The search is case-insensitive.
Example: to search for all entries that contain the exact phrase “Elizabeth Bennet” and the word “Darcy” but don’t contain the word “Austen”, use the following query: “Elizabeth Bennet” Darcy -Austen.
- GData.Query.props.start_index¶
-
The one-based index of the first result to be retrieved. Use
GData.Query.next_page
() andGData.Query.previous_page
() to implement pagination, rather than manually changingGData.Query
:start-index
.Use 0 to not specify a start index.
- GData.Query.props.updated_max¶
-
Upper bound on the entry update date, exclusive.