Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Jan 31 2019 16:42
    fantix commented #428
  • Jan 31 2019 14:11
    wwwjfy labeled #432
  • Jan 31 2019 14:11
    wwwjfy commented #432
  • Jan 31 2019 14:10

    wwwjfy on pyup-update-pytest-4.1.0-to-4.2.0

    (compare)

  • Jan 31 2019 14:10

    wwwjfy on master

    Update pytest from 4.1.0 to 4.2… (compare)

  • Jan 31 2019 14:10
    wwwjfy closed #431
  • Jan 31 2019 13:05
    diegoyosiura opened #432
  • Jan 31 2019 07:08
    aliyarly starred fantix/gino
  • Jan 31 2019 03:48
    coveralls commented #431
  • Jan 31 2019 03:41
    pyup-bot opened #431
  • Jan 31 2019 03:41

    fantix on pyup-update-pytest-4.1.0-to-4.2.0

    Update pytest from 4.1.0 to 4.2… (compare)

  • Jan 31 2019 03:41

    fantix on pyup-update-pytest-4.1.0-to-4.2.0

    (compare)

  • Jan 31 2019 01:55
  • Jan 30 2019 13:55

    wwwjfy on pyup-update-quart-0.6.10-to-0.7.0

    (compare)

  • Jan 30 2019 13:06

    wwwjfy on pyup-update-flake8-3.5.0-to-3.7.1

    (compare)

  • Jan 30 2019 13:06

    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)

  • Jan 30 2019 13:06
    wwwjfy closed #430
  • Jan 30 2019 13:03
    coveralls commented #430
  • Jan 30 2019 12:58
    wwwjfy synchronize #430
  • Jan 30 2019 12:58

    wwwjfy on pyup-update-flake8-3.5.0-to-3.7.1

    use latest flake8 in tests, ref… (compare)

Fantix King
@fantix
What's your github username pls?
Cobalt
@Chaostheorie
Cobalt <@Chaostheorie>
I'm writing a guide that takes advantage of gino and quart and would like to use this package in this guide -> migrating the package with changes I already have for my projects working
Fantix King
@fantix
Invitation sent ❤️
Cobalt
@Chaostheorie
Thanks a lot
The changes will be up and tested in a few days
Fantix King
@fantix
sounds great!
Cobalt
@Chaostheorie
@fantix Would you be able to release gino-quart/v0.0.1b0 to pypi as prerelease? Tests are passing etc
Fantix King
@fantix
@Chaostheorie oh if the tag name matches the pattern, the pre-defined GitHub Action will do the release: https://github.com/python-gino/gino-quart/blob/a2f7415340c979f777dc8500f43ea3f6305e7c52/.github/workflows/test.yml#L7-L8
pls feel free to either bump the version, or change the pattern
and FYI there's already 0.1.0 out on PyPI: https://pypi.org/project/gino-quart/#history
we may want to call the next version 0.2.0b0 or something
Cobalt
@Chaostheorie
Have tried to use 0.1.1b0 but the action seems to fail
I will delete the tag and create a new one called 0.2.0b0 for this. A
Fantix King
@fantix
if the tag name matches the pattern
Cobalt
@Chaostheorie
It seems to have cut of the 'b0' part when trying to upload to pypi
Fantix King
@fantix
it's currently still v*.*.*, perhaps that's the unmatching part
Fantix King
@fantix
feel free to update the pattern
Cobalt
@Chaostheorie
This seems to be caused by poetry publishing the package not y the pattern. I will take a look at it later
Fantix King
@fantix
only bumping the tag is not enough - you need to edit this too: https://github.com/python-gino/gino-quart/blob/master/pyproject.toml#L3
Cobalt
@Chaostheorie
Oh, didn't know about this file. Thank you.
1 reply
soulilya
@soulilya
hallo! can you explain how to insert many to many data? thanks
1 reply
Erus Lawliet
@eruslawliet_twitter

Hi there, I'm new to gino, I'm trying to understand the load() to make relationships.

Let's say I have something like this:

