Thanks alot Luigi. You guys are really helping all developers. But i' ve an extra question for you :/
We have some problems about OrientObject is not Json serializable Error.
Let me explain our code in simple way. We have Customers,Admins(Company),Product,Personel classes and CRUD for all of them in back end (Python).
HERE IS MY VERTEX
createPersonel = configDb.client.command("create vertex PersonelInformation set Adress ='" + adress
+ "',""CitizenId='" + citizenId + "',CompanyCode='" + companyCode
+ "',""Email='" + email + "',Name='" + name + "', Surname='" + surname
+ "',Phone=" + phone)
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
HERE IS MY EDGE
createRelation = configDb.client.command("create edge PersonelRelation from " + personelRid + " to " + companyRid + "' ")
-------------------------------------------------------------------------------
SELECT QUERY FOR ALL INFORMATIONS IN CLASS
all = []
data = configDb.client.command("select * from PersonelInformation")
for i in range(0, len(data)):
all.append(data[i].oRecordData)
return json.dumps(all)
-------------------------------------------------------------------------------------------------------------------------
Everything is fine except select query, I can not see the relationship. When there is a relation in some records , after execute the query i get this error .
[2018-03-25 13:24:49,575] ERROR in app: Exception on /personelInfo/getAll [GET]
Traceback (most recent call last):
File "D:\Outputs\pyCharm\rms\venv\lib\site-packages\flask\app.py", line 1982, in wsgi_app
response = self.full_dispatch_request()
File "D:\Outputs\pyCharm\rms\venv\lib\site-packages\flask\app.py", line 1614, in full_dispatch_request
rv = self.handle_user_exception(e)
File "D:\Outputs\pyCharm\rms\venv\lib\site-packages\flask\app.py", line 1517, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "D:\Outputs\pyCharm\rms\venv\lib\site-packages\flask\_compat.py", line 33, in reraise
raise value
File "D:\Outputs\pyCharm\rms\venv\lib\site-packages\flask\app.py", line 1612, in full_dispatch_request
rv = self.dispatch_request()
File "D:\Outputs\pyCharm\rms\venv\lib\site-packages\flask\app.py", line 1598, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "D:/Outputs/pyCharm/rms\Middleware\Decator.py", line 16, in decorated_function
return f(*args, **kwargs)
File "D:/Outputs/pyCharm/rms\Resources\PersonelinformationResource.py", line 105, in GetAll
return re
File "D:\Outputs\pyCharm\rms\venv\lib\site-packages\flask\json.py", line 123, in dumps
rv = _json.dumps(obj, **kwargs)
File "D:\Program Files\Python36\Lib\json\_init_.py", line 238, in dumps
**kw).encode(obj)
File "D:\Program Files\Python36\Lib\json\encoder.py", line 199, in encode
chunks = self.iterencode(o, _one_shot=True)
File "D:\Program Files\Python36\Lib\json\encoder.py", line 257, in iterencode
return _iterencode(o, 0)
File "D:\Outputs\pyCharm\rms\venv\lib\site-packages\flask\json.py", line 80, in default
return _json.JSONEncoder.default(self, o)
File "D:\Program Files\Python36\Lib\json\encoder.py", line 180, in default
o._class.name_)
TypeError: Object of type 'OrientBinaryObject' is not JSON serializable
127.0.0.1 - - [25/Mar/2018 13:24:49] "GET /personelInfo/getAll HTTP/1.1" 500 -
---------------------------------------------------------------------------------------------------------------------------------------------------------------
IN THE OTHER HAND, When i delete records with relations , My Select query works fine. I can see all records without relation.
But my main goal is getting companyCode when i query on PersonelInformation vertex.
Also i tried This.
-select adress from user where = out('PersonelRelation')[0].name = "orient"
------------------------------------------------------------------------------------------------------------------------------------
OUT comes like this.
b64:'AQAAAAEAggAAAAAAAAAA'
IN SHORT my main problem is when i connect the Company And Personel Classes, i want to see Company class informations over personelInformation Query. But i dont want to restrict my query like , select from where rid = 37
i just want to get company information wihtout giving any company information in Personel Query. Just want to get informations about Company in Back end and want to read them. Its not important after a query like = select from personel where CompanyCode "abc"
Really Thanks alot from now
Looking for your answer
Regards,
Ersin
5 Mart 2018 Pazartesi 12:21:40 UTC+3 tarihinde Luigi Dell'Aquila yazdı: