wwwjfy on pyup-update-pytest-4.1.0-to-4.2.0
wwwjfy on master
Update pytest from 4.1.0 to 4.2… (compare)
fantix on pyup-update-pytest-4.1.0-to-4.2.0
Update pytest from 4.1.0 to 4.2… (compare)
fantix on pyup-update-pytest-4.1.0-to-4.2.0
wwwjfy on pyup-update-quart-0.6.10-to-0.7.0
wwwjfy on pyup-update-flake8-3.5.0-to-3.7.1
wwwjfy on master
Update flake8 from 3.5.0 to 3.7… use latest flake8 in tests, ref… Merge pull request #430 from fa… (compare)
wwwjfy on pyup-update-flake8-3.5.0-to-3.7.1
use latest flake8 in tests, ref… (compare)
SELECT DISTINCT participant.loop_id FROM participant
WHERE (participant.loop_id not in (SELECT DISTINCT participant.loop_id FROM participant WHERE participant.account_id = ?));
Hi folks! I'm having trouble with a Gino WHERE...IN query, perhaps you can point out what I'm doing wrong. The code used to be
query = ORMAsset.query
if asset_type is not None:
query = query.where(ORMAsset.asset_type == asset_type)
which works fine (asset_type is a string). But I want to make asset_type possibly a list, so I changed this toquery = ORMAsset.query
if asset_type is not None:
if type(asset_type) == List:
query = query.where(ORMAsset.asset_type.in_(asset_type))
else:
query = query.where(ORMAsset.asset_type == asset_type)
Gino doesn't like this, throwing asyncpg.exceptions.DataError: invalid input for query argument $3: [<AssetType.raster_tile_set: 'Raster til... (expected str, got list)
Any idea why this is failing? Apologies for the formatting, I'm trying to make it better.
i'm basically trying to traduce this sql statement into gino:
SELECT DISTINCT participant.loop_id FROM participant WHERE (participant.loop_id not in (SELECT DISTINCT participant.loop_id FROM participant WHERE participant.account_id = ?));
You can do this or define the column with the foreign key with Column(..., ondelete="CASCADE") when defining your schema. Otherwise you may have to just use query and delete
options(db.defer('location'))
in gino (ref docs)?
Figured I could exclude a field using select method of the model, i.e:
cols = [c.name for c in MyModel.__table__.c if c.name != 'large_field']
MyModel.select(*cols).where(MyModel.field != None).gino.all()
Would adding it to the docs be a good idea? Is the a better way to deal with deferring fields?
hi! i want do something like that
await select([User]).select_from(User.outerjoin(Group)).limit(1)
await User.update.values(name="123").where(User.id ==1)
so no .gino.all()
and gino.status()
i can do that after that hack:
from sqlalchemy.sql import Select, Update, Delete, Insert
from sqlalchemy.sql.base import Executable
def executable_await(self):
if isinstance(self, (Update, Delete)):
return self.gino.status().__await__()
elif isinstance(self, (Select, Insert)):
return self.gino.all().__await__()
Executable.__await__ = executable_await
UpdateRequest.__await__ = lambda self: self.apply().__await__()
is that ok?
Hello!
How can I update some rows and return the updated models? In SQL I can write: update ... returning *
But in gino I write:
stmt = (
update(Model)
.where(Model.status == "new")
.values(status="pending")
.returning()
)
return await stmt.gino.load(Model).status()
and it's returning:
('UPDATE 1', [])
One row was updated, but no models returned. Anyone knows what I do wrong?
Gino engine is not initialized
error
set_bind()
it fails because it is async
async.run(db.set_bind(DB_URL)))
it fails elsewhere with a 'cannot perform operation: another operation is in progress'
Hi! I have some problem, I want to join Model with select query, example:
company_query = Order.select(Order.company_id).limit(10)
# then join this query with Order model, something like this:
query = company_query.outerjoin(Order, Order.company == ???).select()
orders = await query.gino.load(Order.load()).all()
How can I do that?
over
in gino: https://stackoverflow.com/a/50876069. Any tips? What do I use instead of session.query in this particular case?
db = Gino(app, dsn=config_database)
, but the IDE can not find declaration such as above image. Anyone can help me, please?