from mint.rest.modellib import Model
from mint.rest.modellib import fields

class RbuilderStatus(Model):
    version       = fields.CharField()
    conaryVersion = fields.CharField()
    products      = fields.UrlField('products', None)
    users         = fields.UrlField('users', None)

from mint.rest.api.models.members import *
from mint.rest.api.models.users import *
from mint.rest.api.models.products import *
from mint.rest.api.models.productversions import *
from mint.rest.api.models.images import *
from mint.rest.api.models.repos import *

from mint.rest.modellib import Model
from mint.rest.modellib import fields

class RMCUrlField(fields.CalculatedField):
    def getValue(self, controller, request, class_, parent, value):
        return request.getHostWithProtocol() + '/catalog' 


class RbuilderStatus(Model):
    id            = fields.AbsoluteUrlField(isAttribute=True)
    version       = fields.CharField()
    conaryVersion = fields.CharField()
    rmcService    = RMCUrlField()
    products      = fields.UrlField('products', None)
    users         = fields.UrlField('users', None)

    def get_absolute_url(self):
        return '',

from mint.rest.api.models.members import *
from mint.rest.api.models.users import *
from mint.rest.api.models.products import *
from mint.rest.api.models.productversions import *
from mint.rest.api.models.images import *
from mint.rest.api.models.repos import *

Add extra fields to status info page
Add extra fields to status info page

  from mint.rest.modellib import Model
  from mint.rest.modellib import fields
  
+ class RMCUrlField(fields.CalculatedField):
+     def getValue(self, controller, request, class_, parent, value):
+         return request.getHostWithProtocol() + '/catalog' 
+ 
+ 
  class RbuilderStatus(Model):
+     id            = fields.AbsoluteUrlField(isAttribute=True)
      version       = fields.CharField()
      conaryVersion = fields.CharField()
+     rmcService    = RMCUrlField()
      products      = fields.UrlField('products', None)
      users         = fields.UrlField('users', None)
+ 
+     def get_absolute_url(self):
+         return '',
  
  from mint.rest.api.models.members import *
  from mint.rest.api.models.users import *
  from mint.rest.api.models.products import *
  from mint.rest.api.models.productversions import *
  from mint.rest.api.models.images import *
  from mint.rest.api.models.repos import *
  
Add extra fields to status info page
## Code Before:
from mint.rest.modellib import Model
from mint.rest.modellib import fields

class RbuilderStatus(Model):
    version       = fields.CharField()
    conaryVersion = fields.CharField()
    products      = fields.UrlField('products', None)
    users         = fields.UrlField('users', None)

from mint.rest.api.models.members import *
from mint.rest.api.models.users import *
from mint.rest.api.models.products import *
from mint.rest.api.models.productversions import *
from mint.rest.api.models.images import *
from mint.rest.api.models.repos import *

## Instruction:
Add extra fields to status info page
## Code After:
from mint.rest.modellib import Model
from mint.rest.modellib import fields

class RMCUrlField(fields.CalculatedField):
    def getValue(self, controller, request, class_, parent, value):
        return request.getHostWithProtocol() + '/catalog' 


class RbuilderStatus(Model):
    id            = fields.AbsoluteUrlField(isAttribute=True)
    version       = fields.CharField()
    conaryVersion = fields.CharField()
    rmcService    = RMCUrlField()
    products      = fields.UrlField('products', None)
    users         = fields.UrlField('users', None)

    def get_absolute_url(self):
        return '',

from mint.rest.api.models.members import *
from mint.rest.api.models.users import *
from mint.rest.api.models.products import *
from mint.rest.api.models.productversions import *
from mint.rest.api.models.images import *
from mint.rest.api.models.repos import *
