Commit c118339e authored by Wei Shoulin's avatar Wei Shoulin
Browse files

new id

parent 6df5b472
...@@ -21,6 +21,8 @@ class BaseModel: ...@@ -21,6 +21,8 @@ class BaseModel:
return self return self
def from_proto_model(self, record): def from_proto_model(self, record):
if record is None:
return None
for k in self.__dataclass_fields__.keys(): for k in self.__dataclass_fields__.keys():
self.__setattr__(k, record.__getattribute__(k)) self.__setattr__(k, record.__getattribute__(k))
return self return self
......
...@@ -39,21 +39,21 @@ class DetectorStatus(BaseModel): ...@@ -39,21 +39,21 @@ class DetectorStatus(BaseModel):
@dataclasses.dataclass @dataclasses.dataclass
class Brick(BaseModel): class Brick(BaseModel):
id: int = 0 id: int = -1
ra: float = 0.0 ra: float = 0.0
dec: float = 0.0 dec: float = 0.0
boundingbox: str="" boundingbox: str=""
@dataclasses.dataclass @dataclasses.dataclass
class BrickObsStatus(BaseModel): class BrickObsStatus(BaseModel):
brick_id: int = 0 brick_id: int = -1
band: str="" band: str=""
cover_num: int = 0 cover_num: int = 0
update_time: str="" update_time: str=""
@dataclasses.dataclass @dataclasses.dataclass
class BrickLevel1(BaseModel): class BrickLevel1(BaseModel):
brick_id: int = 0 brick_id: int = -1
level1_id: int = 0 level1_id: int = 0
obs_id: str="" obs_id: str=""
module: str="" module: str=""
...@@ -83,7 +83,7 @@ class Level2ProducerRuning(BaseModel): ...@@ -83,7 +83,7 @@ class Level2ProducerRuning(BaseModel):
id: int = 0 id: int = 0
job_id: int = 0 job_id: int = 0
producer_id: int = 0 producer_id: int = 0
brick_id: int = 0 brick_id: int = -1
start_time: str="" start_time: str=""
end_time: str="" end_time: str=""
prc_status: int = 0 prc_status: int = 0
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment