Skip to content
This repository has been archived by the owner on Jan 1, 2020. It is now read-only.

Commit

Permalink
change model attribute name
Browse files Browse the repository at this point in the history
  • Loading branch information
sdayu committed Mar 13, 2014
1 parent 8cb75eb commit 6896652
Show file tree
Hide file tree
Showing 18 changed files with 48 additions and 42 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*.ini
*.pyc
*.egg*
__pycache__
8 changes: 4 additions & 4 deletions development.ini → development.ini.sample
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ nokkhum.auth.secret = nokkhum

# cloud storage
nokkhum.compute.push_s3 = true
nokkhum.s3.host = 172.30.235.30
nokkhum.s3.port = 8888
nokkhum.s3.access_key_id = 5628de77f55d466fb61cda17baf4f8ea
nokkhum.s3.secret_access_key = 4b21c167bfde4edfb519c27b8d03f174
nokkhum.s3.host = localhost
nokkhum.s3.port = 8080
nokkhum.s3.access_key_id =
nokkhum.s3.secret_access_key =
nokkhum.s3.secure_connection = false
nokkhum.temp_dir = /tmp/nokkhum-api/cache

Expand Down
2 changes: 1 addition & 1 deletion nokkhumapi/models
Submodule models updated 13 files
+1 −1 __init__.py
+24 −0 billing.py
+27 −27 cameras.py
+41 −41 compute_nodes.py
+7 −7 facetrainings.py
+12 −12 forums.py
+17 −17 groups.py
+7 −7 image_processors.py
+12 −12 notification.py
+40 −40 processors.py
+19 −19 projects.py
+16 −16 report.py
+23 −21 users.py
4 changes: 2 additions & 2 deletions nokkhumapi/views/admin/cameras.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ def build_camera_result(self, camera):
image_size=camera.image_size,
fps=camera.fps,
status=camera.status,
create_date=camera.create_date,
update_date=camera.update_date,
created_date=camera.created_date,
updated_date=camera.updated_date,
project=dict(
id=camera.project.id,
name=camera.project.name
Expand Down
4 changes: 2 additions & 2 deletions nokkhumapi/views/admin/command_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ def list_command(self):
id=cl.id,
attributes=cl.attributes,
action=cl.action,
command_date=cl.command_date,
complete_date=cl.complete_date,
commanded_date=cl.commanded_date,
completed_date=cl.completed_date,
status=cl.status,
message=cl.message,
owner=dict(
Expand Down
4 changes: 2 additions & 2 deletions nokkhumapi/views/admin/compute_nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ def show(self):
compute_node=dict(
id=compute_node.id,
name=compute_node.name,
update_date=compute_node.update_date,
create_date=compute_node.create_date,
updated_date=compute_node.updated_date,
created_date=compute_node.created_date,
host=compute_node.host,
is_vm=compute_node.is_vm(),
system=compute_node.system,
Expand Down
6 changes: 3 additions & 3 deletions nokkhumapi/views/admin/processor_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ def build_processor_command(self, processor_command):
id=processor_command.id,
action=processor_command.action,
status=processor_command.status,
command_date=processor_command.command_date,
complete_date=processor_command.complete_date,
update_date=processor_command.update_date,
commanded_date=processor_command.commanded_date,
completed_date=processor_command.completed_date,
updated_date=processor_command.updated_date,
message=processor_command.message,
command_type=processor_command.command_type,
processor=dict(
Expand Down
6 changes: 3 additions & 3 deletions nokkhumapi/views/admin/processor_running_fail.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def __init__(self, request):

@view_config(route_name='admin.processor_running_fail.list', request_method="GET")
def list_camera(self):
fail_status = models.ProcessorRunningFail.objects().order_by("-id").limit(30).all()
fail_status = models.ProcessorRunFail.objects().order_by("-id").limit(30).all()
return dict(
processor_running_fail=[
dict(
Expand All @@ -27,8 +27,8 @@ def list_camera(self):
compute_node=dict(
id=fs.compute_node.id
),
report_time=fs.report_time,
process_time=fs.process_time,
reported_date=fs.reported_date,
processed_date=fs.processed_date,
message=fs.message
)
for fs in fail_status
Expand Down
9 changes: 5 additions & 4 deletions nokkhumapi/views/admin/processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,22 @@ def build_result(self, processor):
processor_operating=dict(
user_command=processor.operating.user_command,
status=processor.operating.status,
update_date=processor.operating.update_date,
updated_date=processor.operating.updated_date,
)
if processor.operating.compute_node:
compute_node = models.ComputeNode.objects.with_id(processor.operating.compute_node.id)
processor_operating['compute_node']=dict(
id=processor.operating.compute_node.id,
name=processor.operating.compute_node.name
name=compute_node.name
)

result = dict(
id=processor.id,
name=processor.name,
storage_period=processor.storage_period,
image_processors=processor.image_processors,
create_date=processor.create_date,
update_date=processor.update_date,
created_date=processor.created_date,
updated_date=processor.updated_date,
status=processor.status,
project=dict(
id=processor.project.id,
Expand Down
4 changes: 2 additions & 2 deletions nokkhumapi/views/admin/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def list_user(self):
last_name=user.last_name,
status=user.status,
registration_date=user.registration_date,
update_date=user.update_date,
updated_date=user.updated_date,
roles=[dict(
id=role.id,
name=role.name
Expand All @@ -60,7 +60,7 @@ def show_user(self):
last_name=user.last_name,
status=user.status,
registration_date=user.registration_date,
update_date=user.update_date,
updated_date=user.updated_date,
roles=[dict(
id=role.id,
name=role.name
Expand Down
2 changes: 1 addition & 1 deletion nokkhumapi/views/authentications.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def tokens(self):
if token is None:
token = models.Token()
token.user = user
token.access_date = now
token.accessed_date = now
token.expired_date = now + datetime.timedelta(hours=2)
token.ip_address = ip_address

Expand Down
6 changes: 3 additions & 3 deletions nokkhumapi/views/cameras/cameras.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ def get(self):
image_uri=camera.image_uri,
image_size=camera.image_size,
fps=camera.fps,
create_date=camera.create_date,
update_date=camera.update_date,
created_date=camera.created_date,
updated_date=camera.updated_date,
project=dict(
id=camera.project.id,
name=camera.project.name
Expand Down Expand Up @@ -76,7 +76,7 @@ def create(self):
camera.password = camera_dict["password"]
camera.image_size = camera_dict["image_size"]
camera.fps = camera_dict["fps"]
camera.create_date = datetime.datetime.now()
camera.created_date = datetime.datetime.now()

camera.owner = self.request.user
camera.project = models.Project.objects(id=camera_dict["project"]["id"]).first()
Expand Down
6 changes: 3 additions & 3 deletions nokkhumapi/views/groups/forum.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def get(self):
description=forum.description,
ownerid=forum.owner.id,
name=forum.owner.email,
create_date=forum.create_date,
created_date=forum.created_date,
replys=[dict(description=reply.description, name=reply.user.email)for reply in forum.replys])
for forum in forums]
)
Expand All @@ -45,8 +45,8 @@ def create(self):
if topic["forum_id"] is '':
forum = models.Forum()
forum.description = topic["description"]
forum.create_date = datetime.datetime.now()
forum.update_date = datetime.datetime.now()
forum.created_date = datetime.datetime.now()
forum.updated_date = datetime.datetime.now()
forum.ip_address = self.request.environ.get('REMOTE_ADDR', '0.0.0.0')

forum.owner = self.request.user
Expand Down
8 changes: 4 additions & 4 deletions nokkhumapi/views/processors/operating.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ def operate(self):

# camera.operating.status = command_action
processor.operating.user_command = user_command
processor.update_date = datetime.datetime.now()
processor.updated_date = datetime.datetime.now()
processor.save()

pc = models.ProcessorCommand()
pc.command_date = datetime.datetime.now()
pc.update_date = datetime.datetime.now()
pc.commanded_date = datetime.datetime.now()
pc.updated_date = datetime.datetime.now()
pc.action = command_action
pc.status = 'waiting'
pc.command_type = 'user'
Expand Down Expand Up @@ -99,7 +99,7 @@ def get(self):
result = dict(
processor_operating=dict(
status=processor.operating.status,
update_date=processor.operating.update_date,
updated_date=processor.operating.updated_date,
user_command=processor.operating.user_command,
# compute_node={'id':camera.operating.compute_node._id}

Expand Down
6 changes: 3 additions & 3 deletions nokkhumapi/views/processors/processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def build_result(self, processor):
processor_operating=dict(
user_command=processor.operating.user_command,
status=processor.operating.status,
update_date=processor.operating.update_date,
updated_date=processor.operating.updated_date,
)
if processor.operating.compute_node:
processor_operating['compute_node']=dict(
Expand All @@ -37,8 +37,8 @@ def build_result(self, processor):
name=processor.name,
storage_period=processor.storage_period,
image_processors=processor.image_processors,
create_date=processor.create_date,
update_date=processor.update_date,
created_date=processor.created_date,
updated_date=processor.updated_date,
status=processor.status,
project=dict(
id=processor.project.id,
Expand Down
9 changes: 5 additions & 4 deletions nokkhumapi/views/projects/projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ def get(self):
name=project.name,
description=project.description,
status=project.status,
create_date=project.create_date,
update_date=project.update_date,
created_date=project.created_date,
updated_date=project.updated_date,
ip_address=project.ip_address,
user=dict(
id=project.owner.id,
Expand All @@ -57,8 +57,8 @@ def create(self):
project.name = project_dict["name"]
project.description = project_dict["description"]
project.status = project_dict.get('status', 'active')
project.create_date = datetime.datetime.now()
project.update_date = datetime.datetime.now()
project.created_date = datetime.datetime.now()
project.updated_date = datetime.datetime.now()
project.ip_address = self.request.environ.get('REMOTE_ADDR', '0.0.0.0')
project.owner = self.request.user
project.save()
Expand All @@ -80,6 +80,7 @@ def update(self):
project_dict = self.request.json_body["project"]
project.name = project_dict["name"]
project.description = project_dict["description"]
project.updated_date = datetime.datetime.now()

if 'status' in project_dict:
project.status = project_dict["status"]
Expand Down
2 changes: 1 addition & 1 deletion nokkhumapi/views/projects/user_projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def get(self):
description=project.description,
camera_number=project.get_camera_number(),
processor_number=project.get_processor_number(),
create_date=project.create_date
created_date=project.created_date
)
for project in projects],
"collaborate_projects":[dict(id=project.id, name=project.name, description=project.description, owner=project.owner.email) for project in collaborate_projects]
Expand Down
File renamed without changes.

0 comments on commit 6896652

Please sign in to comment.