-
Notifications
You must be signed in to change notification settings - Fork 308
Conversation
@whit537 linked teams to packages on the basis that Team |
would then be just adding |
ca00824 is really untested. needs a good hard review. :) |
Taking a look ... |
gratipay/models/package/__init__.py
Outdated
from postgres.orm import Model | ||
|
||
class Package(Model): | ||
"""Represent a gratipackage. :-) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gratipackage
😀
sql/branch.sql
Outdated
, long_description_raw text NOT NULL DEFAULT '' | ||
, long_description_type text NOT NULL DEFAULT '' | ||
, team text REFERENCES teams | ||
ON UPDATE CASCADE ON DELETE RESTRICT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's use team_id
linking to id
rather than slug
, so we don't make even more work for ourselves under #835.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
ca00824
to
64c256b
Compare
@aandis Maybe dust this one off next? |
I am thinking to scratch off all this boilerplate code for |
unless.. |
I think it's possible. Okay so let's just clean this up. |
64c256b
to
804671e
Compare
6a259a5
to
2b5b1cc
Compare
2b5b1cc
to
48229ce
Compare
Rebased on master, was 2b5b1cc. |
48229ce
to
477cfb7
Compare
Rebased, was 48229ce. |
37cc930
to
d06e5f2
Compare
Okay, I trimmed this up and am ready to see it merged. |
728a732
to
2b40ed0
Compare
"""Return an existing package based on package manager and package names. | ||
""" | ||
return cls.db.one("SELECT packages.*::packages FROM packages " | ||
"WHERE package_manager=%s and name=%s", (package_manager, name)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there plan to create table for package manager and reference its id in packages table?
Before making that change, shall we make 'npm' a constant shared across the app to avoid issue with raw string? Like using "Npm" by mistake, etc.
Or maybe, we use API from_name(cls, name) before adding support for other package managers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there plan to create table for package manager and reference its id in packages table?
Not before May. We won't look at expanding beyond npm until later this year or possibly next.
Before making that change, shall we make 'npm' a constant shared across the app to avoid issue with raw string? Like using "Npm" by mistake, etc.
Like 9c05276?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like 9c05276?
Yes. Not sure how helpful it would be though.
Anything else here, @nobodxbodon? |
I can review late this afternoon. |
@whit537 the rest LGTM. Thanks. |
@JessaWitzel Cool, yours to merge if/when you're ready! :-) |
@JessaWitzel you can delete the branch now ;) |
Just as the
elsewhere
table represents user accounts on other platforms, thepackages
table represents projects (Teams) that exist on open source package managers, starting with npm (#4153). In this PR we want to add the database and Python to be able to set up payments to packages. If the package is unclaimed then the payment instruction should be a pledge, not actually run during payday.