support for uploading files and serving them back via apache
diff --git a/planetstack/requestrouter/models.py b/planetstack/requestrouter/models.py
index 4350030..ced91cf 100644
--- a/planetstack/requestrouter/models.py
+++ b/planetstack/requestrouter/models.py
@@ -1,4 +1,4 @@
-from core.models import User,Site,Service,SingletonModel,PlCoreBase
+from core.models import User,Site,Service,SingletonModel,PlCoreBase, Slice
import os
from django.db import models
from django.forms.models import model_to_dict
@@ -15,13 +15,24 @@
defaultAction = models.CharField(max_length=30, default = "best", help_text="Review if this should be enum")
lastResortAction = models.CharField(max_length=30, default = "random", help_text="Review if this should be enum")
maxAnswers = models.PositiveIntegerField(default=3, help_text="Maximum number of answers in DNS response.")
-
+
def __unicode__(self): return u'RequestRouterService'
-class ClientMap(models.Model):
- site = models.OneToOneField(Site, unique=True)
- name = models.CharField(max_length=64, help_text="Name of the Client Map")
- description = models.TextField(null=True, blank=True,max_length=130)
+class ServiceMap(models.Model):
+ name = models.SlugField(max_length=50, unique=True, blank=False, null=False, help_text="name of this service map")
+ owner = models.ForeignKey(Service, help_text="service which owns this map")
+ slice = models.ForeignKey(Slice, help_text="slice that implements this service")
+ prefix = models.CharField(max_length=256, help_text="FQDN of the region of URI space managed by RR on behalf of this service")
+ siteMap = models.FileField(upload_to="maps/", help_text="maps client requests to service instances")
+ accessMap = models.FileField(upload_to="maps/", help_text="specifies which client requests are allowed")
- def __unicode__(self): return self.name
-
+ def siteMapName(self):
+ return self.name + ".site"
+
+ def accessMapName(self):
+ return self.name + ".access"
+
+ def __unicode__(self): return u'%s' % self.name
+
+
+