Feedback

This package contains all feedback-related data models: The base model Feedback as well as the following sub-models:

Event Feedback

class integreat_cms.cms.models.feedback.event_feedback.EventFeedback(*args, **kwargs)[source]

Bases: Feedback

Database model representing feedback about events.

Parameters:
  • id (BigAutoField) – Primary key: ID

  • rating (BooleanField) – Rating. Whether the feedback is positive or negative

  • comment (TextField) – Comment

  • is_technical (BooleanField) – Technical. Whether or not the feedback is targeted at the developers

  • archived (BooleanField) – Archived. Whether or not the feedback is archived

  • created_date (DateTimeField) – Creation date

Relationship fields:

Parameters:
exception DoesNotExist[source]

Bases: DoesNotExist

__init__(*args, **kwargs)[source]
add_note()[source]

Exception.add_note(note) – add a note to the exception

args[source]
silent_variable_failure = True[source]
with_traceback()[source]

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception MultipleObjectsReturned[source]

Bases: MultipleObjectsReturned

__init__(*args, **kwargs)[source]
add_note()[source]

Exception.add_note(note) – add a note to the exception

args[source]
with_traceback()[source]

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

__init__(*args, **kwargs)[source]

Replace Django’s inheritance accessor member functions for our model (self.__class__) with our own versions. We monkey patch them until a patch can be added to Django (which would probably be very small and make all of this obsolete).

If we have inheritance of the form ModelA -> ModelB ->ModelC then Django creates accessors like this: - ModelA: modelb - ModelB: modela_ptr, modelb, modelc - ModelC: modela_ptr, modelb, modelb_ptr, modelc

These accessors allow Django (and everyone else) to travel up and down the inheritance tree for the db object at hand.

The original Django accessors use our polymorphic manager. But they should not. So we replace them with our own accessors that use our appropriate base_objects manager.

async adelete(using=None, keep_parents=False)[source]
archived[source]

Type: BooleanField

Archived. Whether or not the feedback is archived

async arefresh_from_db(using=None, fields=None)[source]
async asave(force_insert=False, force_update=False, using=None, update_fields=None)[source]
best_event_translation[source]

This property returns the best translation for the event this feedback comments on.

Returns:

The best event translation

property category: str[source]

This property returns the category (verbose name of the submodel) of this feedback object.

Returns:

capitalized category

classmethod check(**kwargs)[source]
clean()[source]

Hook for doing any extra model-wide validation after clean() has been called on every field by self.clean_fields. Any ValidationError raised by this method will not be associated with a particular field; it will have a special-case association with the field defined by NON_FIELD_ERRORS.

clean_fields(exclude=None)[source]

Clean all fields and raise a ValidationError containing a dict of all validation errors if any occur.

comment[source]

Type: TextField

Comment

created_date[source]

Type: DateTimeField

Creation date

date_error_message(lookup_type, field_name, unique_for)[source]
delete(using=None, keep_parents=False)[source]
event_translation[source]

Type: ForeignKey to EventTranslation

Event translation (related name: feedback)

event_translation_id[source]

Internal field, use event_translation instead.

eventfeedback[source]

Type: Reverse OneToOneField from EventFeedback

The event feedback of this feedback (related name of feedback_ptr)

eventlistfeedback[source]

Type: Reverse OneToOneField from EventListFeedback

The event list feedback of this feedback (related name of feedback_ptr)

feedback_ptr[source]

Type: OneToOneField to Feedback

Primary key: Feedback ptr (related name: eventfeedback)

feedback_ptr_id[source]

Internal field, use feedback_ptr instead.

classmethod from_db(db, field_names, values)[source]
full_clean(exclude=None, validate_unique=True, validate_constraints=True)[source]

Call clean_fields(), clean(), validate_unique(), and validate_constraints() on the model. Raise a ValidationError for any errors that occur.

get_constraints()[source]
get_deferred_fields()[source]

Return a set containing names of deferred fields for this instance.

classmethod get_model_name_plural() str[source]

Get the plural representation of this model name

Returns:

The plural model name

Return type:

str

get_next_by_created_date(*, field=<django.db.models.DateTimeField: created_date>, is_next=True, **kwargs)[source]

Finds next instance based on created_date. See get_next_by_FOO() for more information.

get_previous_by_created_date(*, field=<django.db.models.DateTimeField: created_date>, is_next=False, **kwargs)[source]

Finds previous instance based on created_date. See get_previous_by_FOO() for more information.

get_rating_display(*, field=<django.db.models.BooleanField: rating>)[source]

Shows the label of the rating. See get_FOO_display() for more information.

get_real_concrete_instance_class()[source]
get_real_concrete_instance_class_id()[source]
get_real_instance()[source]

Upcast an object to it’s actual type.

If a non-polymorphic manager (like base_objects) has been used to retrieve objects, then the complete object with it’s real class/type and all fields may be retrieved with this method.

Note

Each method call executes one db query (if necessary). Use the get_real_instances() to upcast a complete list in a single efficient query.

get_real_instance_class()[source]

Return the actual model type of the object.

If a non-polymorphic manager (like base_objects) has been used to retrieve objects, then the real class/type of these objects may be determined using this method.

get_repr() str[source]

This overwrites the default Django __repr__() method which would return <Feedback: Feedback object (id)>. It is used for logging.

Returns:

The canonical string representation of the feedback

Return type:

str

id[source]

Type: BigAutoField

Primary key: ID

imprintpagefeedback[source]

Type: Reverse OneToOneField from ImprintPageFeedback

The imprint feedback of this feedback (related name of feedback_ptr)

is_technical[source]

Type: BooleanField

Technical. Whether or not the feedback is targeted at the developers

language[source]

Type: ForeignKey to Language

Language (related name: feedback)

language_id[source]

Internal field, use language instead.

mapfeedback[source]

Type: Reverse OneToOneField from MapFeedback

The map feedback of this feedback (related name of feedback_ptr)

property object_name: str[source]

This property returns the name of the object this feedback comments on.

Returns:

The name of the object this feedback refers to

object_url[source]

This property returns the url to the object this feedback comments on.

Returns:

The url to the referred object

objects = <integreat_cms.cms.models.feedback.feedback.CascadeDeletePolymorphicManager object>[source]
offerfeedback[source]

Type: Reverse OneToOneField from OfferFeedback

The offer feedback of this feedback (related name of feedback_ptr)

offerlistfeedback[source]

Type: Reverse OneToOneField from OfferListFeedback

The offer list feedback of this feedback (related name of feedback_ptr)

pagefeedback[source]

Type: Reverse OneToOneField from PageFeedback

The page feedback of this feedback (related name of feedback_ptr)

property pk[source]
poifeedback[source]

Type: Reverse OneToOneField from POIFeedback

The location feedback of this feedback (related name of feedback_ptr)

polymorphic_ctype[source]

Type: ForeignKey to ContentType

Polymorphic ctype (related name: feedback_set+)

The model field that stores the ContentType reference to the actual class.

polymorphic_ctype_id[source]

Internal field, use polymorphic_ctype instead.

polymorphic_internal_model_fields = ['polymorphic_ctype'][source]
polymorphic_model_marker = True[source]
polymorphic_query_multiline_output = False[source]
pre_save_polymorphic(using='default')[source]

Make sure the polymorphic_ctype value is correctly set on this model.

prepare_database_save(field)[source]
rating[source]

Type: BooleanField

Rating. Whether the feedback is positive or negative

Choices:

  • True

  • False

  • None

Manage choices in feedback_ratings

rating_sum_negative[source]

This property returns the sum of the down-ratings of this object.

Returns:

The number of negative ratings on this feedback object

rating_sum_positive[source]

This property returns the sum of the up-ratings of this object.

Returns:

The number of positive ratings on this feedback object

property read: bool[source]

This property returns whether or not the feedback is marked as read or not. It is True if read_by is set and False otherwise.

Returns:

Whether the feedback is marked as read

read_by[source]

Type: ForeignKey to User

Marked as read by. The account that marked this feedback as read. If the feedback is unread, this field is empty. (related name: feedback)

read_by_id[source]

Internal field, use read_by instead.

refresh_from_db(using=None, fields=None)[source]

Reload field values from the database.

By default, the reloading happens from the database this instance was loaded from, or by the read router if this instance wasn’t loaded from any database. The using parameter will override the default.

Fields can be used to specify which fields to reload. The fields should be an iterable of field attnames. If fields is None, then all non-deferred fields are reloaded.

When accessing deferred fields of an instance, the deferred loading of the field will call this method.

region[source]

Type: ForeignKey to Region

Region (related name: feedback)

region_id[source]

Internal field, use region instead.

regionfeedback[source]

Type: Reverse OneToOneField from RegionFeedback

The region feedback of this feedback (related name of feedback_ptr)

property related_feedback: QuerySet[EventFeedback][source]

This property returns all feedback entries which relate to the same object and have the same is_technical value.

Returns:

The queryset of related feedback

save(*args, **kwargs)[source]

Calls pre_save_polymorphic() and saves the model.

save_base(raw=False, force_insert=False, force_update=False, using=None, update_fields=None)[source]

Handle the parts of saving which should be done only once per save, yet need to be done in raw saves, too. This includes some sanity checks and signal sending.

The ‘raw’ argument is telling save_base not to save any parent models and not to do any changes to the values before save. This is used by fixture loading.

classmethod search(region: Region | None, query: str) QuerySet[source]

Searches for all feedbacks which match the given query in their comment. :param region: The current region or None for non-regional feedback :param query: The query string used for filtering the events :return: A query for all matching objects

Parameters:
Return type:

QuerySet

searchresultfeedback[source]

Type: Reverse OneToOneField from SearchResultFeedback

The search result feedback of this feedback (related name of feedback_ptr)

serializable_value(field_name)[source]

Return the value of the field name for this instance. If the field is a foreign key, return the id value instead of the object. If there’s no Field object with this name on the model, return the model attribute’s value.

Used to serialize a field’s value (in the serializer, or form output, for example). Normally, you would just access the attribute directly and not use this method.

classmethod translate_polymorphic_Q_object(q)[source]
unique_error_message(model_class, unique_check)[source]
validate_constraints(exclude=None)[source]
validate_unique(exclude=None)[source]

Check unique constraints on the model and raise ValidationError if any failed.

Event List Feedback

class integreat_cms.cms.models.feedback.event_list_feedback.EventListFeedback(*args, **kwargs)[source]

Bases: Feedback

Database model representing feedback about the event list (e.g. missing events).

Parameters:
  • id (BigAutoField) – Primary key: ID

  • rating (BooleanField) – Rating. Whether the feedback is positive or negative

  • comment (TextField) – Comment

  • is_technical (BooleanField) – Technical. Whether or not the feedback is targeted at the developers

  • archived (BooleanField) – Archived. Whether or not the feedback is archived

  • created_date (DateTimeField) – Creation date

Relationship fields:

Parameters:
exception DoesNotExist[source]

Bases: DoesNotExist

__init__(*args, **kwargs)[source]
add_note()[source]

Exception.add_note(note) – add a note to the exception

args[source]
silent_variable_failure = True[source]
with_traceback()[source]

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception MultipleObjectsReturned[source]

Bases: MultipleObjectsReturned

__init__(*args, **kwargs)[source]
add_note()[source]

Exception.add_note(note) – add a note to the exception

args[source]
with_traceback()[source]

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

__init__(*args, **kwargs)[source]

Replace Django’s inheritance accessor member functions for our model (self.__class__) with our own versions. We monkey patch them until a patch can be added to Django (which would probably be very small and make all of this obsolete).

If we have inheritance of the form ModelA -> ModelB ->ModelC then Django creates accessors like this: - ModelA: modelb - ModelB: modela_ptr, modelb, modelc - ModelC: modela_ptr, modelb, modelb_ptr, modelc

These accessors allow Django (and everyone else) to travel up and down the inheritance tree for the db object at hand.

The original Django accessors use our polymorphic manager. But they should not. So we replace them with our own accessors that use our appropriate base_objects manager.

async adelete(using=None, keep_parents=False)[source]
archived[source]

Type: BooleanField

Archived. Whether or not the feedback is archived

async arefresh_from_db(using=None, fields=None)[source]
async asave(force_insert=False, force_update=False, using=None, update_fields=None)[source]
property category: str[source]

This property returns the category (verbose name of the submodel) of this feedback object.

Returns:

capitalized category

classmethod check(**kwargs)[source]
clean()[source]

Hook for doing any extra model-wide validation after clean() has been called on every field by self.clean_fields. Any ValidationError raised by this method will not be associated with a particular field; it will have a special-case association with the field defined by NON_FIELD_ERRORS.

clean_fields(exclude=None)[source]

Clean all fields and raise a ValidationError containing a dict of all validation errors if any occur.

comment[source]

Type: TextField

Comment

created_date[source]

Type: DateTimeField

Creation date

date_error_message(lookup_type, field_name, unique_for)[source]
delete(using=None, keep_parents=False)[source]
eventfeedback[source]

Type: Reverse OneToOneField from EventFeedback

The event feedback of this feedback (related name of feedback_ptr)

eventlistfeedback[source]

Type: Reverse OneToOneField from EventListFeedback

The event list feedback of this feedback (related name of feedback_ptr)

feedback_ptr[source]

Type: OneToOneField to Feedback

Primary key: Feedback ptr (related name: eventlistfeedback)

feedback_ptr_id[source]

Internal field, use feedback_ptr instead.

classmethod from_db(db, field_names, values)[source]
full_clean(exclude=None, validate_unique=True, validate_constraints=True)[source]

Call clean_fields(), clean(), validate_unique(), and validate_constraints() on the model. Raise a ValidationError for any errors that occur.

get_constraints()[source]
get_deferred_fields()[source]

Return a set containing names of deferred fields for this instance.

classmethod get_model_name_plural() str[source]

Get the plural representation of this model name

Returns:

The plural model name

Return type:

str

get_next_by_created_date(*, field=<django.db.models.DateTimeField: created_date>, is_next=True, **kwargs)[source]

Finds next instance based on created_date. See get_next_by_FOO() for more information.

get_previous_by_created_date(*, field=<django.db.models.DateTimeField: created_date>, is_next=False, **kwargs)[source]

Finds previous instance based on created_date. See get_previous_by_FOO() for more information.

get_rating_display(*, field=<django.db.models.BooleanField: rating>)[source]

Shows the label of the rating. See get_FOO_display() for more information.

get_real_concrete_instance_class()[source]
get_real_concrete_instance_class_id()[source]
get_real_instance()[source]

Upcast an object to it’s actual type.

If a non-polymorphic manager (like base_objects) has been used to retrieve objects, then the complete object with it’s real class/type and all fields may be retrieved with this method.

Note

Each method call executes one db query (if necessary). Use the get_real_instances() to upcast a complete list in a single efficient query.

get_real_instance_class()[source]

Return the actual model type of the object.

If a non-polymorphic manager (like base_objects) has been used to retrieve objects, then the real class/type of these objects may be determined using this method.

get_repr() str[source]

This overwrites the default Django __repr__() method which would return <Feedback: Feedback object (id)>. It is used for logging.

Returns:

The canonical string representation of the feedback

Return type:

str

id[source]

Type: BigAutoField

Primary key: ID

imprintpagefeedback[source]

Type: Reverse OneToOneField from ImprintPageFeedback

The imprint feedback of this feedback (related name of feedback_ptr)

is_technical[source]

Type: BooleanField

Technical. Whether or not the feedback is targeted at the developers

language[source]

