akvo.rsr.models.partner_site module
Akvo RSR is covered by the GNU Affero General Public License.
See more details in the license.txt file located at the root folder of the Akvo RSR module. For additional details on the GNU license please see < http://www.gnu.org/licenses/agpl.html >.
- class akvo.rsr.models.partner_site.PartnerSite(*args, **kwargs)[source]
Bases:
TimestampsMixin
Model makes it possible to cater different data sets based on request’s hostname.
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- about_box
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- about_image
Just like the FileDescriptor, but for ImageFields. The only difference is assigning the width/height to the width_field/height_field, if appropriate.
- all_maps
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- cname
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- created_at
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- custom_css
The descriptor for the file attribute on the model instance. Return a FieldFile when accessed so you can write code like:
>>> from myapp.models import MyModel >>> instance = MyModel.objects.get(pk=1) >>> instance.file.size
Assign a file object on assignment so you can do:
>>> with open('/path/to/hello.world') as f: ... instance.file = File(f)
- custom_favicon
The descriptor for the file attribute on the model instance. Return a FieldFile when accessed so you can write code like:
>>> from myapp.models import MyModel >>> instance = MyModel.objects.get(pk=1) >>> instance.file.size
Assign a file object on assignment so you can do:
>>> with open('/path/to/hello.world') as f: ... instance.file = File(f)
- custom_logo
The descriptor for the file attribute on the model instance. Return a FieldFile when accessed so you can write code like:
>>> from myapp.models import MyModel >>> instance = MyModel.objects.get(pk=1) >>> instance.file.size
Assign a file object on assignment so you can do:
>>> with open('/path/to/hello.world') as f: ... instance.file = File(f)
- custom_map_marker
The descriptor for the file attribute on the model instance. Return a FieldFile when accessed so you can write code like:
>>> from myapp.models import MyModel >>> instance = MyModel.objects.get(pk=1) >>> instance.file.size
Assign a file object on assignment so you can do:
>>> with open('/path/to/hello.world') as f: ... instance.file = File(f)
- custom_return_url
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- custom_return_url_text
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- default_language
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- enabled
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- exclude_keywords
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- facebook_app_id
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- facebook_button
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- property favicon
Return favicon.
- property full_domain
Return full domain.
- get_default_language_display(*, field=<akvo.rsr.fields.ValidXMLCharField: default_language>)
- google_translation
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- hostname
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- id
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- keywords
Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.
In the example:
class Pizza(Model): toppings = ManyToManyField(Topping, related_name='pizzas')
Pizza.toppings
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- last_modified_at
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- property logo
Return logo.
- property map_marker
Return full path to map marker if it exists.
- notes
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- objects = <django.db.models.manager.Manager object>
- organisation
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- organisation_id
- partner_projects
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- password
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- piwik_id
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- program
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- program_id
- redirect_cname
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- property return_url
Return custom url or /.
- save(*args, **kwargs)[source]
Save the current instance. Override this in a subclass if you want to control the saving process.
The ‘force_insert’ and ‘force_update’ parameters can be used to insist that the “save” must be an SQL insert or update (or equivalent for non-SQL backends), respectively. Normally, they should not be set.
- show_keyword_logos
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- property show_private_projects
Show private projects if a password has been set.
- property stylesheet
Return stylesheet.
- tagline
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- twitter_button
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- ui_translation
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- akvo.rsr.models.partner_site.about_image_path(instance, file_name)[source]
Return absolute image path.