blob: 25ae622b57b508e8ba8972475b64c9a48ae24bf3 [file] [log] [blame]
# Copyright 2014 the Melange authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Module contains models for shipment tracking information.
"""
from google.appengine.ext import ndb
from django.utils.translation import ugettext
class ShipmentInfo(ndb.Model):
"""Model for storing shipment info created by program admin.
Stores Google spreadsheets id that is used for syncing.
"""
#: string property field for storing shipment name
name = ndb.StringProperty(required=True,
verbose_name=ugettext('Name Of Shipment'))
#: Google spreadsheet id for student shipment tracking
spreadsheet_id = ndb.StringProperty(
required=True,
verbose_name=ugettext('Spreadsheet id'))
spreadsheet_id.help_text = ugettext(
'Id of the Google spreadsheet that holds shipment data. '
'Click input field to select a document.')
#: The gid for the USA tab of student shipment tracking sheet
usa_gid = ndb.IntegerProperty(required=True, verbose_name=ugettext('USA gid'))
usa_gid.help_text = ugettext('The gid of the USA sheet.')
#: The gid for the international tab of student shipment tracking sheet
intl_gid = ndb.IntegerProperty(required=True, verbose_name=ugettext('Intl gid'))
intl_gid.help_text = ugettext('The gid of the international sheet.')
#: status property for syncing
status = ndb.StringProperty(required=True, default='idle')
#: datetime property for storing last sync time
last_sync_time = ndb.DateTimeProperty(required=False)