Type: ForeignKey to Language

Language (related name: feedback)

language_id[source]

Internal field, use language instead.

mapfeedback[source]

Type: Reverse OneToOneField from MapFeedback

The map feedback of this feedback (related name of feedback_ptr)

property object_name: str[source]

This property returns the name of the object this feedback comments on.

Returns:

The name of the object this feedback refers to

object_url[source]

This property returns the url to the object this feedback comments on.

Returns:

The url to the referred object

objects = <integreat_cms.cms.models.feedback.feedback.CascadeDeletePolymorphicManager object>[source]
offerfeedback[source]

Type: Reverse OneToOneField from OfferFeedback

The offer feedback of this feedback (related name of feedback_ptr)

offerlistfeedback[source]

Type: Reverse OneToOneField from OfferListFeedback

The offer list feedback of this feedback (related name of feedback_ptr)

pagefeedback[source]

Type: Reverse OneToOneField from PageFeedback

The page feedback of this feedback (related name of feedback_ptr)

property pk[source]
poifeedback[source]

Type: Reverse OneToOneField from POIFeedback

The location feedback of this feedback (related name of feedback_ptr)

polymorphic_ctype[source]

Type: ForeignKey to ContentType

Polymorphic ctype (related name: feedback_set+)

The model field that stores the ContentType reference to the actual class.

polymorphic_ctype_id[source]

Internal field, use polymorphic_ctype instead.

polymorphic_internal_model_fields = ['polymorphic_ctype'][source]
polymorphic_model_marker = True[source]
polymorphic_query_multiline_output = False[source]
pre_save_polymorphic(using='default')[source]

Make sure the polymorphic_ctype value is correctly set on this model.

prepare_database_save(field)[source]
rating[source]

Type: BooleanField

Rating. Whether the feedback is positive or negative

Choices:

  • True

  • False

  • None

Manage choices in feedback_ratings

rating_sum_negative[source]

This property returns the sum of the down-ratings of this object.

Returns:

The number of negative ratings on this feedback object

rating_sum_positive[source]

This property returns the sum of the up-ratings of this object.

Returns:

The number of positive ratings on this feedback object

property read: bool[source]

This property returns whether or not the feedback is marked as read or not. It is True if read_by is set and False otherwise.

Returns:

Whether the feedback is marked as read

read_by[source]

Type: ForeignKey to User

Marked as read by. The account that marked this feedback as read. If the feedback is unread, this field is empty. (related name: feedback)

read_by_id[source]

Internal field, use read_by instead.

refresh_from_db(using=None, fields=None)[source]

Reload field values from the database.

By default, the reloading happens from the database this instance was loaded from, or by the read router if this instance wasn’t loaded from any database. The using parameter will override the default.

Fields can be used to specify which fields to reload. The fields should be an iterable of field attnames. If fields is None, then all non-deferred fields are reloaded.

When accessing deferred fields of an instance, the deferred loading of the field will call this method.

region[source]

Type: ForeignKey to Region

Region (related name: feedback)

region_id[source]

Internal field, use region instead.

regionfeedback[source]

Type: Reverse OneToOneField from RegionFeedback

The region feedback of this feedback (related name of feedback_ptr)

property related_feedback: QuerySet[EventListFeedback][source]

This property returns all feedback entries which relate to the same object and have the same is_technical value.

Returns:

The queryset of related feedback

save(*args, **kwargs)[source]

Calls pre_save_polymorphic() and saves the model.

save_base(raw=False, force_insert=False, force_update=False, using=None, update_fields=None)[source]

Handle the parts of saving which should be done only once per save, yet need to be done in raw saves, too. This includes some sanity checks and signal sending.

The ‘raw’ argument is telling save_base not to save any parent models and not to do any changes to the values before save. This is used by fixture loading.

classmethod search(region: Region | None, query: str) QuerySet[source]

Searches for all feedbacks which match the given query in their comment. :param region: The current region or None for non-regional feedback :param query: The query string used for filtering the events :return: A query for all matching objects

Parameters:
Return type:

QuerySet

searchresultfeedback[source]

Type: Reverse OneToOneField from SearchResultFeedback

The search result feedback of this feedback (related name of feedback_ptr)

serializable_value(field_name)[source]

Return the value of the field name for this instance. If the field is a foreign key, return the id value instead of the object. If there’s no Field object with this name on the model, return the model attribute’s value.

Used to serialize a field’s value (in the serializer, or form output, for example). Normally, you would just access the attribute directly and not use this method.

classmethod translate_polymorphic_Q_object(q)[source]
unique_error_message(model_class, unique_check)[source]
validate_constraints(exclude=None)[source]
validate_unique(exclude=None)[source]

Check unique constraints on the model and raise ValidationError if any failed.

Feedback

class integreat_cms.cms.models.feedback.feedback.CascadeDeletePolymorphicManager(*args, **kwargs)[source]

Bases: PolymorphicManager

This class is used as a workaround for a bug in django-polymorphic. For more information, see CascadeDeletePolymorphicQuerySet.

__init__()[source]
aaggregate(*args, **kwargs)[source]
abulk_create(objs, batch_size=None, ignore_conflicts=False, update_conflicts=False, update_fields=None, unique_fields=None)[source]
abulk_update(objs, fields, batch_size=None)[source]
acontains(obj)[source]
acount()[source]
acreate(**kwargs)[source]
aearliest(*fields)[source]
aexists()[source]
aexplain(*, format=None, **options)[source]
afirst()[source]
aget(*args, **kwargs)[source]
aget_or_create(defaults=None, **kwargs)[source]
aggregate(*args, **kwargs)[source]

Return a dictionary containing the calculations (aggregation) over the current queryset.

If args is present the expression is passed as a kwarg using the Aggregate object’s default alias.

ain_bulk(id_list=None, *, field_name='pk')[source]
aiterator(chunk_size=2000)[source]

An asynchronous iterator over the results from applying this QuerySet to the database.

alast()[source]
alatest(*fields)[source]
alias(*args, **kwargs)[source]

Return a query set with added aliases for extra data or aggregations.

all()[source]
annotate(*args, **kwargs)[source]

Return a query set in which the returned objects have been annotated with extra data or aggregations.

aupdate(**kwargs)[source]
aupdate_or_create(defaults=None, **kwargs)[source]
auto_created = False[source]
bulk_create(objs, batch_size=None, ignore_conflicts=False, update_conflicts=False, update_fields=None, unique_fields=None)[source]

Insert each of the instances into the database. Do not call save() on each of the instances, do not send any pre/post_save signals, and do not set the primary key attribute if it is an autoincrement field (except if features.can_return_rows_from_bulk_insert=True). Multi-table models are not supported.

bulk_update(objs, fields, batch_size=None)[source]

Update the given fields in each of the given objects in the database.

check(**kwargs)[source]
complex_filter(filter_obj)[source]

Return a new QuerySet instance with filter_obj added to the filters.

filter_obj can be a Q object or a dictionary of keyword lookup arguments.

This exists to support framework features such as ‘limit_choices_to’, and usually it will be more natural to use other methods.

contains(obj)[source]

Return True if the QuerySet contains the provided obj, False otherwise.

contribute_to_class(cls, name)[source]
count()[source]

Perform a SELECT COUNT() and return the number of records as an integer.

If the QuerySet is already fully cached, return the length of the cached results set to avoid multiple SELECT COUNT(*) calls.

create(**kwargs)[source]

Create a new object with the given kwargs, saving it to the database and returning the created object.

creation_counter = 46[source]
dates(field_name, kind, order='ASC')[source]

Return a list of date objects representing all available dates for the given field_name, scoped to ‘kind’.

datetimes(field_name, kind, order='ASC', tzinfo=None, is_dst=<object object>)[source]

Return a list of datetime objects representing all available datetimes for the given field_name, scoped to ‘kind’.

property db[source]
db_manager(using=None, hints=None)[source]
deconstruct()[source]

Return a 5-tuple of the form (as_manager (True), manager_class, queryset_class, args, kwargs).

Raise a ValueError if the manager is dynamically generated.

defer(*fields)[source]

Defer the loading of data for certain fields until they are accessed. Add the set of deferred fields to any existing set of deferred fields. The only exception to this is if None is passed in as the only parameter, in which case removal all deferrals.

difference(*other_qs)[source]
distinct(*field_names)[source]

Return a new QuerySet instance that will select only distinct results.

earliest(*fields)[source]
exclude(*args, **kwargs)[source]

Return a new QuerySet instance with NOT (args) ANDed to the existing set.

exists()[source]

Return True if the QuerySet would have any results, False otherwise.

explain(*, format=None, **options)[source]

Runs an EXPLAIN on the SQL query this QuerySet would perform, and returns the results.

extra(select=None, where=None, params=None, tables=None, order_by=None, select_params=None)[source]

Add extra SQL fragments to the query.

filter(*args, **kwargs)[source]

Return a new QuerySet instance with the args ANDed to the existing set.

first()[source]

Return the first object of a query or None if no match is found.

classmethod from_queryset(queryset_class, class_name=None)[source]
get(*args, **kwargs)[source]

Perform the query and return a single object matching the given keyword arguments.

get_or_create(defaults=None, **kwargs)[source]

Look up an object with the given kwargs, creating one if necessary. Return a tuple of (object, created), where created is a boolean specifying whether an object was created.

get_queryset()[source]

Return a new QuerySet object. Subclasses can override this method to customize the behavior of the Manager.

get_real_instances(base_result_objects=None)[source]
in_bulk(id_list=None, *, field_name='pk')[source]

Return a dictionary mapping each of the given IDs to the object with that ID. If id_list isn’t provided, evaluate the entire QuerySet.

instance_of(*args)[source]
intersection(*other_qs)[source]
iterator(chunk_size=None)[source]

An iterator over the results from applying this QuerySet to the database. chunk_size must be provided for QuerySets that prefetch related objects. Otherwise, a default chunk_size of 2000 is supplied.

last()[source]

Return the last object of a query or None if no match is found.

latest(*fields)[source]

Return the latest object according to fields (if given) or by the model’s Meta.get_latest_by.

non_polymorphic()[source]
none()[source]

Return an empty QuerySet.

not_instance_of(*args)[source]
only(*fields)[source]

Essentially, the opposite of defer(). Only the fields passed into this method and that are not already specified as deferred are loaded immediately when the queryset is evaluated.

order_by(*field_names)[source]

Return a new QuerySet instance with the ordering changed.

Return a new QuerySet instance that will prefetch the specified Many-To-One and Many-To-Many related objects when the QuerySet is evaluated.

When prefetch_related() is called more than once, append to the list of prefetch lookups. If prefetch_related(None) is called, clear the list.

queryset_class[source]

alias of CascadeDeletePolymorphicQuerySet

raw(raw_query, params=(), translations=None, using=None)[source]
reverse()[source]

Reverse the ordering of the QuerySet.

select_for_update(nowait=False, skip_locked=False, of=(), no_key=False)[source]

Return a new QuerySet instance that will select objects with a FOR UPDATE lock.

Return a new QuerySet instance that will select related objects.

If fields are specified, they must be ForeignKey fields and only those related objects are included in the selection.

If select_related(None) is called, clear the list.

union(*other_qs, all=False)[source]
update(**kwargs)[source]

Update all elements in the current QuerySet, setting all the given fields to the appropriate values.

update_or_create(defaults=None, **kwargs)[source]

Look up an object with the given kwargs, updating one with defaults if it exists, otherwise create a new one. Return a tuple (object, created), where created is a boolean specifying whether an object was created.

use_in_migrations = False[source]

If set to True the manager will be serialized into migrations and will thus be available in e.g. RunPython operations.

using(alias)[source]

Select which database this QuerySet should execute against.

values(*fields, **expressions)[source]
values_list(*fields, flat=False, named=False)[source]
class integreat_cms.cms.models.feedback.feedback.CascadeDeletePolymorphicQuerySet(*args, **kwargs)[source]

Bases: PolymorphicQuerySet

Patch the QuerySet to call delete on the non_polymorphic QuerySet, avoiding models.deletion.Collector typing problem

Based on workarounds proposed in: https://github.com/django-polymorphic/django-polymorphic/issues/229 See also: https://github.com/django-polymorphic/django-polymorphic/issues/34, https://github.com/django-polymorphic/django-polymorphic/issues/84 Related Django ticket: https://code.djangoproject.com/ticket/23076

__init__(*args, **kwargs)[source]
async aaggregate(*args, **kwargs)[source]
async abulk_create(objs, batch_size=None, ignore_conflicts=False, update_conflicts=False, update_fields=None, unique_fields=None)[source]
async abulk_update(objs, fields, batch_size=None)[source]
async acontains(obj)[source]
async acount()[source]
async acreate(**kwargs)[source]
async adelete()[source]
async aearliest(*fields)[source]
async aexists()[source]
async aexplain(*, format=None, **options)[source]
async afirst()[source]
async aget(*args, **kwargs)[source]
async aget_or_create(defaults=None, **kwargs)[source]
aggregate(*args, **kwargs)[source]

translate the polymorphic field paths in the kwargs, then call vanilla aggregate. We need no polymorphic object retrieval for aggregate => switch it off.

async ain_bulk(id_list=None, *, field_name='pk')[source]
async aiterator(chunk_size=2000)[source]

An asynchronous iterator over the results from applying this QuerySet to the database.

async alast()[source]
async alatest(*fields)[source]
alias(*args, **kwargs)[source]

Return a query set with added aliases for extra data or aggregations.

all()[source]

Return a new QuerySet that is a copy of the current one. This allows a QuerySet to proxy for a model manager in some cases.

annotate(*args, **kwargs)[source]

translate the polymorphic field paths in the kwargs, then call vanilla annotate. _get_real_instances will do the rest of the job after executing the query.

classmethod as_manager()[source]
async aupdate(**kwargs)[source]
async aupdate_or_create(defaults=None, **kwargs)[source]
bulk_create(objs, batch_size=None, ignore_conflicts=False)[source]

Insert each of the instances into the database. Do not call save() on each of the instances, do not send any pre/post_save signals, and do not set the primary key attribute if it is an autoincrement field (except if features.can_return_rows_from_bulk_insert=True). Multi-table models are not supported.

bulk_update(objs, fields, batch_size=None)[source]

Update the given fields in each of the given objects in the database.

complex_filter(filter_obj)[source]

Return a new QuerySet instance with filter_obj added to the filters.

filter_obj can be a Q object or a dictionary of keyword lookup arguments.

This exists to support framework features such as ‘limit_choices_to’, and usually it will be more natural to use other methods.

contains(obj)[source]

Return True if the QuerySet contains the provided obj, False otherwise.

count()[source]

Perform a SELECT COUNT() and return the number of records as an integer.

If the QuerySet is already fully cached, return the length of the cached results set to avoid multiple SELECT COUNT(*) calls.

create(**kwargs)[source]

Create a new object with the given kwargs, saving it to the database and returning the created object.

dates(field_name, kind, order='ASC')[source]

Return a list of date objects representing all available dates for the given field_name, scoped to ‘kind’.

datetimes(field_name, kind, order='ASC', tzinfo=None, is_dst=<object object>)[source]

Return a list of datetime objects representing all available datetimes for the given field_name, scoped to ‘kind’.

property db[source]

Return the database used if this query is executed now.

defer(*fields)[source]

Translate the field paths in the args, then call vanilla defer.

Also retain a copy of the original fields passed, which we’ll need when we’re retrieving the real instance (since we’ll need to translate them again, as the model will have changed).

delete() tuple[int, dict[str, int]][source]

