Michael Bukachi
5:11 AM (now)
to sqlalchemy
Hello,
So I've got a very weird when trying to setup caching using dogpile base on
the examples provided. For some strange reason using selectinload is
resulting in <AttributeError: 'PathToken' object has no attribute
'serialize':
Here are the load options I'm using:
load_options: Optional[List] = [
joinedload(CatalogProduct.partner).load_only(
"name", "partner_type", "status"
),
joinedload(CatalogProduct.product).options(
selectinload(Product.attributes),
selectinload(Product.values),
joinedload(Product.subcategory).joinedload(Subcategory.category),
joinedload(Product.template).selectinload(ProductTemplate.attributes),
),
selectinload(CatalogProduct.uoms)
.joinedload(CatalogProductUoM.uom)
.load_only("name"),
joinedload(CatalogProduct.default_uom)
.joinedload(CatalogProductUoM.uom)
.load_only("name"),
joinedload(CatalogProduct.restock_uom)
.joinedload(CatalogProductUoM.uom)
.load_only("name"),
selectinload(CatalogProduct.areas)
.joinedload(CatalogProductArea.marketplace_area)
.joinedload(CatalogMarketplaceArea.area)
.load_only("name"),
selectinload(CatalogProduct.excluded_areas)
.joinedload(CatalogMarketplaceArea.area)
.load_only("name"),
selectinload(CatalogProduct.allowed_areas).load_only(
"partner_id", "area_id"
),
selectinload(CatalogProduct.images),
joinedload(CatalogProduct.default_image),
joinedload(CatalogProduct.supplier).load_only(
"name", "partner_type", "status"
),
raiseload("*"),
]
if I replace all the root selectinloads without joinedloads I don't get the
error. Is there something to do with selectinloads and caching that I'm
missing?
--
SQLAlchemy -
The Python SQL Toolkit and Object Relational Mapper
http://www.sqlalchemy.org/
To post example code, please provide an MCVE: Minimal, Complete, and Verifiable
Example. See http://stackoverflow.com/help/mcve for a full description.
---
You received this message because you are subscribed to the Google Groups
"sqlalchemy" 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/sqlalchemy/f69d2d44-29a5-4227-9d2c-a4877ba99326n%40googlegroups.com.