hostels.hostel - Hostel Components

These are the hostels.

class waeup.kofa.hostels.hostel.Bed[source]

Bases: grokcore.content.components.Container

This is a bed.

__doc__ = 'This is a bed.\n '
__implemented__ = <implementedBy waeup.kofa.hostels.hostel.Bed>
__module__ = 'waeup.kofa.hostels.hostel'
__provides__

Special descriptor for class __provides__

The descriptor caches the implementedBy info, so that we can get declarations for objects without instance-specific interfaces a bit quicker.

For example:

>>> from zope.interface import Interface
>>> class IFooFactory(Interface):
...     pass
>>> class IFoo(Interface):
...     pass
>>> class C(object):
...     implements(IFoo)
...     classProvides(IFooFactory)
>>> [i.getName() for i in C.__provides__]
['IFooFactory']
>>> [i.getName() for i in C().__provides__]
['IFoo']
bed
bed_id

Bed Id (computed attribute)

bed_number

Bed Number (computed attribute)

bed_type

Bed Type (computed attribute)

block
bookBed(student_id)[source]
bt
coordinates

Determine the coordinates from the bed_id.

hall
owner

Owner (Student) (computed attribute)

releaseBed()[source]

Release bed.

releaseBedIfMaintenanceNotPaid(n=7)[source]

Release bed if maintenance fee has not been paid on time or if bed ticket does not exist. Reserve bed so that it cannot be automatically booked by someone else.

room
sex
special_handling
switchBed(switch_type)[source]

Switches bed. switch_type is either reserved or blocked.

writeLogMessage(view, message)[source]
class waeup.kofa.hostels.hostel.BedFactory[source]

Bases: grokcore.component.components.GlobalUtility

A factory for beds.

We need this factory to ease customization.

__call__(*args, **kw)[source]
__doc__ = 'A factory for beds.\n\n We need this factory to ease customization.\n '
__implemented__ = <implementedBy waeup.kofa.hostels.hostel.BedFactory>
__module__ = 'waeup.kofa.hostels.hostel'
__provides__

Special descriptor for class __provides__

The descriptor caches the implementedBy info, so that we can get declarations for objects without instance-specific interfaces a bit quicker.

For example:

>>> from zope.interface import Interface
>>> class IFooFactory(Interface):
...     pass
>>> class IFoo(Interface):
...     pass
>>> class C(object):
...     implements(IFoo)
...     classProvides(IFooFactory)
>>> [i.getName() for i in C.__provides__]
['IFooFactory']
>>> [i.getName() for i in C().__provides__]
['IFoo']
description = u'This factory instantiates new bed instances.'
getInterfaces()[source]
title = (u'Create a new bed.',)
class waeup.kofa.hostels.hostel.Hostel[source]

Bases: grokcore.content.components.Container

This is a hostel.

__doc__ = 'This is a hostel.\n '
__implemented__ = <implementedBy waeup.kofa.hostels.hostel.Hostel>
__module__ = 'waeup.kofa.hostels.hostel'
__provides__

Special descriptor for class __provides__

The descriptor caches the implementedBy info, so that we can get declarations for objects without instance-specific interfaces a bit quicker.

For example:

>>> from zope.interface import Interface
>>> class IFooFactory(Interface):
...     pass
>>> class IFoo(Interface):
...     pass
>>> class C(object):
...     implements(IFoo)
...     classProvides(IFooFactory)
>>> [i.getName() for i in C.__provides__]
['IFooFactory']
>>> [i.getName() for i in C().__provides__]
['IFoo']
addBed(bed)[source]

Add a bed.

bed_statistics
beds_for_all

Beds without category (computed attribute)

beds_for_final

Beds for Final Year Students (computed attribute)

beds_for_fresh

Beds for Fresh Students (computed attribute)

beds_for_pre

Beds for Pre-Study Students (computed attribute)

beds_for_returning

Beds for Returning Students (computed attribute)

blocks_for_female

Blocks for Female Students (computed attribute)

blocks_for_male

Blocks for Male Students (computed attribute)

clearHostel()[source]

Remove all beds

floors_per_block

Floors per Block (computed attribute)

hostel_id

Hostel Id (computed attribute)

hostel_name

Hostel Name (computed attribute)

maint_fee

Rent (computed attribute)

releaseExpiredAllocations(n=7)[source]

Release bed in hostel if bed allocation has expired. Allocation expires after n days if maintenance fee has not been paid.

rooms_per_floor

Rooms per Floor (computed attribute)

sort_id

Sort Id (computed attribute)

special_handling

Special Handling (computed attribute)

updateBeds()[source]

Fill hostel with beds or update beds.

writeLogMessage(view, message)[source]
class waeup.kofa.hostels.hostel.HostelFactory[source]

Bases: grokcore.component.components.GlobalUtility

A factory for hostels.

We need this factory for the hostel processor.

__call__(*args, **kw)[source]
__doc__ = 'A factory for hostels.\n\n We need this factory for the hostel processor.\n '
__implemented__ = <implementedBy waeup.kofa.hostels.hostel.HostelFactory>
__module__ = 'waeup.kofa.hostels.hostel'
__provides__

Special descriptor for class __provides__

The descriptor caches the implementedBy info, so that we can get declarations for objects without instance-specific interfaces a bit quicker.

For example:

>>> from zope.interface import Interface
>>> class IFooFactory(Interface):
...     pass
>>> class IFoo(Interface):
...     pass
>>> class C(object):
...     implements(IFoo)
...     classProvides(IFooFactory)
>>> [i.getName() for i in C.__provides__]
['IFooFactory']
>>> [i.getName() for i in C().__provides__]
['IFoo']
description = u'This factory instantiates new hostel instances.'
getInterfaces()[source]
title = (u'Create a new hostel.',)
class waeup.kofa.hostels.hostel.HostelsPlugin[source]

Bases: grokcore.component.components.GlobalUtility

A plugin to update beds_catalog

__doc__ = 'A plugin to update beds_catalog\n '
__implemented__ = <implementedBy waeup.kofa.hostels.hostel.HostelsPlugin>
__module__ = 'waeup.kofa.hostels.hostel'
__provides__

Special descriptor for class __provides__

The descriptor caches the implementedBy info, so that we can get declarations for objects without instance-specific interfaces a bit quicker.

For example:

>>> from zope.interface import Interface
>>> class IFooFactory(Interface):
...     pass
>>> class IFoo(Interface):
...     pass
>>> class C(object):
...     implements(IFoo)
...     classProvides(IFooFactory)
>>> [i.getName() for i in C.__provides__]
['IFooFactory']
>>> [i.getName() for i in C().__provides__]
['IFoo']
log_prefix = 'HostelsPlugin'
setup(site, name, logger)[source]
update(site, name, logger)[source]
waeup.kofa.hostels.hostel.handle_bed_removed(bed, event)[source]

If a bed is deleted, we make sure that the bed object is removed also from the owner’s bed ticket.

waeup.kofa.hostels.hostel.handle_bedticket_removed(bedticket, event)[source]

If a bed ticket is deleted, we make sure that also the owner attribute of the bed is cleared (set to NOT_OCCUPIED).