This method deletes all objects in this QuerySet.

Returns:

A tuple of the number of objects delete and the delete objects grouped by their type

Return type:

tuple[int, dict[str, int]]

difference(*other_qs)[source]
distinct(*field_names)[source]

Return a new QuerySet instance that will select only distinct results.

earliest(*fields)[source]
exclude(*args, **kwargs)[source]

Return a new QuerySet instance with NOT (args) ANDed to the existing set.

exists()[source]

Return True if the QuerySet would have any results, False otherwise.

explain(*, format=None, **options)[source]

Runs an EXPLAIN on the SQL query this QuerySet would perform, and returns the results.

extra(select=None, where=None, params=None, tables=None, order_by=None, select_params=None)[source]

Add extra SQL fragments to the query.

filter(*args, **kwargs)[source]

Return a new QuerySet instance with the args ANDed to the existing set.

first()[source]

Return the first object of a query or None if no match is found.

get(*args, **kwargs)[source]

Perform the query and return a single object matching the given keyword arguments.

get_or_create(defaults=None, **kwargs)[source]

Look up an object with the given kwargs, creating one if necessary. Return a tuple of (object, created), where created is a boolean specifying whether an object was created.

get_real_instances(base_result_objects=None)[source]

Cast a list of objects to their actual classes.

This does roughly the same as:

return [ o.get_real_instance() for o in base_result_objects ]

but more efficiently.

Return type:

PolymorphicQuerySet

in_bulk(id_list=None, *, field_name='pk')[source]

Return a dictionary mapping each of the given IDs to the object with that ID. If id_list isn’t provided, evaluate the entire QuerySet.

instance_of(*args)[source]

Filter the queryset to only include the classes in args (and their subclasses).

intersection(*other_qs)[source]
iterator(chunk_size=None)[source]

An iterator over the results from applying this QuerySet to the database. chunk_size must be provided for QuerySets that prefetch related objects. Otherwise, a default chunk_size of 2000 is supplied.

last()[source]

Return the last object of a query or None if no match is found.

latest(*fields)[source]

Return the latest object according to fields (if given) or by the model’s Meta.get_latest_by.

non_polymorphic()[source]

switch off polymorphic behaviour for this query. When the queryset is evaluated, only objects of the type of the base class used for this query are returned.

none()[source]

Return an empty QuerySet.

not_instance_of(*args)[source]

Filter the queryset to exclude the classes in args (and their subclasses).

only(*fields)[source]

Translate the field paths in the args, then call vanilla only.

Also retain a copy of the original fields passed, which we’ll need when we’re retrieving the real instance (since we’ll need to translate them again, as the model will have changed).

order_by(*field_names)[source]

translate the field paths in the args, then call vanilla order_by.

property ordered[source]

Return True if the QuerySet is ordered – i.e. has an order_by() clause or a default ordering on the model (or is empty).

Return a new QuerySet instance that will prefetch the specified Many-To-One and Many-To-Many related objects when the QuerySet is evaluated.

When prefetch_related() is called more than once, append to the list of prefetch lookups. If prefetch_related(None) is called, clear the list.

property query[source]
raw(raw_query, params=(), translations=None, using=None)[source]
resolve_expression(*args, **kwargs)[source]
reverse()[source]

Reverse the ordering of the QuerySet.

select_for_update(nowait=False, skip_locked=False, of=(), no_key=False)[source]

Return a new QuerySet instance that will select objects with a FOR UPDATE lock.

Return a new QuerySet instance that will select related objects.

If fields are specified, they must be ForeignKey fields and only those related objects are included in the selection.

If select_related(None) is called, clear the list.

union(*other_qs, all=False)[source]
update(**kwargs)[source]

Update all elements in the current QuerySet, setting all the given fields to the appropriate values.

update_or_create(defaults=None, **kwargs)[source]

Look up an object with the given kwargs, updating one with defaults if it exists, otherwise create a new one. Return a tuple (object, created), where created is a boolean specifying whether an object was created.

using(alias)[source]

Select which database this QuerySet should execute against.

values(*fields, **expressions)[source]
values_list(*fields, flat=False, named=False)[source]
class integreat_cms.cms.models.feedback.feedback.Feedback(*args, **kwargs)[source]

Bases: PolymorphicModel, AbstractBaseModel

Database model representing feedback from app-users. Do not directly create instances of this base model, but of the submodels (e.g. PageFeedback) instead.

Parameters:

Relationship fields:

Parameters:

Reverse relationships:

Parameters:
exception DoesNotExist[source]

Bases: ObjectDoesNotExist

__init__(*args, **kwargs)[source]
add_note()[source]

Exception.add_note(note) – add a note to the exception

args[source]
silent_variable_failure = True[source]
with_traceback()[source]

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception MultipleObjectsReturned[source]

Bases: MultipleObjectsReturned

__init__(*args, **kwargs)[source]
add_note()[source]

Exception.add_note(note) – add a note to the exception

args[source]
with_traceback()[source]

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

__init__(*args, **kwargs)[source]

Replace Django’s inheritance accessor member functions for our model (self.__class__) with our own versions. We monkey patch them until a patch can be added to Django (which would probably be very small and make all of this obsolete).

If we have inheritance of the form ModelA -> ModelB ->ModelC then Django creates accessors like this: - ModelA: modelb - ModelB: modela_ptr, modelb, modelc - ModelC: modela_ptr, modelb, modelb_ptr, modelc

These accessors allow Django (and everyone else) to travel up and down the inheritance tree for the db object at hand.

The original Django accessors use our polymorphic manager. But they should not. So we replace them with our own accessors that use our appropriate base_objects manager.

async adelete(using=None, keep_parents=False)[source]
archived[source]

Type: BooleanField

Archived. Whether or not the feedback is archived

async arefresh_from_db(using=None, fields=None)[source]
async asave(force_insert=False, force_update=False, using=None, update_fields=None)[source]
property category: str[source]

This property returns the category (verbose name of the submodel) of this feedback object.

Returns:

capitalized category

classmethod check(**kwargs)[source]
clean()[source]

Hook for doing any extra model-wide validation after clean() has been called on every field by self.clean_fields. Any ValidationError raised by this method will not be associated with a particular field; it will have a special-case association with the field defined by NON_FIELD_ERRORS.

clean_fields(exclude=None)[source]

Clean all fields and raise a ValidationError containing a dict of all validation errors if any occur.

comment[source]

Type: TextField

Comment

created_date[source]

Type: DateTimeField

Creation date

date_error_message(lookup_type, field_name, unique_for)[source]
delete(using=None, keep_parents=False)[source]
eventfeedback[source]

Type: Reverse OneToOneField from EventFeedback

The event feedback of this feedback (related name of feedback_ptr)

eventlistfeedback[source]

Type: Reverse OneToOneField from EventListFeedback

The event list feedback of this feedback (related name of feedback_ptr)

classmethod from_db(db, field_names, values)[source]
full_clean(exclude=None, validate_unique=True, validate_constraints=True)[source]

Call clean_fields(), clean(), validate_unique(), and validate_constraints() on the model. Raise a ValidationError for any errors that occur.

get_constraints()[source]
get_deferred_fields()[source]

Return a set containing names of deferred fields for this instance.

classmethod get_model_name_plural() str[source]

Get the plural representation of this model name

Returns:

The plural model name

Return type:

str

get_next_by_created_date(*, field=<django.db.models.DateTimeField: created_date>, is_next=True, **kwargs)[source]

Finds next instance based on created_date. See get_next_by_FOO() for more information.

get_previous_by_created_date(*, field=<django.db.models.DateTimeField: created_date>, is_next=False, **kwargs)[source]

Finds previous instance based on created_date. See get_previous_by_FOO() for more information.

get_rating_display(*, field=<django.db.models.BooleanField: rating>)[source]

Shows the label of the rating. See get_FOO_display() for more information.

get_real_concrete_instance_class()[source]
get_real_concrete_instance_class_id()[source]
get_real_instance()[source]

Upcast an object to it’s actual type.

If a non-polymorphic manager (like base_objects) has been used to retrieve objects, then the complete object with it’s real class/type and all fields may be retrieved with this method.

Note

Each method call executes one db query (if necessary). Use the get_real_instances() to upcast a complete list in a single efficient query.

get_real_instance_class()[source]

Return the actual model type of the object.

If a non-polymorphic manager (like base_objects) has been used to retrieve objects, then the real class/type of these objects may be determined using this method.

get_repr() str[source]

This overwrites the default Django __repr__() method which would return <Feedback: Feedback object (id)>. It is used for logging.

Returns:

The canonical string representation of the feedback

Return type:

str

id[source]

Type: BigAutoField

Primary key: ID

imprintpagefeedback[source]

Type: Reverse OneToOneField from ImprintPageFeedback

The imprint feedback of this feedback (related name of feedback_ptr)

is_technical[source]

Type: BooleanField

Technical. Whether or not the feedback is targeted at the developers

language[source]

Type: ForeignKey to Language

Language (related name: feedback)

language_id[source]

Internal field, use language instead.

mapfeedback[source]

Type: Reverse OneToOneField from MapFeedback

The map feedback of this feedback (related name of feedback_ptr)

objects = <integreat_cms.cms.models.feedback.feedback.CascadeDeletePolymorphicManager object>[source]
offerfeedback[source]

Type: Reverse OneToOneField from OfferFeedback

The offer feedback of this feedback (related name of feedback_ptr)

offerlistfeedback[source]

Type: Reverse OneToOneField from OfferListFeedback

The offer list feedback of this feedback (related name of feedback_ptr)

pagefeedback[source]

Type: Reverse OneToOneField from PageFeedback

The page feedback of this feedback (related name of feedback_ptr)

property pk[source]
poifeedback[source]

Type: Reverse OneToOneField from POIFeedback

The location feedback of this feedback (related name of feedback_ptr)

polymorphic_ctype[source]

Type: ForeignKey to ContentType

Polymorphic ctype (related name: feedback_set+)

The model field that stores the ContentType reference to the actual class.

polymorphic_ctype_id[source]

Internal field, use polymorphic_ctype instead.

polymorphic_internal_model_fields = ['polymorphic_ctype'][source]
polymorphic_model_marker = True[source]
polymorphic_query_multiline_output = False[source]
pre_save_polymorphic(using='default')[source]

Make sure the polymorphic_ctype value is correctly set on this model.

prepare_database_save(field)[source]
rating[source]

Type: BooleanField

Rating. Whether the feedback is positive or negative

Choices:

  • True

  • False

  • None

Manage choices in feedback_ratings

rating_sum_negative[source]

This property returns the sum of the down-ratings of this object.

Returns:

The number of negative ratings on this feedback object

rating_sum_positive[source]

This property returns the sum of the up-ratings of this object.

Returns:

The number of positive ratings on this feedback object

property read: bool[source]

This property returns whether or not the feedback is marked as read or not. It is True if read_by is set and False otherwise.

Returns:

Whether the feedback is marked as read

read_by[source]

Type: ForeignKey to User

Marked as read by. The account that marked this feedback as read. If the feedback is unread, this field is empty. (related name: feedback)

read_by_id[source]

Internal field, use read_by instead.

refresh_from_db(using=None, fields=None)[source]

Reload field values from the database.

By default, the reloading happens from the database this instance was loaded from, or by the read router if this instance wasn’t loaded from any database. The using parameter will override the default.

Fields can be used to specify which fields to reload. The fields should be an iterable of field attnames. If fields is None, then all non-deferred fields are reloaded.

When accessing deferred fields of an instance, the deferred loading of the field will call this method.

region[source]

Type: ForeignKey to Region

Region (related name: feedback)

region_id[source]

Internal field, use region instead.

regionfeedback[source]

Type: Reverse OneToOneField from RegionFeedback

The region feedback of this feedback (related name of feedback_ptr)

save(*args, **kwargs)[source]

Calls pre_save_polymorphic() and saves the model.

save_base(raw=False, force_insert=False, force_update=False, using=None, update_fields=None)[source]

Handle the parts of saving which should be done only once per save, yet need to be done in raw saves, too. This includes some sanity checks and signal sending.

The ‘raw’ argument is telling save_base not to save any parent models and not to do any changes to the values before save. This is used by fixture loading.

classmethod search(region: Region | None, query: str) QuerySet[source]

Searches for all feedbacks which match the given query in their comment. :param region: The current region or None for non-regional feedback :param query: The query string used for filtering the events :return: A query for all matching objects

Parameters:
Return type:

QuerySet

searchresultfeedback[source]

Type: Reverse OneToOneField from SearchResultFeedback

The search result feedback of this feedback (related name of feedback_ptr)

serializable_value(field_name)[source]

Return the value of the field name for this instance. If the field is a foreign key, return the id value instead of the object. If there’s no Field object with this name on the model, return the model attribute’s value.

Used to serialize a field’s value (in the serializer, or form output, for example). Normally, you would just access the attribute directly and not use this method.

classmethod translate_polymorphic_Q_object(q)[source]
unique_error_message(model_class, unique_check)[source]
validate_constraints(exclude=None)[source]
validate_unique(exclude=None)[source]

Check unique constraints on the model and raise ValidationError if any failed.

Imprint Page Feedback

class integreat_cms.cms.models.feedback.imprint_page_feedback.ImprintPageFeedback(*args, **kwargs)[source]

Bases: Feedback

Database model representing feedback about imprint pages.

Parameters:
  • id (BigAutoField) – Primary key: ID

  • rating (BooleanField) – Rating. Whether the feedback is positive or negative

  • comment (TextField) – Comment

  • is_technical (BooleanField) – Technical. Whether or not the feedback is targeted at the developers

  • archived (BooleanField) – Archived. Whether or not the feedback is archived

  • created_date (DateTimeField) – Creation date

Relationship fields:

Parameters:
exception DoesNotExist[source]

Bases: DoesNotExist

__init__(*args, **kwargs)[source]
add_note()[source]

Exception.add_note(note) – add a note to the exception

args[source]
silent_variable_failure = True[source]
with_traceback()[source]

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception MultipleObjectsReturned[source]

Bases: MultipleObjectsReturned

__init__(*args, **kwargs)[source]
add_note()[source]

Exception.add_note(note) – add a note to the exception

args[source]
with_traceback()[source]

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

__init__(*args, **kwargs)[source]

Replace Django’s inheritance accessor member functions for our model (self.__class__) with our own versions. We monkey patch them until a patch can be added to Django (which would probably be very small and make all of this obsolete).

If we have inheritance of the form ModelA -> ModelB ->ModelC then Django creates accessors like this: - ModelA: modelb - ModelB: modela_ptr, modelb, modelc - ModelC: modela_ptr, modelb, modelb_ptr, modelc

These accessors allow Django (and everyone else) to travel up and down the inheritance tree for the db object at hand.

The original Django accessors use our polymorphic manager. But they should not. So we replace them with our own accessors that use our appropriate base_objects manager.

async adelete(using=None, keep_parents=False)[source]
archived[source]

Type: BooleanField

Archived. Whether or not the feedback is archived

async arefresh_from_db(using=None, fields=None)[source]
async asave(force_insert=False, force_update=False, using=None, update_fields=None)[source]
property category: str[source]

This property returns the category (verbose name of the submodel) of this feedback object.

Returns:

capitalized category

classmethod check(**kwargs)[source]
clean()[source]

Hook for doing any extra model-wide validation after clean() has been called on every field by self.clean_fields. Any ValidationError raised by this method will not be associated with a particular field; it will have a special-case association with the field defined by NON_FIELD_ERRORS.

