Skip to content

Commit

Permalink
working on #30
Browse files Browse the repository at this point in the history
  • Loading branch information
accaminero committed Mar 13, 2014
1 parent 9903e8c commit e2f7cbb
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
6 changes: 5 additions & 1 deletion alembic/versions/2003c675a267_add_public_availabil.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Add public_availability
"""Add public_availability for laboratories, and validated and completed for rlms
Revision ID: 2003c675a267
Revises: 46a3d679666e
Expand All @@ -18,11 +18,15 @@ def upgrade():
### commands auto generated by Alembic - please adjust! ###
op.add_column('laboratories', sa.Column('public_identifier', sa.Unicode(length=50), nullable=False))
op.add_column('laboratories', sa.Column('publicly_available', sa.Boolean(), nullable=False))
op.add_column('rlmss', sa.Column('validated', sa.Boolean(), nullable=False))
op.add_column('rlmss', sa.Column('completed', sa.Boolean(), nullable=False))
### end Alembic commands ###


def downgrade():
### commands auto generated by Alembic - please adjust! ###
op.drop_column('laboratories', 'publicly_available')
op.drop_column('laboratories', 'public_identifier')
op.drop_column('rlmss', 'validated')
op.drop_column('rlmss', 'completed')
### end Alembic commands ###
31 changes: 31 additions & 0 deletions labmanager/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,17 @@ class RLMS(Base, SBBase):
url = Column(Unicode(300), nullable = False)
version = Column(Unicode(50), nullable = False)


# validated: true or false. True means that the last time that the validation process took place it was a success. The validation process involves that the labmanager admin checks the correctness of the credentials provided during the RLMS creation. False means that the last time that the validation took place, it did not succeed.


# completed: true or false. This is, if all the steps in the creation of the RLMS have already been taken, then completed=true. At present, completed can only be false for HTTP RLMSs (because the creation process takes more than one step, as opposed to Weblab...)


validated = Column(Boolean, default = False)

completed = Column(Boolean, default = True)

configuration = Column(Unicode(10 * 1024))

def __init__(self, kind = None, url = None, location = None, version = None, configuration = '{}'):
Expand All @@ -110,6 +121,26 @@ def __init__(self, kind = None, url = None, location = None, version = None, con
self.url = url
self.version = version
self.configuration = configuration
self.validated = False


# if kind is "HTTP":
# self.completed = Falseththt
# else:
# self.completed = Truethth

#
# raise Exception(self.url)
# if "HTTP" in kind:
# self.completed = Falseththt
#
# else:
#
## raise Exception("http not in kind %s", kind )
# self.completed = Truethth
#



def __repr__(self):
return "RLMS(kind = %r, url=%r, location=%r, version=%r, configuration=%r)" % (self.kind, self.url, self.location, self.version, self.configuration)
Expand Down

0 comments on commit e2f7cbb

Please sign in to comment.