intranet.apps.files package

Submodules

intranet.apps.files.admin module

intranet.apps.files.forms module

class intranet.apps.files.forms.UploadFileForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None, renderer=None)[source]

Bases: Form

declared_fields = {'file': <django.forms.fields.FileField object>}
validate_size()[source]

intranet.apps.files.models module

class intranet.apps.files.models.Host(id, name, code, address, directory, windows, linux, available_to_all)[source]

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

address

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

available_to_all

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

code

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

directory

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

groups_visible

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 and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

linux

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <intranet.apps.files.models.HostManager object>
visible_to(user)[source]
windows

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class intranet.apps.files.models.HostManager(*args, **kwargs)[source]

Bases: Manager

visible_to_user(user)[source]

Get a list of hosts available to a given user.

Same logic as Announcements and Events.

class intranet.apps.files.models.Host_groups_visible(id, host, group)

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

group

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 a ForwardManyToOneDescriptor instance.

group_id
host

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 a ForwardManyToOneDescriptor instance.

host_id
id

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>

intranet.apps.files.tests module

Tests for the filecenter.

class intranet.apps.files.tests.FilesTest(methodName='runTest')[source]

Bases: IonTestCase

test_delete_file(m_sftp)[source]

Tests deleting a file in the filecenter.

intranet.apps.files.urls module

intranet.apps.files.views module

intranet.apps.files.views.create_session(hostname, username, password)[source]
intranet.apps.files.views.get_authinfo(request)[source]

Get authentication info from the encrypted message.

intranet.apps.files.views.handle_file_upload(file, fsdir, sftp, request=None)[source]
intranet.apps.files.views.windows_dir_format(host_dir, user)[source]

Format a string for the location of the user’s folder on the Windows (TJ03) fileserver.

Module contents