clean_fields(exclude=None)[source]

Clean all fields and raise a ValidationError containing a dict of all validation errors if any occur.

comment[source]

Type: TextField

Comment

created_date[source]

Type: DateTimeField

Creation date

date_error_message(lookup_type, field_name, unique_for)[source]
delete(using=None, keep_parents=False)[source]
eventfeedback[source]

Type: Reverse OneToOneField from EventFeedback

The event feedback of this feedback (related name of feedback_ptr)

eventlistfeedback[source]

Type: Reverse OneToOneField from EventListFeedback

The event list feedback of this feedback (related name of feedback_ptr)

feedback_ptr[source]

Type: OneToOneField to Feedback

Primary key: Feedback ptr (related name: imprintpagefeedback)

feedback_ptr_id[source]

Internal field, use feedback_ptr instead.

classmethod from_db(db, field_names, values)[source]
full_clean(exclude=None, validate_unique=True, validate_constraints=True)[source]

Call clean_fields(), clean(), validate_unique(), and validate_constraints() on the model. Raise a ValidationError for any errors that occur.

get_constraints()[source]
get_deferred_fields()[source]

Return a set containing names of deferred fields for this instance.

classmethod get_model_name_plural() str[source]

Get the plural representation of this model name

Returns:

The plural model name

Return type:

str

get_next_by_created_date(*, field=<django.db.models.DateTimeField: created_date>, is_next=True, **kwargs)[source]

Finds next instance based on created_date. See get_next_by_FOO() for more information.

get_previous_by_created_date(*, field=<django.db.models.DateTimeField: created_date>, is_next=False, **kwargs)[source]

Finds previous instance based on created_date. See get_previous_by_FOO() for more information.

get_rating_display(*, field=<django.db.models.BooleanField: rating>)[source]

Shows the label of the rating. See get_FOO_display() for more information.

get_real_concrete_instance_class()[source]
get_real_concrete_instance_class_id()[source]
get_real_instance()[source]

Upcast an object to it’s actual type.

If a non-polymorphic manager (like base_objects) has been used to retrieve objects, then the complete object with it’s real class/type and all fields may be retrieved with this method.

Note

Each method call executes one db query (if necessary). Use the get_real_instances() to upcast a complete list in a single efficient query.

get_real_instance_class()[source]

Return the actual model type of the object.

If a non-polymorphic manager (like base_objects) has been used to retrieve objects, then the real class/type of these objects may be determined using this method.

get_repr() str[source]

This overwrites the default Django __repr__() method which would return <Feedback: Feedback object (id)>. It is used for logging.

Returns:

The canonical string representation of the feedback

Return type:

str

id[source]

Type: BigAutoField

Primary key: ID

imprintpagefeedback[source]

Type: Reverse OneToOneField from ImprintPageFeedback

The imprint feedback of this feedback (related name of feedback_ptr)

is_technical[source]

Type: BooleanField

Technical. Whether or not the feedback is targeted at the developers

language[source]

Type: ForeignKey to Language

Language (related name: feedback)

language_id[source]

Internal field, use language instead.

mapfeedback[source]

Type: Reverse OneToOneField from MapFeedback

The map feedback of this feedback (related name of feedback_ptr)

property object_name: str[source]

This property returns the name of the object this feedback comments on.

Returns:

The name of the object this feedback refers to

object_url[source]

This property returns the url to the object this feedback comments on.

Returns:

The url to the referred object

objects = <integreat_cms.cms.models.feedback.feedback.CascadeDeletePolymorphicManager object>[source]
offerfeedback[source]

Type: Reverse OneToOneField from OfferFeedback

The offer feedback of this feedback (related name of feedback_ptr)

offerlistfeedback[source]

Type: Reverse OneToOneField from OfferListFeedback

The offer list feedback of this feedback (related name of feedback_ptr)

pagefeedback[source]

Type: Reverse OneToOneField from PageFeedback

The page feedback of this feedback (related name of feedback_ptr)

property pk[source]
poifeedback[source]

Type: Reverse OneToOneField from POIFeedback

The location feedback of this feedback (related name of feedback_ptr)

polymorphic_ctype[source]

Type: ForeignKey to ContentType

Polymorphic ctype (related name: feedback_set+)

The model field that stores the ContentType reference to the actual class.

polymorphic_ctype_id[source]

Internal field, use polymorphic_ctype instead.

polymorphic_internal_model_fields = ['polymorphic_ctype'][source]
polymorphic_model_marker = True[source]
polymorphic_query_multiline_output = False[source]
pre_save_polymorphic(using='default')[source]

Make sure the polymorphic_ctype value is correctly set on this model.

prepare_database_save(field)[source]
rating[source]

Type: BooleanField

Rating. Whether the feedback is positive or negative

Choices:

  • True

  • False

  • None

Manage choices in feedback_ratings

rating_sum_negative[source]

This property returns the sum of the down-ratings of this object.

Returns:

The number of negative ratings on this feedback object

rating_sum_positive[source]

This property returns the sum of the up-ratings of this object.

Returns:

The number of positive ratings on this feedback object

property read: bool[source]

This property returns whether or not the feedback is marked as read or not. It is True if read_by is set and False otherwise.

Returns:

Whether the feedback is marked as read

read_by[source]

Type: ForeignKey to User

Marked as read by. The account that marked this feedback as read. If the feedback is unread, this field is empty. (related name: feedback)

read_by_id[source]

Internal field, use read_by instead.

refresh_from_db(using=None, fields=None)[source]

Reload field values from the database.

By default, the reloading happens from the database this instance was loaded from, or by the read router if this instance wasn’t loaded from any database. The using parameter will override the default.

Fields can be used to specify which fields to reload. The fields should be an iterable of field attnames. If fields is None, then all non-deferred fields are reloaded.

When accessing deferred fields of an instance, the deferred loading of the field will call this method.

region[source]

Type: ForeignKey to Region

Region (related name: feedback)

region_id[source]

Internal field, use region instead.

regionfeedback[source]

Type: Reverse OneToOneField from RegionFeedback

The region feedback of this feedback (related name of feedback_ptr)

property related_feedback: QuerySet[ImprintPageFeedback][source]

This property returns all feedback entries which relate to the same object and have the same is_technical value.

Returns:

The queryset of related feedback

save(*args, **kwargs)[source]

Calls pre_save_polymorphic() and saves the model.

save_base(raw=False, force_insert=False, force_update=False, using=None, update_fields=None)[source]

Handle the parts of saving which should be done only once per save, yet need to be done in raw saves, too. This includes some sanity checks and signal sending.

The ‘raw’ argument is telling save_base not to save any parent models and not to do any changes to the values before save. This is used by fixture loading.

classmethod search(region: Region | None, query: str) QuerySet[source]

Searches for all feedbacks which match the given query in their comment. :param region: The current region or None for non-regional feedback :param query: The query string used for filtering the events :return: A query for all matching objects

Parameters:
Return type:

QuerySet

searchresultfeedback[source]

Type: Reverse OneToOneField from SearchResultFeedback

The search result feedback of this feedback (related name of feedback_ptr)

serializable_value(field_name)[source]

Return the value of the field name for this instance. If the field is a foreign key, return the id value instead of the object. If there’s no Field object with this name on the model, return the model attribute’s value.

Used to serialize a field’s value (in the serializer, or form output, for example). Normally, you would just access the attribute directly and not use this method.

classmethod translate_polymorphic_Q_object(q)[source]
unique_error_message(model_class, unique_check)[source]
validate_constraints(exclude=None)[source]
validate_unique(exclude=None)[source]

Check unique constraints on the model and raise ValidationError if any failed.

Map Feedback

class integreat_cms.cms.models.feedback.map_feedback.MapFeedback(*args, **kwargs)[source]

Bases: Feedback

Database model representing feedback about the map (e.g. missing pois).

Parameters:
  • id (BigAutoField) – Primary key: ID

  • rating (BooleanField) – Rating. Whether the feedback is positive or negative

  • comment (TextField) – Comment

  • is_technical (BooleanField) – Technical. Whether or not the feedback is targeted at the developers

  • archived (BooleanField) – Archived. Whether or not the feedback is archived

  • created_date (DateTimeField) – Creation date

Relationship fields:

Parameters:
exception DoesNotExist[source]

Bases: DoesNotExist

__init__(*args, **kwargs)[source]
add_note()[source]

Exception.add_note(note) – add a note to the exception

args[source]
silent_variable_failure = True[source]
with_traceback()[source]

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception MultipleObjectsReturned[source]

Bases: MultipleObjectsReturned

__init__(*args, **kwargs)[source]
add_note()[source]

Exception.add_note(note) – add a note to the exception

args[source]
with_traceback()[source]

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

__init__(*args, **kwargs)[source]

Replace Django’s inheritance accessor member functions for our model (self.__class__) with our own versions. We monkey patch them until a patch can be added to Django (which would probably be very small and make all of this obsolete).

If we have inheritance of the form ModelA -> ModelB ->ModelC then Django creates accessors like this: - ModelA: modelb - ModelB: modela_ptr, modelb, modelc - ModelC: modela_ptr, modelb, modelb_ptr, modelc

These accessors allow Django (and everyone else) to travel up and down the inheritance tree for the db object at hand.

The original Django accessors use our polymorphic manager. But they should not. So we replace them with our own accessors that use our appropriate base_objects manager.

async adelete(using=None, keep_parents=False)[source]
archived[source]

Type: BooleanField

Archived. Whether or not the feedback is archived

async arefresh_from_db(using=None, fields=None)[source]
async asave(force_insert=False, force_update=False, using=None, update_fields=None)[source]
property category: str[source]

This property returns the category (verbose name of the submodel) of this feedback object.

Returns:

capitalized category

classmethod check(**kwargs)[source]
clean()[source]

Hook for doing any extra model-wide validation after clean() has been called on every field by self.clean_fields. Any ValidationError raised by this method will not be associated with a particular field; it will have a special-case association with the field defined by NON_FIELD_ERRORS.

clean_fields(exclude=None)[source]

Clean all fields and raise a ValidationError containing a dict of all validation errors if any occur.

comment[source]

Type: TextField

Comment

created_date[source]

Type: DateTimeField

Creation date

date_error_message(lookup_type, field_name, unique_for)[source]
delete(using=None, keep_parents=False)[source]
eventfeedback[source]

Type: Reverse OneToOneField from EventFeedback

The event feedback of this feedback (related name of feedback_ptr)

eventlistfeedback[source]

Type: Reverse OneToOneField from EventListFeedback

The event list feedback of this feedback (related name of feedback_ptr)

feedback_ptr[source]

Type: OneToOneField to Feedback

Primary key: Feedback ptr (related name: mapfeedback)

feedback_ptr_id[source]

Internal field, use feedback_ptr instead.

classmethod from_db(db, field_names, values)[source]
full_clean(exclude=None, validate_unique=True, validate_constraints=True)[source]

Call clean_fields(), clean(), validate_unique(), and validate_constraints() on the model. Raise a ValidationError for any errors that occur.

get_constraints()[source]
get_deferred_fields()[source]

Return a set containing names of deferred fields for this instance.

classmethod get_model_name_plural() str[source]

Get the plural representation of this model name

Returns:

The plural model name

Return type:

str

get_next_by_created_date(*, field=<django.db.models.DateTimeField: created_date>, is_next=True, **kwargs)[source]

Finds next instance based on created_date. See get_next_by_FOO() for more information.

get_previous_by_created_date(*, field=<django.db.models.DateTimeField: created_date>, is_next=False, **kwargs)[source]

Finds previous instance based on created_date. See get_previous_by_FOO() for more information.

get_rating_display(*, field=<django.db.models.BooleanField: rating>)[source]

Shows the label of the rating. See get_FOO_display() for more information.

get_real_concrete_instance_class()[source]
get_real_concrete_instance_class_id()[source]
get_real_instance()[source]

Upcast an object to it’s actual type.

If a non-polymorphic manager (like base_objects) has been used to retrieve objects, then the complete object with it’s real class/type and all fields may be retrieved with this method.

Note

Each method call executes one db query (if necessary). Use the get_real_instances() to upcast a complete list in a single efficient query.

get_real_instance_class()[source]

Return the actual model type of the object.

If a non-polymorphic manager (like base_objects) has been used to retrieve objects, then the real class/type of these objects may be determined using this method.

get_repr() str[source]

This overwrites the default Django __repr__() method which would return <Feedback: Feedback object (id)>. It is used for logging.

Returns:

The canonical string representation of the feedback

Return type:

str

id[source]

Type: BigAutoField

Primary key: ID

imprintpagefeedback[source]

Type: Reverse OneToOneField from ImprintPageFeedback

The imprint feedback of this feedback (related name of feedback_ptr)

is_technical[source]

Type: BooleanField

Technical. Whether or not the feedback is targeted at the developers

language[source]

Type: ForeignKey to Language

Language (related name: feedback)

language_id[source]

Internal field, use language instead.

mapfeedback[source]

Type: Reverse OneToOneField from MapFeedback

The map feedback of this feedback (related name of feedback_ptr)

property object_name: str[source]

This property returns the name of the object this feedback comments on.

Returns:

The name of the object this feedback refers to

object_url[source]

This property returns the url to the object this feedback comments on.

Returns:

The url to the referred object

objects = <integreat_cms.cms.models.feedback.feedback.CascadeDeletePolymorphicManager object>[source]
offerfeedback[source]

Type: Reverse OneToOneField from OfferFeedback

The offer feedback of this feedback (related name of feedback_ptr)

offerlistfeedback[source]

Type: Reverse OneToOneField from OfferListFeedback

The offer list feedback of this feedback (related name of feedback_ptr)

pagefeedback[source]

Type: Reverse OneToOneField from PageFeedback

The page feedback of this feedback (related name of feedback_ptr)

property pk[source]
poifeedback[source]

Type: Reverse OneToOneField from POIFeedback

The location feedback of this feedback (related name of feedback_ptr)

polymorphic_ctype[source]

Type: ForeignKey to ContentType

Polymorphic ctype (related name: feedback_set+)

The model field that stores the ContentType reference to the actual class.

polymorphic_ctype_id[source]

Internal field, use polymorphic_ctype instead.

polymorphic_internal_model_fields = ['polymorphic_ctype'][source]
polymorphic_model_marker = True[source]
polymorphic_query_multiline_output = False[source]
pre_save_polymorphic(using='default')[source]

Make sure the polymorphic_ctype value is correctly set on this model.

prepare_database_save(field)[source]
rating[source]

Type: BooleanField

Rating. Whether the feedback is positive or negative

Choices:

  • True

  • False

  • None

Manage choices in feedback_ratings

rating_sum_negative[source]

This property returns the sum of the down-ratings of this object.

Returns:

The number of negative ratings on this feedback object

rating_sum_positive[source]

This property returns the sum of the up-ratings of this object.

Returns:

The number of positive ratings on this feedback object

property read: bool[source]

This property returns whether or not the feedback is marked as read or not. It is True if read_by is set and False otherwise.

Returns:

Whether the feedback is marked as read

read_by[source]

Type: ForeignKey to User

Marked as read by. The account that marked this feedback as read. If the feedback is unread, this field is empty. (related name: feedback)

read_by_id[source]

Internal field, use read_by instead.

refresh_from_db(using=None, fields=None)[source]

Reload field values from the database.

By default, the reloading happens from the database this instance was loaded from, or by the read router if this instance wasn’t loaded from any database. The using parameter will override the default.