class Board(db.Model):

    id = db.Column(
        db.Integer,
        primary_key=True,
        index=True,
    )
    topic_id = db.Column(
        db.Integer,
        db.ForeignKey('topic.id'),
        nullable=False,
    )

class User(db.Model):

    id = db.Column(
        db.Integer,
        primary_key=True,
        index=True,
    )
    nickname = db.Column(
        db.String(15),
        nullable=False,
        default='',
    )
    board_id = db.Column(
        db.Integer,
        db.ForeignKey('board.id'),
        nullable=False,
    )

class UserCard(db.Model):"

    id = db.Column(
        sa.Integer,
        primary_key=True,
        index=True,
    )
    user_id = db.Column(
        db.Integer,
        db.ForeignKey('user.id'),
        nullable=False,
    )

class Topic(db.Model):

    id = db.Column(
        sa.Integer,
        primary_key=True,
        index=True,
    )
    title = db.Column(
        db.String(40),
        nullable=False,
        default='',
    )

Is there a way to "load" the board with all the relations? I'm not sure how to do that, thanks!

Fantix King
@fantix
it would be something like:
cards = await (
    UserCard.outerjoin(User)
    .outerjoin(Board)
    .outerjoin(Topic)
    .select()
    .gino.load(UserCard.load(user=User.load(board=Board.load(topic=Topic))))
    .all()
)
or use different loaders like Board.distinct().load(topic=Topic, cards=UserCard.load(user=User)) to get boards
you'd need a def cards(self, card): self._cards.append(card) under Board class
4 replies
Erus Lawliet
@eruslawliet_twitter
wow thank you so much! And if I want to add a .where, for example to get the Board.id == board_id with all the information? I mean the users, the user cards, etc. Where should I put that .where
Fantix King
@fantix
yeah sure, anywhere before the .gino and after the .select()
Erus Lawliet
@eruslawliet_twitter
in your second query example the .gino should go at the end of the query or at the start? like this example in the docs:
query = Child.outerjoin(Parent).select()
parents = await query.gino.load(
    Parent.distinct(Parent.id).load(add_child=Child)).all()
Fantix King
@fantix
just replace the parameter of .load() with the second loader
Erus Lawliet
@eruslawliet_twitter
awesome! I'm gonna make some tests now, that was really helpful! thank you!
Fantix King
@fantix
sure thing
Erus Lawliet
@eruslawliet_twitter
hi again, I couldn't make it work, I can obtain the board with the topic but not the users with their cards, so my main goal is to get specific board with it's respective topic, and the users with their cards. Do I need to add def cards(self, card): self._cards.append(card) under user and def participants(self, participant): self._participants.append(participant) under board? My query looks like this:
board = await UserCard.outerjoin(
        User,
    ).outerjoin(
        Board,
    ).outerjoin(
        Topic,
    ).select().where(
        Board.id == board_id,
    ).gino.load(
        Board.distinct().load(
            topic=Topic,
            cards=UserCard.load(
                user=User)
        )).all()
Cobalt
@Chaostheorie
@fantix Would it be possible to activate dependabot for dependency updates for python-gino/*? It would help with keeping dependencies up to date/ having a look on security breaches in dependencies
Fantix King
@fantix
sure
Cobalt
@Chaostheorie
Thanks ^^
Fantix King
@fantix
np, done
Cobalt
@Chaostheorie
Could you activate it for https://github.com/python-gino/gino-quart it seems admin permissions are required
Fantix King
@fantix
Only security updates
Only lockfile updates (ignore updates that require Pipfile changes)
Only top-level dependencies (and security patches for subdependencies)
preferences pls?
Cobalt
@Chaostheorie
top-level dependencies would be nice
Would help me with keeping track of newer wuart etc versions
Thanks a lot
Fantix King
@fantix
OK! np - and live updates? Or daily/weekly/monthly?
Cobalt
@Chaostheorie
monthly.
Fantix King
@fantix
all set :+1:
Cobalt
@Chaostheorie
Thanks
Fantix King
@fantix
thank you!
Erus Lawliet
@eruslawliet_twitter
hi there, how can I do a .join() with Gino to obtain a model instead of a RowProxy?