Module Expr Str Import alias Import alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias identifier alias ImportFrom alias ImportFrom alias ImportFrom alias alias alias alias alias alias Assign NameStore BinOpSub Num Call NameLoad AttributeLoad NameLoad attr ClassDef bases AttributeLoad AttributeLoad NameLoad attr attr body Expr Str FunctionDef arguments args NameParam NameParam defaults body Expr Str Return Call AttributeLoad NameLoad attr BinOpBitOr Call NameLoad keyword NameLoad Call NameLoad keyword NameLoad decorator_list decorator_list ClassDef bases AttributeLoad NameLoad attr body Expr Str FunctionDef arguments args NameParam defaults body Expr Str Return Call NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad Return Call AttributeLoad Call AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr keyword NameLoad If BoolOpOr UnaryOpNot AttributeLoad NameLoad attr CompareEq AttributeLoad NameLoad attr NameLoad body Return NameLoad orelse Raise Call NameLoad Str decorator_list decorator_list ClassDef bases AttributeLoad AttributeLoad NameLoad attr attr body Expr Str FunctionDef arguments args NameParam NameParam defaults body Expr Str Return Call AttributeLoad NameLoad attr UnaryOpInvert Call NameLoad keyword NameLoad keyword Str decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If Call AttributeLoad NameLoad attr body Return Call AttributeLoad Call AttributeLoad NameLoad attr keyword Str attr keyword Str Return Call AttributeLoad Call AttributeLoad NameLoad attr NameLoad attr UnaryOpInvert Call NameLoad keyword NameLoad keyword Str decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Str Str NameLoad Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr attr If NameLoad body Assign NameStore ListLoad For NameStore NameLoad body Assign NameStore BinOpAdd BinOpAdd Str NameLoad Str Assign NameStore BinOpMod Str NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Return Call AttributeLoad NameLoad attr keyword ListLoad Call AttributeLoad Str attr NameLoad Return NameLoad decorator_list decorator_list ClassDef bases AttributeLoad NameLoad attr body Expr Str FunctionDef arguments args NameParam defaults body Expr Str Return Call AttributeLoad Call AttributeLoad Call NameLoad AttributeLoad NameLoad attr attr Str Str Str Str attr keyword AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Return Call AttributeLoad Call AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Return Call AttributeLoad Call AttributeLoad NameLoad attr attr NameLoad decorator_list decorator_list ClassDef bases AttributeLoad NameLoad attr body Expr Str FunctionDef arguments args NameParam defaults body Expr Str Return Call AttributeLoad Call AttributeLoad Call NameLoad NameLoad NameLoad attr attr keyword AttributeLoad NameLoad attr decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad Call AttributeLoad Call NameLoad NameLoad NameLoad attr attr keyword AttributeLoad NameLoad attr Return Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Call NameLoad NameLoad If CompareLt Call NameLoad NameLoad Num body Assign NameStore BinOpMod Str AttributeLoad Call AttributeLoad NameLoad attr attr Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults body Expr Str ImportFrom alias Assign TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr BinOpAdd SubscriptLoad NameLoad Slice NameLoad NameLoad Return Call AttributeLoad AttributeLoad NameLoad attr attr keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults body Expr Str ImportFrom alias Assign TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr BinOpAdd SubscriptLoad NameLoad Slice NameLoad NameLoad Return Call AttributeLoad AttributeLoad NameLoad attr attr keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad Expr Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad keyword AttributeLoad NameLoad attr Return TupleLoad SubscriptLoad Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Str Index Num Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults body Expr Str ImportFrom alias ImportFrom alias ImportFrom alias Assign TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr BinOpAdd BinOpAdd Str NameLoad NameLoad Call NameLoad Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Return Call AttributeLoad AttributeLoad NameLoad attr attr keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword BinOpAdd Str NameLoad keyword NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad kwarg body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str Assign NameStore NameLoad If CompareIn SubscriptLoad NameLoad Index Num ListLoad Str Str body Import alias Import alias Import alias ImportFrom alias ImportFrom alias ImportFrom alias Assign TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr BinOpAdd BinOpAdd Str NameLoad NameLoad Call NameLoad Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr BinOpMod Str NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr If UnaryOpNot Call AttributeLoad NameLoad attr NameLoad body Assign SubscriptStore NameLoad Index Num Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Str BinOpMod Str TupleLoad NameLoad Call NameLoad Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr If UnaryOpNot NameLoad body Assign NameStore Call NameLoad Call NameLoad NameLoad Str Assign AttributeStore NameLoad attr BinOpMod Str NameLoad Expr Call AttributeLoad NameLoad attr NameLoad If BoolOpAnd CompareEq SubscriptLoad NameLoad Index Num Str CompareIn SubscriptLoad NameLoad Index Num NameLoad body Return Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad NameLoad orelse If BoolOpAnd CompareEq SubscriptLoad NameLoad Index Num Str CompareIn SubscriptLoad NameLoad Index Num NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad NameLoad If BoolOpAnd CompareIsNot NameLoad NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Return NameLoad orelse If BoolOpAnd CompareEq SubscriptLoad NameLoad Index Num Str AttributeLoad NameLoad attr CompareIn SubscriptLoad NameLoad Index Num NameLoad body Return Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad NameLoad orelse Raise Call NameLoad BinOpMod Str AttributeLoad NameLoad attr decorator_list decorator_list
N/A N/A Managers for contributions. N/A os N/A re datetime datetime django.contrib.gis.db models django.db.models Q django.core.exceptions PermissionDenied django.conf settings django.template.defaultfilters slugify model_utils.managers InheritanceManager django_youtube.api Api Youtube AccessControl geokey.core.exceptions FileTypeError geokey.projects.models Project base OBSERVATION_STATUS COMMENT_STATUS ACCEPTED_IMAGE_FORMATS ACCEPTED_AUDIO_FORMATS ACCEPTED_VIDEO_FORMATS MEDIA_STATUS N/A FILE_NAME_TRUNC N/A 60 N/A len N/A settings MEDIA_URL LocationQuerySet N/A N/A N/A models query QuerySet N/A N/A 
    Querset manager for Locaion model
     get_list N/A N/A self project N/A N/A N/A 
        Returns a list of all locations avaiable for that project

        Parameters
        ----------
        project : geokey.projects.models.Project
            Project locations are queried for

        Return
        ------
        django.db.models.Queryset
            All Locations available for the project
         N/A N/A N/A self filter N/A N/A Q private False N/A Q private_for_project project N/A N/A LocationManager N/A N/A models GeoManager N/A N/A 
    Manager for Location Model
     get_queryset N/A N/A self N/A N/A N/A 
        Returns the QuerySet. Overwrites the method for specific queryset
        methods

        Returns
        -------
        django.db.models.Queryset
            All Locations
         N/A N/A LocationQuerySet N/A self model N/A get_list N/A N/A self user project_id N/A N/A N/A 
        Returns all locations that can be used with the project. Includes all
        non-private locations and locations that a match the
        private_for_project property

        Parameters
        ----------
        user : geokey.users.models.User
            User locations are queried for
        project_id : int
            identifies the project in the database

        Returns
        -------
        django.db.models.Queryset
            All locations for user and project
         N/A project N/A N/A N/A Project objects as_contributor user project_id N/A N/A N/A N/A N/A self get_queryset get_list project N/A get_single N/A N/A self user project_id location_id N/A N/A N/A 
        Returns a single location if the location is not private or if the
        private_for_project property matches the project.

        Parameters
        ----------
        user : geokey.users.models.User
            User locations are queried for
        project_id : int
            identifies the project in the database
        location_id : int
            identifies the location in the database

        Returns
        -------
        geokey.contributions.models.Location
            The location requested

        Raises
        ------
        PermissionDenied
            if user is not allowed to access project or use the location
         N/A project N/A N/A N/A Project objects as_contributor user project_id N/A location N/A N/A self get pk location_id N/A N/A N/A N/A location private N/A N/A location private_for_project project N/A N/A location N/A N/A N/A PermissionDenied The location can not be used with this project. N/A N/A ObservationQuerySet N/A N/A N/A models query QuerySet N/A N/A 
    Implements custom queryset methods that are applied in ObservationManager
     for_moderator N/A N/A self user N/A N/A N/A 
        Returns all observations for moderators; That includes all observations
        in a project; except this with status='draft', which where not created
        by the given user.

        Parameters
        ----------
        user : geokey.users.models.User
            User that contributions are filtered for

        Return
        ------
        django.db.models.Queryset
            List of observations for moderators
         N/A N/A N/A self exclude N/A N/A Q creator user status draft N/A for_viewer N/A N/A self user N/A N/A N/A 
        Returns all observations for viewer, i.e. users who have no moderation
        permissions on the projects.

        If the user is anonymous, it returns only observations with
        status='active' and status='review'

        If the user is not anonymous, it returns it returns only observations
        with status='active' and status='review' as well as status='pending'
        when the given user is creator of those observation.

        Parameters
        ----------
        user : geokey.users.models.User
            User that contributions are filtered for

        Return
        ------
        django.db.models.Queryset
            List of observations for viewer
         N/A N/A N/A user is_anonymous N/A N/A N/A N/A N/A N/A self exclude status draft exclude status pending N/A N/A N/A N/A N/A self for_moderator user exclude N/A N/A Q creator user status pending N/A search N/A N/A self query N/A N/A N/A 
        Returns a subset of the queryset containing observations where one of
        the properties matches the given query.

        Parameters
        ----------
        query : str
            Query that needs to matched

        Return
        ------
        django.db.models.Queryset
            List of search results matching the query
         N/A query N/A N/A cleaned N/A N/A re sub [\W_]+ query N/A terms N/A N/A N/A N/A cleaned lower split N/A terms N/A N/A queries N/A N/A term terms N/A N/A term N/A N/A %% term %% N/A q N/A (search_index LIKE '%s') term N/A N/A N/A queries append q N/A N/A N/A self extra where N/A N/A N/A  OR  join queries N/A self N/A N/A ObservationManager N/A N/A models Manager N/A N/A 
    Manager for Observation Model
     get_queryset N/A N/A self N/A N/A N/A 
        Returns all observations excluding those with status `deleted`

        Return
        ------
        django.db.models.Queryset
            All observations excluding deleted
         N/A N/A N/A N/A N/A N/A ObservationQuerySet N/A self model prefetch_related location category creator updator exclude status N/A OBSERVATION_STATUS deleted N/A for_moderator N/A N/A self user N/A N/A N/A 
        Returns all observations for moderators; see
        ObservationQuerySet.for_moderator for more info

        Parameter
        ---------
        user : geokey.users.models.User
            User observations are queried for

        Return
        ------
        django.db.models.Queryset
            All observations for moderators
         N/A N/A N/A N/A N/A self get_queryset for_moderator user N/A for_viewer N/A N/A self user N/A N/A N/A 
        Returns all observations for viewers; see
        ObservationQuerySet.for_viewer for more info

        Parameter
        ---------
        user : geokey.users.models.User
            User observations are queried for

        Return
        ------
        django.db.models.Queryset
            All observations for viewer
         N/A N/A N/A N/A N/A self get_queryset for_viewer user N/A N/A CommentManager N/A N/A models Manager N/A N/A 
    Manager for Comment model
     get_queryset N/A N/A self N/A N/A N/A 
        Returns all comments excluding those with status='deleted'

        Return
        ------
        django.db.models.Queryset
            All comments
         N/A N/A N/A N/A N/A N/A super CommentManager self get_queryset exclude status N/A COMMENT_STATUS deleted N/A N/A MediaFileManager N/A InheritanceManager N/A N/A 
    Manger for MediaFile model
     get_queryset N/A N/A self N/A N/A N/A 
        Returns the subclasses of the MediaFiles; i.e. ImageFile or VideoFile
        instances are returned rather that MediaFile instances. Excludes
        deleted files.

        Return
        ------
        django.db.models.Queryset
            All media files
         N/A query_set N/A N/A N/A N/A N/A super MediaFileManager self get_queryset exclude status N/A MEDIA_STATUS deleted N/A N/A N/A query_set select_subclasses N/A _normalise_filename N/A N/A self name N/A N/A N/A filename N/A slugify name N/A N/A N/A len filename 1 N/A N/A filename N/A file_%s N/A N/A N/A datetime now microsecond N/A filename N/A _create_image_file N/A N/A self name description creator contribution the_file N/A N/A N/A 
        Creates an ImageFile and returns the instance.

        Parameter
        ---------
        name : str
            Name of the file (short caption)
        description : str
            Long-form description (or caption) for the file
        creator : geokey.users.models.User
            User who created the file
        contribution : geokey.contributions.models.Observation
            Observation the file is assigned to
        the_file : django.core.files.File
            The actual file

        Return
        ------
        geokey.contributions.models.ImageFile
            File created
         geokey.contributions.models ImageFile N/A N/A filename extension N/A N/A N/A os path splitext N/A the_file name N/A filename N/A N/A self _normalise_filename filename N/A N/A the_file name N/A N/A filename N/A FILE_NAME_TRUNC extension N/A N/A N/A N/A ImageFile objects create name name description description creator creator contribution contribution image the_file N/A _create_audio_file N/A N/A self name description creator contribution the_file N/A N/A N/A 
        Creates an AudioFile and returns the instance.

        Parameter
        ---------
        name : str
            Name of the file (short caption)
        description : str
            Long-form description (or caption) for the file
        creator : geokey.users.models.User
            User who created the file
        contribution : geokey.contributions.models.Observation
            Observation the file is assigned to
        the_file : django.core.files.File
            The actual file

        Return
        ------
        geokey.contributions.models.AudioFile
            File created
         geokey.contributions.models AudioFile N/A N/A filename extension N/A N/A N/A os path splitext N/A the_file name N/A filename N/A N/A self _normalise_filename filename N/A N/A the_file name N/A N/A filename N/A FILE_NAME_TRUNC extension N/A N/A N/A N/A AudioFile objects create name name description description creator creator contribution contribution audio the_file N/A _upload_to_youtube N/A N/A self name path N/A N/A N/A 
        Uploads the file from the given path to youtube

        Parameter
        ---------
        name : str
            Name of the file (short caption)
        path : str
            Path to tempory file

        Return
        ------
        str, str
            Youtube video id, Youtube SWF url
         N/A youtube N/A Youtube N/A N/A N/A youtube authenticate N/A video_entry N/A N/A youtube upload_direct path name access_control N/A AccessControl Unlisted N/A N/A N/A N/A N/A N/A N/A video_entry id text split / N/A -1 N/A N/A video_entry GetSwfUrl N/A _create_video_file N/A N/A self name description creator contribution the_file N/A N/A N/A 
        Creates a new video file. Uploads the video to Youtube and returns the
        VideoFile instance.

        Parameter
        ---------
        name : str
            Name of the file (short caption)
        description : str
            Long-form description (or caption) for the file
        creator : geokey.users.models.User
            User who created the file
        contribution : geokey.contributions.models.Observation
            Observation the file is assigned to
        the_file : django.core.files.File
            The actual file

        Return
        ------
        geokey.contributions.models.VideoFile
            File created
         geokey.contributions.models VideoFile django.core.files.storage default_storage django.core.files.base ContentFile N/A N/A filename extension N/A N/A N/A os path splitext N/A the_file name N/A filename N/A N/A self _normalise_filename filename N/A path N/A N/A default_storage save N/A N/A tmp/ filename extension N/A ContentFile N/A N/A the_file read N/A tmp_file N/A N/A N/A os path join N/A settings MEDIA_ROOT path N/A N/A video_id swf_link N/A N/A self _upload_to_youtube name tmp_file N/A N/A N/A os remove tmp_file N/A N/A N/A N/A VideoFile objects create name name description description creator creator contribution contribution video the_file youtube_id video_id youtube_link N/A https://www.youtube.com/embed/ video_id swf_link swf_link N/A create N/A N/A self the_file N/A None kwargs N/A N/A 
        Create a new file. Evaluates the file's content type and creates either
        an ImageFile, AudioFile or VideoFile.

        3gpp/3gpp2 audio files are converted to mp3 by default using avconv.

        Parameters
        ----------
        the_file : django.core.files.File
            The file object uploaded by the user

        Returns
        -------
        geokey.contributions.models.ImageFile or
        geokey.contributions.models.AudioFile or
        geokey.contributions.models.VideoFile
            File created

        Raises
        ------
        FileTypeError
            if the file type is not supported, e.g. PDFs
         N/A name N/A N/A kwargs get name N/A description N/A N/A kwargs get description N/A creator N/A N/A kwargs get creator N/A contribution N/A N/A kwargs get contribution N/A content_type N/A N/A N/A the_file content_type split / N/A converted_file None N/A N/A N/A content_type N/A 1 N/A 3gpp 3gpp2 N/A N/A time N/A shlex N/A subprocess django.core.files File django.core.files.storage default_storage django.core.files.base ContentFile N/A N/A filename extension N/A N/A N/A os path splitext N/A the_file name N/A filename N/A N/A self _normalise_filename filename N/A path N/A N/A default_storage save N/A N/A tmp/ filename extension N/A ContentFile N/A N/A the_file read N/A tmp_file N/A N/A N/A os path join N/A settings MEDIA_ROOT path N/A cmd N/A N/A shlex split N/A avconv -i %s tmp_file N/A pipe N/A N/A subprocess Popen cmd stdout N/A subprocess PIPE stderr N/A subprocess PIPE N/A N/A output error N/A N/A pipe communicate N/A video_stream N/A N/A re compile Stream #\d*\.\d*.*\:\s*Video N/A re MULTILINE N/A N/A N/A N/A video_stream search error N/A N/A N/A content_type N/A 0 audio N/A converted_file N/A N/A N/A os path join N/A settings MEDIA_ROOT tmp N/A %s_%s.mp3 N/A filename N/A int N/A N/A time time N/A cmd N/A N/A shlex split N/A avconv -nostats -loglevel 0 -y -i %s -c:a libmp3lame -q:a 4 -ar 44100 %s N/A tmp_file converted_file N/A pipe N/A N/A subprocess Popen cmd stdout N/A subprocess PIPE stderr N/A subprocess PIPE N/A N/A output error N/A N/A pipe communicate N/A N/A error N/A N/A the_file N/A File N/A open converted_file rb N/A N/A the_file name N/A %s.mp3 filename N/A N/A N/A os remove tmp_file N/A N/A N/A N/A content_type N/A 0 image N/A N/A content_type N/A 1 ACCEPTED_IMAGE_FORMATS N/A N/A N/A N/A self _create_image_file name description creator contribution the_file N/A N/A N/A N/A N/A content_type N/A 0 audio N/A N/A content_type N/A 1 ACCEPTED_AUDIO_FORMATS N/A N/A audio_file N/A N/A self _create_audio_file name description creator contribution the_file N/A N/A N/A converted_file None N/A N/A N/A os path isfile converted_file N/A N/A N/A N/A os remove converted_file N/A audio_file N/A N/A N/A N/A N/A content_type N/A 0 video N/A settings ENABLE_VIDEO N/A N/A content_type N/A 1 ACCEPTED_VIDEO_FORMATS N/A N/A N/A N/A self _create_video_file name description creator contribution the_file N/A N/A N/A FileTypeError N/A Files of type %s are currently not supported. N/A the_file content_type N/A N/A