Fields can be used to specify which fields to reload. The fields should be an iterable of field attnames. If fields is None, then all non-deferred fields are reloaded.

When accessing deferred fields of an instance, the deferred loading of the field will call this method.

region[source]

Type: ForeignKey to Region

Region (related name: feedback)

region_id[source]

Internal field, use region instead.

regionfeedback[source]

Type: Reverse OneToOneField from RegionFeedback

The region feedback of this feedback (related name of feedback_ptr)

property related_feedback: QuerySet[MapFeedback][source]

This property returns all feedback entries which relate to the same object and have the same is_technical value.

Returns:

The queryset of related feedback

save(*args, **kwargs)[source]

Calls pre_save_polymorphic() and saves the model.

save_base(raw=False, force_insert=False, force_update=False, using=None, update_fields=None)[source]

Handle the parts of saving which should be done only once per save, yet need to be done in raw saves, too. This includes some sanity checks and signal sending.

The ‘raw’ argument is telling save_base not to save any parent models and not to do any changes to the values before save. This is used by fixture loading.

classmethod search(region: Region | None, query: str) QuerySet[source]

Searches for all feedbacks which match the given query in their comment. :param region: The current region or None for non-regional feedback :param query: The query string used for filtering the events :return: A query for all matching objects

Parameters:
Return type:

QuerySet

searchresultfeedback[source]

Type: Reverse OneToOneField from SearchResultFeedback

The search result feedback of this feedback (related name of feedback_ptr)

serializable_value(field_name)[source]

Return the value of the field name for this instance. If the field is a foreign key, return the id value instead of the object. If there’s no Field object with this name on the model, return the model attribute’s value.

Used to serialize a field’s value (in the serializer, or form output, for example). Normally, you would just access the attribute directly and not use this method.

classmethod translate_polymorphic_Q_object(q)[source]
unique_error_message(model_class, unique_check)[source]
validate_constraints(exclude=None)[source]
validate_unique(exclude=None)[source]

Check unique constraints on the model and raise ValidationError if any failed.

Offer Feedback

class integreat_cms.cms.models.feedback.offer_feedback.OfferFeedback(*args, **kwargs)[source]

Bases: Feedback

Database model representing feedback about offers.

Parameters:
  • id (BigAutoField) – Primary key: ID

  • rating (BooleanField) – Rating. Whether the feedback is positive or negative

  • comment (TextField) – Comment

  • is_technical (BooleanField) – Technical. Whether or not the feedback is targeted at the developers

  • archived (BooleanField) – Archived. Whether or not the feedback is archived

  • created_date (DateTimeField) – Creation date

Relationship fields:

Parameters:
exception DoesNotExist[source]

Bases: DoesNotExist

__init__(*args, **kwargs)[source]
add_note()[source]

Exception.add_note(note) – add a note to the exception

args[source]
silent_variable_failure = True[source]
with_traceback()[source]

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception MultipleObjectsReturned[source]

Bases: MultipleObjectsReturned

__init__(*args, **kwargs)[source]
add_note()[source]

Exception.add_note(note) – add a note to the exception

args[source]
with_traceback()[source]

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

__init__(*args, **kwargs)[source]

Replace Django’s inheritance accessor member functions for our model (self.__class__) with our own versions. We monkey patch them until a patch can be added to Django (which would probably be very small and make all of this obsolete).

If we have inheritance of the form ModelA -> ModelB ->ModelC then Django creates accessors like this: - ModelA: modelb - ModelB: modela_ptr, modelb, modelc - ModelC: modela_ptr, modelb, modelb_ptr, modelc

These accessors allow Django (and everyone else) to travel up and down the inheritance tree for the db object at hand.

The original Django accessors use our polymorphic manager. But they should not. So we replace them with our own accessors that use our appropriate base_objects manager.

async adelete(using=None, keep_parents=False)[source]
archived[source]

Type: BooleanField

Archived. Whether or not the feedback is archived

async arefresh_from_db(using=None, fields=None)[source]
async asave(force_insert=False, force_update=False, using=None, update_fields=None)[source]
property category: str[source]

This property returns the category (verbose name of the submodel) of this feedback object.

Returns:

capitalized category

classmethod check(**kwargs)[source]
clean()[source]

Hook for doing any extra model-wide validation after clean() has been called on every field by self.clean_fields. Any ValidationError raised by this method will not be associated with a particular field; it will have a special-case association with the field defined by NON_FIELD_ERRORS.

clean_fields(exclude=None)[source]

Clean all fields and raise a ValidationError containing a dict of all validation errors if any occur.

comment[source]

Type: TextField

Comment

created_date[source]

Type: DateTimeField

Creation date

date_error_message(lookup_type, field_name, unique_for)[source]
delete(using=None, keep_parents=False)[source]
eventfeedback[source]

Type: Reverse OneToOneField from EventFeedback

The event feedback of this feedback (related name of feedback_ptr)

eventlistfeedback[source]

Type: Reverse OneToOneField from EventListFeedback

The event list feedback of this feedback (related name of feedback_ptr)

feedback_ptr[source]

Type: OneToOneField to Feedback

Primary key: Feedback ptr (related name: offerfeedback)

feedback_ptr_id[source]

Internal field, use feedback_ptr instead.

classmethod from_db(db, field_names, values)[source]
full_clean(exclude=None, validate_unique=True, validate_constraints=True)[source]

Call clean_fields(), clean(), validate_unique(), and validate_constraints() on the model. Raise a ValidationError for any errors that occur.

get_constraints()[source]
get_deferred_fields()[source]

Return a set containing names of deferred fields for this instance.

classmethod get_model_name_plural() str[source]

Get the plural representation of this model name

Returns:

The plural model name

Return type:

str

get_next_by_created_date(*, field=<django.db.models.DateTimeField: created_date>, is_next=True, **kwargs)[source]

Finds next instance based on created_date. See get_next_by_FOO() for more information.

get_previous_by_created_date(*, field=<django.db.models.DateTimeField: created_date>, is_next=False, **kwargs)[source]

Finds previous instance based on created_date. See get_previous_by_FOO() for more information.

get_rating_display(*, field=<django.db.models.BooleanField: rating>)[source]

Shows the label of the rating. See get_FOO_display() for more information.

get_real_concrete_instance_class()[source]
get_real_concrete_instance_class_id()[source]
get_real_instance()[source]

Upcast an object to it’s actual type.

If a non-polymorphic manager (like base_objects) has been used to retrieve objects, then the complete object with it’s real class/type and all fields may be retrieved with this method.

Note

Each method call executes one db query (if necessary). Use the get_real_instances() to upcast a complete list in a single efficient query.

get_real_instance_class()[source]

Return the actual model type of the object.

If a non-polymorphic manager (like base_objects) has been used to retrieve objects, then the real class/type of these objects may be determined using this method.

get_repr() str[source]

This overwrites the default Django __repr__() method which would return <Feedback: Feedback object (id)>. It is used for logging.

Returns:

The canonical string representation of the feedback

Return type:

str

id[source]

Type: BigAutoField

Primary key: ID

imprintpagefeedback[source]

Type: Reverse OneToOneField from ImprintPageFeedback

The imprint feedback of this feedback (related name of feedback_ptr)

is_technical[source]

Type: BooleanField

Technical. Whether or not the feedback is targeted at the developers

language[source]

Type: ForeignKey to Language

Language (related name: feedback)

language_id[source]

Internal field, use language instead.

mapfeedback[source]

Type: Reverse OneToOneField from MapFeedback

The map feedback of this feedback (related name of feedback_ptr)

property object_name: str[source]

This property returns the name of the object this feedback comments on.

Returns:

The name of the object this feedback refers to

object_url[source]

This property returns the url to the object this feedback comments on.

Returns:

The url to the referred object

objects = <integreat_cms.cms.models.feedback.feedback.CascadeDeletePolymorphicManager object>[source]
offer[source]

Type: ForeignKey to OfferTemplate

Offer (related name: feedback)

offer_id[source]

Internal field, use offer instead.

offerfeedback[source]

Type: Reverse OneToOneField from OfferFeedback

The offer feedback of this feedback (related name of feedback_ptr)

offerlistfeedback[source]

Type: Reverse OneToOneField from OfferListFeedback

The offer list feedback of this feedback (related name of feedback_ptr)

pagefeedback[source]

Type: Reverse OneToOneField from PageFeedback

The page feedback of this feedback (related name of feedback_ptr)

property pk[source]
poifeedback[source]

Type: Reverse OneToOneField from POIFeedback

The location feedback of this feedback (related name of feedback_ptr)

polymorphic_ctype[source]

Type: ForeignKey to ContentType

Polymorphic ctype (related name: feedback_set+)

The model field that stores the ContentType reference to the actual class.

polymorphic_ctype_id[source]

Internal field, use polymorphic_ctype instead.

polymorphic_internal_model_fields = ['polymorphic_ctype'][source]
polymorphic_model_marker = True[source]
polymorphic_query_multiline_output = False[source]
pre_save_polymorphic(using='default')[source]

Make sure the polymorphic_ctype value is correctly set on this model.

prepare_database_save(field)[source]
rating[source]

Type: BooleanField

Rating. Whether the feedback is positive or negative

Choices:

  • True

  • False

  • None

Manage choices in feedback_ratings

rating_sum_negative[source]

This property returns the sum of the down-ratings of this object.

Returns:

The number of negative ratings on this feedback object

rating_sum_positive[source]

This property returns the sum of the up-ratings of this object.

Returns:

The number of positive ratings on this feedback object

property read: bool[source]

This property returns whether or not the feedback is marked as read or not. It is True if read_by is set and False otherwise.

Returns:

Whether the feedback is marked as read

read_by[source]

Type: ForeignKey to User

Marked as read by. The account that marked this feedback as read. If the feedback is unread, this field is empty. (related name: feedback)

read_by_id[source]

Internal field, use read_by instead.

refresh_from_db(using=None, fields=None)[source]

Reload field values from the database.

By default, the reloading happens from the database this instance was loaded from, or by the read router if this instance wasn’t loaded from any database. The using parameter will override the default.

Fields can be used to specify which fields to reload. The fields should be an iterable of field attnames. If fields is None, then all non-deferred fields are reloaded.

When accessing deferred fields of an instance, the deferred loading of the field will call this method.

region[source]

Type: ForeignKey to Region

Region (related name: feedback)

region_id[source]

Internal field, use region instead.

regionfeedback[source]

Type: Reverse OneToOneField from RegionFeedback

The region feedback of this feedback (related name of feedback_ptr)

property related_feedback: QuerySet[OfferFeedback][source]

This property returns all feedback entries which relate to the same object and have the same is_technical value.

Returns:

The queryset of related feedback

save(*args, **kwargs)[source]

Calls pre_save_polymorphic() and saves the model.

save_base(raw=False, force_insert=False, force_update=False, using=None, update_fields=None)[source]

Handle the parts of saving which should be done only once per save, yet need to be done in raw saves, too. This includes some sanity checks and signal sending.

The ‘raw’ argument is telling save_base not to save any parent models and not to do any changes to the values before save. This is used by fixture loading.

classmethod search(region: Region | None, query: str) QuerySet[source]

Searches for all feedbacks which match the given query in their comment. :param region: The current region or None for non-regional feedback :param query: The query string used for filtering the events :return: A query for all matching objects

Parameters:
Return type:

QuerySet

searchresultfeedback[source]

Type: Reverse OneToOneField from SearchResultFeedback

The search result feedback of this feedback (related name of feedback_ptr)

serializable_value(field_name)[source]

Return the value of the field name for this instance. If the field is a foreign key, return the id value instead of the object. If there’s no Field object with this name on the model, return the model attribute’s value.

Used to serialize a field’s value (in the serializer, or form output, for example). Normally, you would just access the attribute directly and not use this method.

classmethod translate_polymorphic_Q_object(q)[source]
unique_error_message(model_class, unique_check)[source]
validate_constraints(exclude=None)[source]
validate_unique(exclude=None)[source]

Check unique constraints on the model and raise ValidationError if any failed.

Offer List Feedback

class integreat_cms.cms.models.feedback.offer_list_feedback.OfferListFeedback(*args, **kwargs)[source]

Bases: Feedback

Database model representing feedback about the offer list (e.g. missing offers).

Parameters:
  • id (BigAutoField) – Primary key: ID

  • rating (BooleanField) – Rating. Whether the feedback is positive or negative

  • comment (TextField) – Comment

  • is_technical (BooleanField) – Technical. Whether or not the feedback is targeted at the developers

  • archived (BooleanField) – Archived. Whether or not the feedback is archived

  • created_date (DateTimeField) – Creation date

Relationship fields:

Parameters:
exception DoesNotExist[source]

Bases: DoesNotExist

__init__(*args, **kwargs)[source]
add_note()[source]

Exception.add_note(note) – add a note to the exception

args[source]
silent_variable_failure = True[source]
with_traceback()[source]

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception MultipleObjectsReturned[source]

Bases: MultipleObjectsReturned

__init__(*args, **kwargs)[source]
add_note()[source]

Exception.add_note(note) – add a note to the exception

args[source]
with_traceback()[source]

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

__init__(*args, **kwargs)[source]

Replace Django’s inheritance accessor member functions for our model (self.__class__) with our own versions. We monkey patch them until a patch can be added to Django (which would probably be very small and make all of this obsolete).

If we have inheritance of the form ModelA -> ModelB ->ModelC then Django creates accessors like this: - ModelA: modelb - ModelB: modela_ptr, modelb, modelc - ModelC: modela_ptr, modelb, modelb_ptr, modelc

These accessors allow Django (and everyone else) to travel up and down the inheritance tree for the db object at hand.

The original Django accessors use our polymorphic manager. But they should not. So we replace them with our own accessors that use our appropriate base_objects manager.

async adelete(using=None, keep_parents=False)[source]
archived[source]

Type: BooleanField

Archived. Whether or not the feedback is archived

async arefresh_from_db(using=None, fields=None)[source]
async asave(force_insert=False, force_update=False, using=None, update_fields=None)[source]
property category: str[source]

This property returns the category (verbose name of the submodel) of this feedback object.

Returns:

capitalized category

classmethod check(**kwargs)[source]
clean()[source]

Hook for doing any extra model-wide validation after clean() has been called on every field by self.clean_fields. Any ValidationError raised by this method will not be associated with a particular field; it will have a special-case association with the field defined by NON_FIELD_ERRORS.

clean_fields(exclude=None)[source]

Clean all fields and raise a ValidationError containing a dict of all validation errors if any occur.

comment[source]

Type: TextField

Comment

created_date[source]

Type: DateTimeField

Creation date

date_error_message(lookup_type, field_name, unique_for)[source]
delete(using=None, keep_parents=False)[source]
eventfeedback[source]

Type: Reverse OneToOneField from EventFeedback

The event feedback of this feedback (related name of feedback_ptr)

eventlistfeedback[source]

Type: Reverse OneToOneField from EventListFeedback

The event list feedback of this feedback (related name of feedback_ptr)

feedback_ptr[source]

Type: OneToOneField to Feedback

Primary key: Feedback ptr (related name: offerlistfeedback)

feedback_ptr_id[source]

Internal field, use feedback_ptr instead.

classmethod from_db(db, field_names, values)[source]
full_clean(exclude=None, validate_unique=True, validate_constraints=True)[source]

Call clean_fields(), clean(), validate_unique(), and validate_constraints() on the model. Raise a ValidationError for any errors that occur.

get_constraints()[source]
get_deferred_fields()[source]

Return a set containing names of deferred fields for this instance.

