Hello everybody.
We want to do a search using ming and from the results obtain the documents
in dictionary format in order to manipulate it or save it in csv.
We honestly have not found about this in the documentation and ming only
returns an object in the search.
Therefore, we have looked at the code and we *propose* the following to
obtain the dictionary *but we do not know if it is the most optimal or
correct*.
We have the following ming object
In [8]: full =
BaseGobcanApp.query.find().all()
In [9]:
full[0]
Out[9]:
<BaseGobcanApp
_id=ObjectId('60dc561b8eb792f353c19e24')
_version=1 app_id=524 full_name='PRIVADO'
area_id=12
servicio='Aplicaciones Corporativas'
servicio_id=4
updated=datetime.datetime(2021, 6, 30, 13, 11, 52,
961000)
from_full_scrap=True>
And with this command we get its dictionary
In [24]: full[0].__ming__.state.document
Out[24]:
{'_id': ObjectId('60dc561b8eb792f353c19e24'),
'_version': 1,
'app_id': 524,
'area': 'ADMINISTRACIONESPUBLICAS',
'area_id': 12,
'from_full_scrap': True,
'full_name': 'PRIVADO',
'servicio': 'Aplicaciones Corporativas',
'servicio_id': 4,
'updated': datetime.datetime(2021, 6, 30, 13, 11, 52, 961000)}
*Questions*:
- This is correct? or is there another way to do it?
--
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/turbogears/89c8f382-4ed5-4587-9222-03bb61fd4cbcn%40googlegroups.com.