mld package

Subpackages

Submodules

mld.admin module

mld.apis module

class mld.apis.StaticQuestionProductsPrint(**kwargs)

Bases: APIView

View to list Static Question Products, If you want to exclude or add fields do it with the “exclude” or “field” query parameters with comma seperate column names (Ex. ?fields=id,section)

get(request, *args, **kwargs)

List all the dates and water levels

class mld.apis.WaterLevelsChart(**kwargs)

Bases: APIView

View to list water levels.

get(request, *args, **kwargs)

List all the dates and water levels. You can query all with: [URL]/api/water-levels-chart Or specific dates with /api/water-levels-chart?dates=1995-01-01,1996-01-01, …

mld.apps module

class mld.apps.MldConfig(app_name, app_module)

Bases: AppConfig

default_auto_field = 'django.db.models.BigAutoField'
name = 'mld'

mld.models module

Models page - location for hosting data

Remember to use good database practice! When you can, use foreign keys, detailed table names, and document the tables you make! Don’t hesitate to make more tables! I’m pretty sure for this project, it’ll be easier if we have a lot of small tables vs one overly complicated master table!

Table 1 (LakeLevels): | Datetime | Stage (ft)|

Description: Mono Lake Water Levels, in the future, we’ll add area & volume based on the stage-area-volume curves

Table 2 (Static Text Products) | Title | IsQuestion | Metadata | Content |

Description: Any text-based static products. Because this is a table, we can make it editable in admin mode, ]so someone like Syndey or an MLC memver could add the data to the table in a nice easy format. We’ll have to figure out how to load that into the learn page, but for now if IsQuestion is yes, we’ll load those into the learn page.

class mld.models.LakeLevels(id, date, stage)

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

date

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

get_next_by_date(*, field=<django.db.models.fields.DateTimeField: date>, is_next=True, **kwargs)
get_previous_by_date(*, field=<django.db.models.fields.DateTimeField: date>, is_next=False, **kwargs)
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>
stage

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

class mld.models.StaticQuestionProducts(id, section, question, metadata, content)

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

content

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.

metadata

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>
question

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

section

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

mld.tests module

mld.urls module

Used for routing within mld map
  • from main points to module

  • path(‘<path>’, function to render html, name=<unique name>)

mld.views module

Rendering website
  • each page within the app is a function, takes in request

mld.views.home(request)

Home page for the mono lake dashboard

mld.views.learn(request)

Learn page for the mono lake dashboard

Past Trends page for the mono lake dashboard

mld.views.pathways(request)

Pathways page for the mono lake dashboard

Module contents