classmethod get_model_name_plural() str[source]

Get the plural representation of this model name

Returns:

The plural model name

Return type:

str

get_next_by_created_date(*, field=<django.db.models.DateTimeField: created_date>, is_next=True, **kwargs)[source]

Finds next instance based on created_date. See get_next_by_FOO() for more information.

get_previous_by_created_date(*, field=<django.db.models.DateTimeField: created_date>, is_next=False, **kwargs)[source]

Finds previous instance based on created_date. See get_previous_by_FOO() for more information.

get_rating_display(*, field=<django.db.models.BooleanField: rating>)[source]

Shows the label of the rating. See get_FOO_display() for more information.

get_real_concrete_instance_class()[source]
get_real_concrete_instance_class_id()[source]
get_real_instance()[source]

Upcast an object to it’s actual type.

If a non-polymorphic manager (like base_objects) has been used to retrieve objects, then the complete object with it’s real class/type and all fields may be retrieved with this method.

Note

Each method call executes one db query (if necessary). Use the get_real_instances() to upcast a complete list in a single efficient query.

get_real_instance_class()[source]

Return the actual model type of the object.

If a non-polymorphic manager (like base_objects) has been used to retrieve objects, then the real class/type of these objects may be determined using this method.

get_repr() str[source]

This overwrites the default Django __repr__() method which would return <Feedback: Feedback object (id)>. It is used for logging.

Returns:

The canonical string representation of the feedback

Return type:

str

id[source]

Type: BigAutoField

Primary key: ID

imprintpagefeedback[source]

Type: Reverse OneToOneField from ImprintPageFeedback

The imprint feedback of this feedback (related name of feedback_ptr)

is_technical[source]

Type: BooleanField

Technical. Whether or not the feedback is targeted at the developers

language[source]

Type: ForeignKey to Language

Language (related name: feedback)

language_id[source]

Internal field, use language instead.

mapfeedback[source]

Type: Reverse OneToOneField from MapFeedback

The map feedback of this feedback (related name of feedback_ptr)

property object_name: str[source]

This property returns the name of the object this feedback comments on.

Returns:

The name of the object this feedback refers to

object_url[source]

This property returns the url to the object this feedback comments on.

Returns:

The url to the referred object

objects = <integreat_cms.cms.models.feedback.feedback.CascadeDeletePolymorphicManager object>[source]
offerfeedback[source]

Type: Reverse OneToOneField from OfferFeedback

The offer feedback of this feedback (related name of feedback_ptr)

offerlistfeedback[source]

Type: Reverse OneToOneField from OfferListFeedback

The offer list feedback of this feedback (related name of feedback_ptr)

pagefeedback[source]

Type: Reverse OneToOneField from PageFeedback

The page feedback of this feedback (related name of feedback_ptr)

property pk[source]
poifeedback[source]

Type: Reverse OneToOneField from POIFeedback

The location feedback of this feedback (related name of feedback_ptr)

polymorphic_ctype[source]

Type: ForeignKey to ContentType

Polymorphic ctype (related name: feedback_set+)

The model field that stores the ContentType reference to the actual class.

polymorphic_ctype_id[source]

Internal field, use polymorphic_ctype instead.

polymorphic_internal_model_fields = ['polymorphic_ctype'][source]
polymorphic_model_marker = True[source]
polymorphic_query_multiline_output = False[source]
pre_save_polymorphic(using='default')[source]

Make sure the polymorphic_ctype value is correctly set on this model.

prepare_database_save(field)[source]
rating[source]

Type: BooleanField

Rating. Whether the feedback is positive or negative

Choices:

  • True

  • False

  • None

Manage choices in feedback_ratings

rating_sum_negative[source]

This property returns the sum of the down-ratings of this object.

Returns:

The number of negative ratings on this feedback object

rating_sum_positive[source]

This property returns the sum of the up-ratings of this object.

Returns:

The number of positive ratings on this feedback object

property read: bool[source]

This property returns whether or not the feedback is marked as read or not. It is True if read_by is set and False otherwise.

Returns:

Whether the feedback is marked as read

read_by[source]

Type: ForeignKey to User

Marked as read by. The account that marked this feedback as read. If the feedback is unread, this field is empty. (related name: feedback)

read_by_id[source]

Internal field, use read_by instead.

refresh_from_db(using=None, fields=None)[source]

Reload field values from the database.

By default, the reloading happens from the database this instance was loaded from, or by the read router if this instance wasn’t loaded from any database. The using parameter will override the default.

Fields can be used to specify which fields to reload. The fields should be an iterable of field attnames. If fields is None, then all non-deferred fields are reloaded.

When accessing deferred fields of an instance, the deferred loading of the field will call this method.

region[source]

Type: ForeignKey to Region

Region (related name: feedback)

region_id[source]

Internal field, use region instead.

regionfeedback[source]

Type: Reverse OneToOneField from RegionFeedback

The region feedback of this feedback (related name of feedback_ptr)

property related_feedback: QuerySet[OfferListFeedback][source]

This property returns all feedback entries which relate to the same object and have the same is_technical value.

Returns:

The queryset of related feedback

save(*args, **kwargs)[source]

Calls pre_save_polymorphic() and saves the model.

save_base(raw=False, force_insert=False, force_update=False, using=None, update_fields=None)[source]

Handle the parts of saving which should be done only once per save, yet need to be done in raw saves, too. This includes some sanity checks and signal sending.

The ‘raw’ argument is telling save_base not to save any parent models and not to do any changes to the values before save. This is used by fixture loading.

classmethod search(region: Region | None, query: str) QuerySet[source]

Searches for all feedbacks which match the given query in their comment. :param region: The current region or None for non-regional feedback :param query: The query string used for filtering the events :return: A query for all matching objects

Parameters:
Return type:

QuerySet

searchresultfeedback[source]

Type: Reverse OneToOneField from SearchResultFeedback

The search result feedback of this feedback (related name of feedback_ptr)

serializable_value(field_name)[source]

Return the value of the field name for this instance. If the field is a foreign key, return the id value instead of the object. If there’s no Field object with this name on the model, return the model attribute’s value.

Used to serialize a field’s value (in the serializer, or form output, for example). Normally, you would just access the attribute directly and not use this method.

classmethod translate_polymorphic_Q_object(q)[source]
unique_error_message(model_class, unique_check)[source]
validate_constraints(exclude=None)[source]
validate_unique(exclude=None)[source]

Check unique constraints on the model and raise ValidationError if any failed.

Page Feedback

class integreat_cms.cms.models.feedback.page_feedback.PageFeedback(*args, **kwargs)[source]

Bases: Feedback

Database model representing feedback about pages.

Parameters:
  • id (BigAutoField) – Primary key: ID

  • rating (BooleanField) – Rating. Whether the feedback is positive or negative

  • comment (TextField) – Comment

  • is_technical (BooleanField) – Technical. Whether or not the feedback is targeted at the developers

  • archived (BooleanField) – Archived. Whether or not the feedback is archived

  • created_date (DateTimeField) – Creation date

Relationship fields:

Parameters:
exception DoesNotExist[source]

Bases: DoesNotExist

__init__(*args, **kwargs)[source]
add_note()[source]

Exception.add_note(note) – add a note to the exception

args[source]
silent_variable_failure = True[source]
with_traceback()[source]

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception MultipleObjectsReturned[source]

Bases: MultipleObjectsReturned

__init__(*args, **kwargs)[source]
add_note()[source]

Exception.add_note(note) – add a note to the exception

args[source]
with_traceback()[source]

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

__init__(*args, **kwargs)[source]

Replace Django’s inheritance accessor member functions for our model (self.__class__) with our own versions. We monkey patch them until a patch can be added to Django (which would probably be very small and make all of this obsolete).

If we have inheritance of the form ModelA -> ModelB ->ModelC then Django creates accessors like this: - ModelA: modelb - ModelB: modela_ptr, modelb, modelc - ModelC: modela_ptr, modelb, modelb_ptr, modelc

These accessors allow Django (and everyone else) to travel up and down the inheritance tree for the db object at hand.

The original Django accessors use our polymorphic manager. But they should not. So we replace them with our own accessors that use our appropriate base_objects manager.

async adelete(using=None, keep_parents=False)[source]
archived[source]

Type: BooleanField

Archived. Whether or not the feedback is archived

async arefresh_from_db(using=None, fields=None)[source]
async asave(force_insert=False, force_update=False, using=None, update_fields=None)[source]
best_page_translation[source]

This property returns the best translation for the page this feedback comments on.

Returns:

The best page translation

property category: str[source]

This property returns the category (verbose name of the submodel) of this feedback object.

Returns:

capitalized category

classmethod check(**kwargs)[source]
clean()[source]

Hook for doing any extra model-wide validation after clean() has been called on every field by self.clean_fields. Any ValidationError raised by this method will not be associated with a particular field; it will have a special-case association with the field defined by NON_FIELD_ERRORS.

clean_fields(exclude=None)[source]

Clean all fields and raise a ValidationError containing a dict of all validation errors if any occur.

comment[source]

Type: TextField

Comment

created_date[source]

Type: DateTimeField

Creation date

date_error_message(lookup_type, field_name, unique_for)[source]
delete(using=None, keep_parents=False)[source]
eventfeedback[source]

Type: Reverse OneToOneField from EventFeedback

The event feedback of this feedback (related name of feedback_ptr)

eventlistfeedback[source]

Type: Reverse OneToOneField from EventListFeedback

The event list feedback of this feedback (related name of feedback_ptr)

feedback_ptr[source]

Type: OneToOneField to Feedback

Primary key: Feedback ptr (related name: pagefeedback)

feedback_ptr_id[source]

Internal field, use feedback_ptr instead.

classmethod from_db(db, field_names, values)[source]
full_clean(exclude=None, validate_unique=True, validate_constraints=True)[source]

Call clean_fields(), clean(), validate_unique(), and validate_constraints() on the model. Raise a ValidationError for any errors that occur.

get_constraints()[source]
get_deferred_fields()[source]

Return a set containing names of deferred fields for this instance.

classmethod get_model_name_plural() str[source]

Get the plural representation of this model name

Returns:

The plural model name

Return type:

str

get_next_by_created_date(*, field=<django.db.models.DateTimeField: created_date>, is_next=True, **kwargs)[source]

Finds next instance based on created_date. See get_next_by_FOO() for more information.

get_previous_by_created_date(*, field=<django.db.models.DateTimeField: created_date>, is_next=False, **kwargs)[source]

Finds previous instance based on created_date. See get_previous_by_FOO() for more information.

get_rating_display(*, field=<django.db.models.BooleanField: rating>)[source]

Shows the label of the rating. See get_FOO_display() for more information.

get_real_concrete_instance_class()[source]
get_real_concrete_instance_class_id()[source]
get_real_instance()[source]

Upcast an object to it’s actual type.

If a non-polymorphic manager (like base_objects) has been used to retrieve objects, then the complete object with it’s real class/type and all fields may be retrieved with this method.

Note

Each method call executes one db query (if necessary). Use the get_real_instances() to upcast a complete list in a single efficient query.

get_real_instance_class()[source]

Return the actual model type of the object.

If a non-polymorphic manager (like base_objects) has been used to retrieve objects, then the real class/type of these objects may be determined using this method.

get_repr() str[source]

This overwrites the default Django __repr__() method which would return <Feedback: Feedback object (id)>. It is used for logging.

Returns:

The canonical string representation of the feedback

Return type:

str

id[source]

Type: BigAutoField

Primary key: ID

imprintpagefeedback[source]

Type: Reverse OneToOneField from ImprintPageFeedback

The imprint feedback of this feedback (related name of feedback_ptr)

is_technical[source]

Type: BooleanField

Technical. Whether or not the feedback is targeted at the developers

language[source]

Type: ForeignKey to Language

Language (related name: feedback)

language_id[source]

Internal field, use language instead.

mapfeedback[source]

Type: Reverse OneToOneField from MapFeedback

The map feedback of this feedback (related name of feedback_ptr)

property object_name: str[source]

This property returns the name of the object this feedback comments on.

Returns:

The name of the object this feedback refers to

object_url[source]

This property returns the url to the object this feedback comments on.

Returns:

The url to the referred object

objects = <integreat_cms.cms.models.feedback.feedback.CascadeDeletePolymorphicManager object>[source]
offerfeedback[source]

Type: Reverse OneToOneField from OfferFeedback

The offer feedback of this feedback (related name of feedback_ptr)

offerlistfeedback[source]

Type: Reverse OneToOneField from OfferListFeedback

The offer list feedback of this feedback (related name of feedback_ptr)

page_translation[source]

Type: ForeignKey to PageTranslation

Page translation (related name: feedback)

page_translation_id[source]

Internal field, use page_translation instead.

pagefeedback[source]

Type: Reverse OneToOneField from PageFeedback

The page feedback of this feedback (related name of feedback_ptr)

property pk[source]
poifeedback[source]

Type: Reverse OneToOneField from POIFeedback

The location feedback of this feedback (related name of feedback_ptr)

polymorphic_ctype[source]

Type: ForeignKey to ContentType

Polymorphic ctype (related name: feedback_set+)

The model field that stores the ContentType reference to the actual class.

polymorphic_ctype_id[source]

Internal field, use polymorphic_ctype instead.

polymorphic_internal_model_fields = ['polymorphic_ctype'][source]
polymorphic_model_marker = True[source]
polymorphic_query_multiline_output = False[source]
pre_save_polymorphic(using='default')[source]

Make sure the polymorphic_ctype value is correctly set on this model.

prepare_database_save(field)[source]
rating[source]

Type: BooleanField

Rating. Whether the feedback is positive or negative

Choices:

  • True

  • False

  • None

Manage choices in feedback_ratings

rating_sum_negative[source]

This property returns the sum of the down-ratings of this object.

Returns:

The number of negative ratings on this feedback object

rating_sum_positive[source]

This property returns the sum of the up-ratings of this object.

Returns:

The number of positive ratings on this feedback object

property read: bool[source]

This property returns whether or not the feedback is marked as read or not. It is True if read_by is set and False otherwise.

Returns:

Whether the feedback is marked as read

read_by[source]

Type: ForeignKey to User

Marked as read by. The account that marked this feedback as read. If the feedback is unread, this field is empty. (related name: feedback)

read_by_id[source]

Internal field, use read_by instead.

refresh_from_db(using=None, fields=None)[source]

Reload field values from the database.

By default, the reloading happens from the database this instance was loaded from, or by the read router if this instance wasn’t loaded from any database. The using parameter will override the default.

Fields can be used to specify which fields to reload. The fields should be an iterable of field attnames. If fields is None, then all non-deferred fields are reloaded.

When accessing deferred fields of an instance, the deferred loading of the field will call this method.

region[source]

Type: ForeignKey to Region

Region (related name: feedback)

region_id[source]

Internal field, use region instead.

regionfeedback[source]

Type: Reverse OneToOneField from RegionFeedback

The region feedback of this feedback (related name of feedback_ptr)

property related_feedback: QuerySet[PageFeedback][source]

This property returns all feedback entries which relate to the same object and have the same is_technical value.

Returns:

The queryset of related feedback

save(*args, **kwargs)[source]

Calls pre_save_polymorphic() and saves the model.

save_base(raw=False, force_insert=False, force_update=False, using=None, update_fields=None)[source]

Handle the parts of saving which should be done only once per save, yet need to be done in raw saves, too. This includes some sanity checks and signal sending.

The ‘raw’ argument is telling save_base not to save any parent models and not to do any changes to the values before save. This is used by fixture loading.

