geonode.favorite.models

Classes

FavoriteManager

Favorite

Module Contents

class geonode.favorite.models.FavoriteManager[source]

Bases: django.db.models.Manager

favorites_for_user(user)[source]
_favorite_ct_for_user(user, model)[source]
favorite_documents_for_user(user)[source]
favorite_maps_for_user(user)[source]
favorite_datasets_for_user(user)[source]
favorite_users_for_user(user)[source]
favorite_for_user_and_content_object(user, content_object)[source]

Returns the Favorite object if it exists for the given user, type, and the primary key of the input content_object. If no Favorite exists, returns None.

Note

Due to the class’s unique_together constraint, there can be only 0 or 1 Favorite object for the given combination of user, type, and content_object.

bulk_favorite_objects(user)[source]

Get the actual favorite objects for a user as a dict by content_type

create_favorite(content_object, user)[source]
class geonode.favorite.models.Favorite[source]

Bases: django.db.models.Model

user[source]
content_type[source]
object_id[source]
content_object[source]
created_on[source]
objects[source]
class Meta[source]
verbose_name = 'favorite'[source]
verbose_name_plural = 'favorites'[source]
unique_together = (('user', 'content_type', 'object_id'),)[source]
__str__()[source]