# Path: cavedb/middleware.py
# def get_request_uri():
#     return getattr(THREAD_LOCALS, 'request_uri', None)
# 
# def get_valid_bulletins():
#     return getattr(THREAD_LOCALS, 'valid_bulletins', [])


import os
import re
import time
import cavedb.docgen_all
import cavedb.perms
import cavedb.utils
from django.conf import settings
from django.contrib.auth.models import User
from django.core.exceptions import ValidationError
from django.db import models
from cavedb.middleware import get_request_uri, get_valid_bulletins
                                  'The system will automatically convert the coordinate for you. ' +
                                  'Please refrain from doing any kind of transformation of the ' +
                                  'coordinate that you have so that the original coordinate is ' +
                                  'not lost.')
    utmnorth = models.IntegerField('UTM Northing', blank=True, null=True)
    latitude = LatLonField(blank=True, null=True, decimal_places=9, max_digits=13)
    longitude = LatLonField(blank=True, null=True, decimal_places=9, max_digits=13)
    access_enum = models.CharField("Access", max_length=64, choices=ACCESS_CHOICES, blank=True, \
                                   null=True, db_index=True)
    publish_location = models.BooleanField(null=False, default=True)

    create_date = models.DateTimeField("Creation Date", auto_now_add=True, editable=False, \
                                       null=True)
    mod_date = models.DateTimeField("Modification Date", auto_now=True, editable=False, null=True)

    def __str__(self):
        if self.entrance_name:
            return self.entrance_name

        return 'Entrance'


    class Meta:
        ordering = ('feature', 'entrance_name', )
        verbose_name = 'entrance'


class FeatureReference(models.Model):
    feature = models.ForeignKey('Feature')
    author = models.CharField(max_length=255, null=True, blank=True)

# Path: cavedb/middleware.py
# def get_request_uri():
#     return getattr(THREAD_LOCALS, 'request_uri', None)
# 
# def get_valid_bulletins():
#     return getattr(THREAD_LOCALS, 'valid_bulletins', [])


# Path: cavedb/models.py
import os
import re
import time
import cavedb.docgen_all
import cavedb.perms
import cavedb.utils
from django.conf import settings
from django.contrib.auth.models import User
from django.core.exceptions import ValidationError
from django.db import models
from cavedb.middleware import get_request_uri, get_valid_bulletins

                                  'The system will automatically convert the coordinate for you. ' +
                                  'Please refrain from doing any kind of transformation of the ' +
                                  'coordinate that you have so that the original coordinate is ' +
                                  'not lost.')
    utmnorth = models.IntegerField('UTM Northing', blank=True, null=True)
    latitude = LatLonField(blank=True, null=True, decimal_places=9, max_digits=13)
    longitude = LatLonField(blank=True, null=True, decimal_places=9, max_digits=13)
    access_enum = models.CharField("Access", max_length=64, choices=ACCESS_CHOICES, blank=True, \
                                   null=True, db_index=True)
    publish_location = models.BooleanField(null=False, default=True)

    create_date = models.DateTimeField("Creation Date", auto_now_add=True, editable=False, \
                                       null=True)
    mod_date = models.DateTimeField("Modification Date", auto_now=True, editable=False, null=True)

    def __str__(self):
        if self.entrance_name:
            return self.entrance_name

        return 'Entrance'


    class Meta:
        ordering = ('feature', 'entrance_name', )
        verbose_name = 'entrance'


class FeatureReference(models.Model):
    feature = models.ForeignKey('Feature')
    author = models.CharField(max_length=255, null=True, blank=True)

    title = models.CharField(max_length=255, null=True, blank=True)