classmethod search(region: Region | None, query: str) QuerySet[source]

Searches for all feedbacks which match the given query in their comment. :param region: The current region or None for non-regional feedback :param query: The query string used for filtering the events :return: A query for all matching objects

Parameters:
Return type:

QuerySet

searchresultfeedback[source]

Type: Reverse OneToOneField from SearchResultFeedback

The search result feedback of this feedback (related name of feedback_ptr)

serializable_value(field_name)[source]

Return the value of the field name for this instance. If the field is a foreign key, return the id value instead of the object. If there’s no Field object with this name on the model, return the model attribute’s value.

Used to serialize a field’s value (in the serializer, or form output, for example). Normally, you would just access the attribute directly and not use this method.

classmethod translate_polymorphic_Q_object(q)[source]
unique_error_message(model_class, unique_check)[source]
validate_constraints(exclude=None)[source]
validate_unique(exclude=None)[source]

Check unique constraints on the model and raise ValidationError if any failed.

POI Feedback

class integreat_cms.cms.models.feedback.poi_feedback.POIFeedback(*args, **kwargs)[source]

Bases: Feedback

Database model representing feedback about events.

Parameters:
  • id (BigAutoField) – Primary key: ID

  • rating (BooleanField) – Rating. Whether the feedback is positive or negative

  • comment (TextField) – Comment

  • is_technical (BooleanField) – Technical. Whether or not the feedback is targeted at the developers

  • archived (BooleanField) – Archived. Whether or not the feedback is archived

  • created_date (DateTimeField) – Creation date

Relationship fields:

Parameters:
exception DoesNotExist[source]

Bases: DoesNotExist

__init__(*args, **kwargs)[source]
add_note()[source]

Exception.add_note(note) – add a note to the exception

args[source]
silent_variable_failure = True[source]
with_traceback()[source]

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception MultipleObjectsReturned[source]

Bases: MultipleObjectsReturned

__init__(*args, **kwargs)[source]
add_note()[source]

Exception.add_note(note) – add a note to the exception

args[source]
with_traceback()[source]

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

__init__(*args, **kwargs)[source]

Replace Django’s inheritance accessor member functions for our model (self.__class__) with our own versions. We monkey patch them until a patch can be added to Django (which would probably be very small and make all of this obsolete).

If we have inheritance of the form ModelA -> ModelB ->ModelC then Django creates accessors like this: - ModelA: modelb - ModelB: modela_ptr, modelb, modelc - ModelC: modela_ptr, modelb, modelb_ptr, modelc

These accessors allow Django (and everyone else) to travel up and down the inheritance tree for the db object at hand.

The original Django accessors use our polymorphic manager. But they should not. So we replace them with our own accessors that use our appropriate base_objects manager.

async adelete(using=None, keep_parents=False)[source]
archived[source]

Type: BooleanField

Archived. Whether or not the feedback is archived

async arefresh_from_db(using=None, fields=None)[source]
async asave(force_insert=False, force_update=False, using=None, update_fields=None)[source]
best_poi_translation[source]

This property returns the best translation for the POI this feedback comments on.

Returns:

The best poi translation

property category: str[source]

This property returns the category (verbose name of the submodel) of this feedback object.

Returns:

capitalized category

classmethod check(**kwargs)[source]
clean()[source]

Hook for doing any extra model-wide validation after clean() has been called on every field by self.clean_fields. Any ValidationError raised by this method will not be associated with a particular field; it will have a special-case association with the field defined by NON_FIELD_ERRORS.

clean_fields(exclude=None)[source]

Clean all fields and raise a ValidationError containing a dict of all validation errors if any occur.

comment[source]

Type: TextField

Comment

created_date[source]

Type: DateTimeField

Creation date

date_error_message(lookup_type, field_name, unique_for)[source]
delete(using=None, keep_parents=False)[source]
eventfeedback[source]

Type: Reverse OneToOneField from EventFeedback

The event feedback of this feedback (related name of feedback_ptr)

eventlistfeedback[source]

Type: Reverse OneToOneField from EventListFeedback

The event list feedback of this feedback (related name of feedback_ptr)

feedback_ptr[source]

Type: OneToOneField to Feedback

Primary key: Feedback ptr (related name: poifeedback)

feedback_ptr_id[source]

Internal field, use feedback_ptr instead.

classmethod from_db(db, field_names, values)[source]
full_clean(exclude=None, validate_unique=True, validate_constraints=True)[source]

Call clean_fields(), clean(), validate_unique(), and validate_constraints() on the model. Raise a ValidationError for any errors that occur.

get_constraints()[source]
get_deferred_fields()[source]

Return a set containing names of deferred fields for this instance.

classmethod get_model_name_plural() str[source]

Get the plural representation of this model name

Returns:

The plural model name

Return type:

str

get_next_by_created_date(*, field=<django.db.models.DateTimeField: created_date>, is_next=True, **kwargs)[source]

Finds next instance based on created_date. See get_next_by_FOO() for more information.

get_previous_by_created_date(*, field=<django.db.models.DateTimeField: created_date>, is_next=False, **kwargs)[source]

Finds previous instance based on created_date. See get_previous_by_FOO() for more information.

get_rating_display(*, field=<django.db.models.BooleanField: rating>)[source]

Shows the label of the rating. See get_FOO_display() for more information.

get_real_concrete_instance_class()[source]
get_real_concrete_instance_class_id()[source]
get_real_instance()[source]

Upcast an object to it’s actual type.

If a non-polymorphic manager (like base_objects) has been used to retrieve objects, then the complete object with it’s real class/type and all fields may be retrieved with this method.

Note

Each method call executes one db query (if necessary). Use the get_real_instances() to upcast a complete list in a single efficient query.

get_real_instance_class()[source]

Return the actual model type of the object.

If a non-polymorphic manager (like base_objects) has been used to retrieve objects, then the real class/type of these objects may be determined using this method.

get_repr() str[source]

This overwrites the default Django __repr__() method which would return <Feedback: Feedback object (id)>. It is used for logging.

Returns:

The canonical string representation of the feedback

Return type:

str

id[source]

Type: BigAutoField

Primary key: ID

imprintpagefeedback[source]

Type: Reverse OneToOneField from ImprintPageFeedback

The imprint feedback of this feedback (related name of feedback_ptr)

is_technical[source]

Type: BooleanField

Technical. Whether or not the feedback is targeted at the developers

language[source]

Type: ForeignKey to Language

Language (related name: feedback)

language_id[source]

Internal field, use language instead.

mapfeedback[source]

Type: Reverse OneToOneField from MapFeedback

The map feedback of this feedback (related name of feedback_ptr)

property object_name: str[source]

This property returns the name of the object this feedback comments on.

Returns:

The name of the object this feedback refers to

object_url[source]

This property returns the url to the object this feedback comments on.

Returns:

The url to the referred object

objects = <integreat_cms.cms.models.feedback.feedback.CascadeDeletePolymorphicManager object>[source]
offerfeedback[source]

Type: Reverse OneToOneField from OfferFeedback

The offer feedback of this feedback (related name of feedback_ptr)

offerlistfeedback[source]

Type: Reverse OneToOneField from OfferListFeedback

The offer list feedback of this feedback (related name of feedback_ptr)

pagefeedback[source]

Type: Reverse OneToOneField from PageFeedback

The page feedback of this feedback (related name of feedback_ptr)

property pk[source]
poi_translation[source]

Type: ForeignKey to POITranslation

Location translation (related name: feedback)

poi_translation_id[source]

Internal field, use poi_translation instead.

poifeedback[source]

Type: Reverse OneToOneField from POIFeedback

The location feedback of this feedback (related name of feedback_ptr)

polymorphic_ctype[source]

Type: ForeignKey to ContentType

Polymorphic ctype (related name: feedback_set+)

The model field that stores the ContentType reference to the actual class.

polymorphic_ctype_id[source]

Internal field, use polymorphic_ctype instead.

polymorphic_internal_model_fields = ['polymorphic_ctype'][source]
polymorphic_model_marker = True[source]
polymorphic_query_multiline_output = False[source]
pre_save_polymorphic(using='default')[source]

Make sure the polymorphic_ctype value is correctly set on this model.

prepare_database_save(field)[source]
rating[source]

Type: BooleanField

Rating. Whether the feedback is positive or negative

Choices:

  • True

  • False

  • None

Manage choices in feedback_ratings

rating_sum_negative[source]

This property returns the sum of the down-ratings of this object.

Returns:

The number of negative ratings on this feedback object

rating_sum_positive[source]

This property returns the sum of the up-ratings of this object.

Returns:

The number of positive ratings on this feedback object

property read: bool[source]

This property returns whether or not the feedback is marked as read or not. It is True if read_by is set and False otherwise.

Returns:

Whether the feedback is marked as read

read_by[source]

Type: ForeignKey to User

Marked as read by. The account that marked this feedback as read. If the feedback is unread, this field is empty. (related name: feedback)

read_by_id[source]

Internal field, use read_by instead.

refresh_from_db(using=None, fields=None)[source]

Reload field values from the database.

By default, the reloading happens from the database this instance was loaded from, or by the read router if this instance wasn’t loaded from any database. The using parameter will override the default.

Fields can be used to specify which fields to reload. The fields should be an iterable of field attnames. If fields is None, then all non-deferred fields are reloaded.

When accessing deferred fields of an instance, the deferred loading of the field will call this method.

region[source]

Type: ForeignKey to Region

Region (related name: feedback)

region_id[source]

Internal field, use region instead.

regionfeedback[source]

Type: Reverse OneToOneField from RegionFeedback

The region feedback of this feedback (related name of feedback_ptr)

property related_feedback: QuerySet[POIFeedback][source]

This property returns all feedback entries which relate to the same object and have the same is_technical value.

Returns:

The queryset of related feedback

save(*args, **kwargs)[source]

Calls pre_save_polymorphic() and saves the model.

save_base(raw=False, force_insert=False, force_update=False, using=None, update_fields=None)[source]

Handle the parts of saving which should be done only once per save, yet need to be done in raw saves, too. This includes some sanity checks and signal sending.

The ‘raw’ argument is telling save_base not to save any parent models and not to do any changes to the values before save. This is used by fixture loading.

classmethod search(region: Region | None, query: str) QuerySet[source]

Searches for all feedbacks which match the given query in their comment. :param region: The current region or None for non-regional feedback :param query: The query string used for filtering the events :return: A query for all matching objects

Parameters:
Return type:

QuerySet

searchresultfeedback[source]

Type: Reverse OneToOneField from SearchResultFeedback

The search result feedback of this feedback (related name of feedback_ptr)

serializable_value(field_name)[source]

Return the value of the field name for this instance. If the field is a foreign key, return the id value instead of the object. If there’s no Field object with this name on the model, return the model attribute’s value.

Used to serialize a field’s value (in the serializer, or form output, for example). Normally, you would just access the attribute directly and not use this method.

classmethod translate_polymorphic_Q_object(q)[source]
unique_error_message(model_class, unique_check)[source]
validate_constraints(exclude=None)[source]
validate_unique(exclude=None)[source]

Check unique constraints on the model and raise ValidationError if any failed.

Region Feedback

class integreat_cms.cms.models.feedback.region_feedback.RegionFeedback(*args, **kwargs)[source]

Bases: Feedback

Database model representing feedback about regions in general.

Parameters:
  • id (BigAutoField) – Primary key: ID

  • rating (BooleanField) – Rating. Whether the feedback is positive or negative

  • comment (TextField) – Comment

  • is_technical (BooleanField) – Technical. Whether or not the feedback is targeted at the developers

  • archived (BooleanField) – Archived. Whether or not the feedback is archived

  • created_date (DateTimeField) – Creation date

Relationship fields:

Parameters:
exception DoesNotExist[source]

Bases: DoesNotExist

__init__(*args, **kwargs)[source]
add_note()[source]

Exception.add_note(note) – add a note to the exception

args[source]
silent_variable_failure = True[source]
with_traceback()[source]

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception MultipleObjectsReturned[source]

Bases: MultipleObjectsReturned

__init__(*args, **kwargs)[source]
add_note()[source]

Exception.add_note(note) – add a note to the exception

args[source]
with_traceback()[source]

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

__init__(*args, **kwargs)[source]

Replace Django’s inheritance accessor member functions for our model (self.__class__) with our own versions. We monkey patch them until a patch can be added to Django (which would probably be very small and make all of this obsolete).

If we have inheritance of the form ModelA -> ModelB ->ModelC then Django creates accessors like this: - ModelA: modelb - ModelB: modela_ptr, modelb, modelc - ModelC: modela_ptr, modelb, modelb_ptr, modelc

These accessors allow Django (and everyone else) to travel up and down the inheritance tree for the db object at hand.

The original Django accessors use our polymorphic manager. But they should not. So we replace them with our own accessors that use our appropriate base_objects manager.

async adelete(using=None, keep_parents=False)[source]
archived[source]

Type: BooleanField

Archived. Whether or not the feedback is archived

async arefresh_from_db(using=None, fields=None)[source]
async asave(force_insert=False, force_update=False, using=None, update_fields=None)[source]
property category: str[source]

This property returns the category (verbose name of the submodel) of this feedback object.

Returns:

capitalized category

classmethod check(**kwargs)[source]
clean()[source]

Hook for doing any extra model-wide validation after clean() has been called on every field by self.clean_fields. Any ValidationError raised by this method will not be associated with a particular field; it will have a special-case association with the field defined by NON_FIELD_ERRORS.

clean_fields(exclude=None)[source]

Clean all fields and raise a ValidationError containing a dict of all validation errors if any occur.

comment[source]

Type: TextField

Comment

created_date[source]

Type: DateTimeField

Creation date

date_error_message(lookup_type, field_name, unique_for)[source]
delete(using=None, keep_parents=False)[source]
eventfeedback[source]

Type: Reverse OneToOneField from EventFeedback

The event feedback of this feedback (related name of feedback_ptr)

eventlistfeedback[source]

Type: Reverse OneToOneField from EventListFeedback

The event list feedback of this feedback (related name of feedback_ptr)

feedback_ptr[source]

Type: OneToOneField to Feedback

Primary key: Feedback ptr (related name: regionfeedback)

feedback_ptr_id[source]

Internal field, use feedback_ptr instead.

classmethod from_db(db, field_names, values)[source]
full_clean(exclude=None, validate_unique=True, validate_constraints=True)[source]

Call clean_fields(), clean(), validate_unique(), and validate_constraints() on the model. Raise a ValidationError for any errors that occur.

get_constraints()[source]
get_deferred_fields()[source]

Return a set containing names of deferred fields for this instance.

classmethod get_model_name_plural() str[source]

Get the plural representation of this model name

Returns:

The plural model name

Return type:

str

get_next_by_created_date(*, field=<django.db.models.DateTimeField: created_date>, is_next=True, **kwargs)[source]

Finds next instance based on created_date. See get_next_by_FOO() for more information.

get_previous_by_created_date(*, field=<django.db.models.DateTimeField: created_date>, is_next=False, **kwargs)[source]

Finds previous instance based on created_date. See get_previous_by_FOO() for more information.

get_rating_display(*, field=<django.db.models.BooleanField: rating>)[source]

Shows the label of the rating. See get_FOO_display() for more information.

get_real_concrete_instance_class()[source]
get_real_concrete_instance_class_id()[source]
get_real_instance()[source]

Upcast an object to it’s actual type.

If a non-polymorphic manager (like base_objects) has been used to retrieve objects, then the complete object with it’s real class/type and all fields may be retrieved with this method.

Note

Each method call executes one db query (if necessary). Use the get_real_instances() to upcast a complete list in a single efficient query.

get_real_instance_class()[source]

Return the actual model type of the object.

If a non-polymorphic manager (like base_objects) has been used to retrieve objects, then the real class/type of these objects may be determined using this method.

get_repr() str[source]

This overwrites the default Django __repr__() method which would return <Feedback: Feedback object (id)>. It is used for logging.

Returns:

The canonical string representation of the feedback

Return type:

str

id[source]

Type: BigAutoField

Primary key: ID

imprintpagefeedback[source]

Type: Reverse OneToOneField from ImprintPageFeedback

The imprint feedback of this feedback (related name of feedback_ptr)

is_technical[source]

Type: BooleanField

Technical. Whether or not the feedback is targeted at the developers

language[source]

Type: ForeignKey to Language

Language (related name: feedback)

language_id[source]

Internal field, use language instead.

mapfeedback[source]

Type: Reverse OneToOneField from MapFeedback

The map feedback of this feedback (related name of feedback_ptr)

property object_name: str[source]

This property returns the name of the object this feedback comments on.

Returns:

The name of the object this feedback refers to

object_url[source]

This property returns the url to the object this feedback comments on.

Returns:

The url to the referred object

objects = <integreat_cms.cms.models.feedback.feedback.CascadeDeletePolymorphicManager object>[source]
offerfeedback[source]

Type: Reverse OneToOneField from OfferFeedback

The offer feedback of this feedback (related name of feedback_ptr)

offerlistfeedback[source]

Type: Reverse OneToOneField from OfferListFeedback

The offer list feedback of this feedback (related name of feedback_ptr)

pagefeedback[source]

Type: Reverse OneToOneField from PageFeedback

The page feedback of this feedback (related name of feedback_ptr)

property pk[source]
poifeedback[source]

Type: Reverse OneToOneField from POIFeedback

The location feedback of this feedback (related name of feedback_ptr)

polymorphic_ctype[source]

Type: ForeignKey to ContentType

Polymorphic ctype (related name: feedback_set+)

The model field that stores the ContentType reference to the actual class.

polymorphic_ctype_id[source]

Internal field, use polymorphic_ctype instead.

polymorphic_internal_model_fields = ['polymorphic_ctype'][source]
polymorphic_model_marker = True[source]
polymorphic_query_multiline_output = False[source]
pre_save_polymorphic(using='default')[source]

Make sure the polymorphic_ctype value is correctly set on this model.

prepare_database_save(field)[source]
rating[source]

Type: BooleanField

Rating. Whether the feedback is positive or negative

Choices:

  • True

  • False

  • None

Manage choices in feedback_ratings

rating_sum_negative[source]

This property returns the sum of the down-ratings of this object.

Returns:

The number of negative ratings on this feedback object

rating_sum_positive[source]

This property returns the sum of the up-ratings of this object.

Returns:

The number of positive ratings on this feedback object

property read: bool[source]

This property returns whether or not the feedback is marked as read or not. It is True if read_by is set and False otherwise.

Returns:

Whether the feedback is marked as read

read_by[source]

Type: ForeignKey to User

Marked as read by. The account that marked this feedback as read. If the feedback is unread, this field is empty. (related name: feedback)

read_by_id[source]

Internal field, use read_by instead.

refresh_from_db(using=None, fields=None)[source]

Reload field values from the database.

By default, the reloading happens from the database this instance was loaded from, or by the read router if this instance wasn’t loaded from any database. The using parameter will override the default.

Fields can be used to specify which fields to reload. The fields should be an iterable of field attnames. If fields is None, then all non-deferred fields are reloaded.

When accessing deferred fields of an instance, the deferred loading of the field will call this method.

region[source]

Type: ForeignKey to Region

Region (related name: feedback)

region_id[source]

Internal field, use region instead.

regionfeedback[source]

Type: Reverse OneToOneField from RegionFeedback

The region feedback of this feedback (related name of feedback_ptr)

property related_feedback: QuerySet[RegionFeedback][source]

This property returns all feedback entries which relate to the same object and have the same is_technical value.

Returns:

The queryset of related feedback

save(*args, **kwargs)[source]

Calls pre_save_polymorphic() and saves the model.

save_base(raw=False, force_insert=False, force_update=False, using=None, update_fields=None)[source]

Handle the parts of saving which should be done only once per save, yet need to be done in raw saves, too. This includes some sanity checks and signal sending.

The ‘raw’ argument is telling save_base not to save any parent models and not to do any changes to the values before save. This is used by fixture loading.

classmethod search(region: Region | None, query: str) QuerySet[source]

Searches for all feedbacks which match the given query in their comment. :param region: The current region or None for non-regional feedback :param query: The query string used for filtering the events :return: A query for all matching objects

Parameters:
Return type:

QuerySet

searchresultfeedback[source]

Type: Reverse OneToOneField from SearchResultFeedback

The search result feedback of this feedback (related name of feedback_ptr)

serializable_value(field_name)[source]

Return the value of the field name for this instance. If the field is a foreign key, return the id value instead of the object. If there’s no Field object with this name on the model, return the model attribute’s value.

Used to serialize a field’s value (in the serializer, or form output, for example). Normally, you would just access the attribute directly and not use this method.

classmethod translate_polymorphic_Q_object(q)[source]
unique_error_message(model_class, unique_check)[source]
validate_constraints(exclude=None)[source]
validate_unique(exclude=None)[source]

Check unique constraints on the model and raise ValidationError if any failed.

Search Result Feedback

class integreat_cms.cms.models.feedback.search_result_feedback.SearchResultFeedback(*args, **kwargs)[source]

Bases: Feedback

Database model representing feedback about search results (e.g. empty results).

Parameters:
  • id (BigAutoField) – Primary key: ID

  • rating (BooleanField) – Rating. Whether the feedback is positive or negative

  • comment (TextField) – Comment

  • is_technical (BooleanField) – Technical. Whether or not the feedback is targeted at the developers

  • archived (BooleanField) – Archived. Whether or not the feedback is archived

  • created_date (DateTimeField) – Creation date

  • search_query (CharField) – Search term

Relationship fields:

Parameters:
exception DoesNotExist[source]

Bases: DoesNotExist

__init__(*args, **kwargs)[source]
add_note()[source]

Exception.add_note(note) – add a note to the exception

args[source]
silent_variable_failure = True[source]
with_traceback()[source]

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception MultipleObjectsReturned[source]

Bases: MultipleObjectsReturned

__init__(*args, **kwargs)[source]
add_note()[source]

Exception.add_note(note) – add a note to the exception

args[source]
with_traceback()[source]

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

__init__(*args, **kwargs)[source]

Replace Django’s inheritance accessor member functions for our model (self.__class__) with our own versions. We monkey patch them until a patch can be added to Django (which would probably be very small and make all of this obsolete).

If we have inheritance of the form ModelA -> ModelB ->ModelC then Django creates accessors like this: - ModelA: modelb - ModelB: modela_ptr, modelb, modelc - ModelC: modela_ptr, modelb, modelb_ptr, modelc

These accessors allow Django (and everyone else) to travel up and down the inheritance tree for the db object at hand.

The original Django accessors use our polymorphic manager. But they should not. So we replace them with our own accessors that use our appropriate base_objects manager.

async adelete(using=None, keep_parents=False)[source]
archived[source]

Type: BooleanField

Archived. Whether or not the feedback is archived

async arefresh_from_db(using=None, fields=None)[source]
async asave(force_insert=False, force_update=False, using=None, update_fields=None)[source]
property category: str[source]

This property returns the category (verbose name of the submodel) of this feedback object.

Returns:

capitalized category

classmethod check(**kwargs)[source]
clean()[source]

Hook for doing any extra model-wide validation after clean() has been called on every field by self.clean_fields. Any ValidationError raised by this method will not be associated with a particular field; it will have a special-case association with the field defined by NON_FIELD_ERRORS.

clean_fields(exclude=None)[source]

Clean all fields and raise a ValidationError containing a dict of all validation errors if any occur.

comment[source]

Type: TextField

Comment

created_date[source]

Type: DateTimeField

Creation date

date_error_message(lookup_type, field_name, unique_for)[source]
delete(using=None, keep_parents=False)[source]
eventfeedback[source]

Type: Reverse OneToOneField from EventFeedback

The event feedback of this feedback (related name of feedback_ptr)

eventlistfeedback[source]

Type: Reverse OneToOneField from EventListFeedback

The event list feedback of this feedback (related name of feedback_ptr)

feedback_ptr[source]

Type: OneToOneField to Feedback

Primary key: Feedback ptr (related name: searchresultfeedback)

feedback_ptr_id[source]

Internal field, use feedback_ptr instead.

classmethod from_db(db, field_names, values)[source]
full_clean(exclude=None, validate_unique=True, validate_constraints=True)[source]

Call clean_fields(), clean(), validate_unique(), and validate_constraints() on the model. Raise a ValidationError for any errors that occur.

get_constraints()[source]
get_deferred_fields()[source]

Return a set containing names of deferred fields for this instance.

classmethod get_model_name_plural() str[source]

Get the plural representation of this model name

Returns:

The plural model name

Return type:

str

get_next_by_created_date(*, field=<django.db.models.DateTimeField: created_date>, is_next=True, **kwargs)[source]

Finds next instance based on created_date. See get_next_by_FOO() for more information.

get_previous_by_created_date(*, field=<django.db.models.DateTimeField: created_date>, is_next=False, **kwargs)[source]

Finds previous instance based on created_date. See get_previous_by_FOO() for more information.

get_rating_display(*, field=<django.db.models.BooleanField: rating>)[source]

Shows the label of the rating. See get_FOO_display() for more information.

get_real_concrete_instance_class()[source]
get_real_concrete_instance_class_id()[source]
get_real_instance()[source]

Upcast an object to it’s actual type.

If a non-polymorphic manager (like base_objects) has been used to retrieve objects, then the complete object with it’s real class/type and all fields may be retrieved with this method.

Note

Each method call executes one db query (if necessary). Use the get_real_instances() to upcast a complete list in a single efficient query.

get_real_instance_class()[source]

Return the actual model type of the object.

If a non-polymorphic manager (like base_objects) has been used to retrieve objects, then the real class/type of these objects may be determined using this method.

get_repr() str[source]

This overwrites the default Django __repr__() method which would return <Feedback: Feedback object (id)>. It is used for logging.

Returns:

The canonical string representation of the feedback

Return type:

str

id[source]

Type: BigAutoField

Primary key: ID

imprintpagefeedback[source]

Type: Reverse OneToOneField from ImprintPageFeedback

The imprint feedback of this feedback (related name of feedback_ptr)

is_technical[source]

Type: BooleanField

Technical. Whether or not the feedback is targeted at the developers

language[source]

Type: ForeignKey to Language

Language (related name: feedback)

language_id[source]

Internal field, use language instead.

mapfeedback[source]

Type: Reverse OneToOneField from MapFeedback

The map feedback of this feedback (related name of feedback_ptr)

property object_name: str[source]

This property returns the name of the object this feedback comments on.

Returns:

The name of the object this feedback refers to

object_url[source]

This property returns the url to the object this feedback comments on.

Returns:

The url to the referred object

objects = <integreat_cms.cms.models.feedback.feedback.CascadeDeletePolymorphicManager object>[source]
offerfeedback[source]

Type: Reverse OneToOneField from OfferFeedback

The offer feedback of this feedback (related name of feedback_ptr)

offerlistfeedback[source]

Type: Reverse OneToOneField from OfferListFeedback

The offer list feedback of this feedback (related name of feedback_ptr)

pagefeedback[source]

Type: Reverse OneToOneField from PageFeedback

The page feedback of this feedback (related name of feedback_ptr)

property pk[source]
poifeedback[source]

Type: Reverse OneToOneField from POIFeedback

The location feedback of this feedback (related name of feedback_ptr)

polymorphic_ctype[source]

Type: ForeignKey to ContentType

Polymorphic ctype (related name: feedback_set+)

The model field that stores the ContentType reference to the actual class.

polymorphic_ctype_id[source]

Internal field, use polymorphic_ctype instead.

polymorphic_internal_model_fields = ['polymorphic_ctype'][source]
polymorphic_model_marker = True[source]
polymorphic_query_multiline_output = False[source]
pre_save_polymorphic(using='default')[source]

Make sure the polymorphic_ctype value is correctly set on this model.

prepare_database_save(field)[source]
rating[source]

Type: BooleanField

Rating. Whether the feedback is positive or negative

Choices:

  • True

  • False

  • None

Manage choices in feedback_ratings

rating_sum_negative[source]

This property returns the sum of the down-ratings of this object.

Returns:

The number of negative ratings on this feedback object

rating_sum_positive[source]

This property returns the sum of the up-ratings of this object.

Returns:

The number of positive ratings on this feedback object

property read: bool[source]

This property returns whether or not the feedback is marked as read or not. It is True if read_by is set and False otherwise.

Returns:

Whether the feedback is marked as read

read_by[source]

Type: ForeignKey to User

Marked as read by. The account that marked this feedback as read. If the feedback is unread, this field is empty. (related name: feedback)

read_by_id[source]

Internal field, use read_by instead.

refresh_from_db(using=None, fields=None)[source]

Reload field values from the database.

By default, the reloading happens from the database this instance was loaded from, or by the read router if this instance wasn’t loaded from any database. The using parameter will override the default.

Fields can be used to specify which fields to reload. The fields should be an iterable of field attnames. If fields is None, then all non-deferred fields are reloaded.

When accessing deferred fields of an instance, the deferred loading of the field will call this method.

region[source]

Type: ForeignKey to Region

Region (related name: feedback)

region_id[source]

Internal field, use region instead.

regionfeedback[source]

Type: Reverse OneToOneField from RegionFeedback

The region feedback of this feedback (related name of feedback_ptr)

property related_feedback: QuerySet[SearchResultFeedback][source]

This property returns all feedback entries which relate to the same object and have the same is_technical value.

Returns:

The queryset of related feedback

save(*args, **kwargs)[source]

Calls pre_save_polymorphic() and saves the model.

save_base(raw=False, force_insert=False, force_update=False, using=None, update_fields=None)[source]

Handle the parts of saving which should be done only once per save, yet need to be done in raw saves, too. This includes some sanity checks and signal sending.

The ‘raw’ argument is telling save_base not to save any parent models and not to do any changes to the values before save. This is used by fixture loading.

classmethod search(region: Region | None, query: str) QuerySet[source]

Searches for all feedbacks which match the given query in their comment. :param region: The current region or None for non-regional feedback :param query: The query string used for filtering the events :return: A query for all matching objects

Parameters:
Return type:

QuerySet

search_query[source]

Type: CharField

Search term

searchresultfeedback[source]

Type: Reverse OneToOneField from SearchResultFeedback

The search result feedback of this feedback (related name of feedback_ptr)

serializable_value(field_name)[source]

Return the value of the field name for this instance. If the field is a foreign key, return the id value instead of the object. If there’s no Field object with this name on the model, return the model attribute’s value.

Used to serialize a field’s value (in the serializer, or form output, for example). Normally, you would just access the attribute directly and not use this method.

classmethod translate_polymorphic_Q_object(q)[source]
unique_error_message(model_class, unique_check)[source]
validate_constraints(exclude=None)[source]
validate_unique(exclude=None)[source]

Check unique constraints on the model and raise ValidationError if any failed.