Custom Query (1173 matches)

Filters
 
Or
 
  
 
Columns

Show under each result:


Results (178 - 180 of 1173)

Ticket Resolution Summary Owner Reporter
#549 fixed Allow users to revoke an OAuth access grant nyergler
Description

Users can currently authorize an application and view the applications they've authorized, but can not revoke access. We should add support for this.

#550 fixed Fix missing constraint in recent migrations Elrond Christopher Allan Webber
Description

A recent migration added a table for the CollectionItem model but didn't add the constraint of:

    __table_args__ = (
        UniqueConstraint('collection', 'media_entry'),
        {})

Since then we've moved to a new style of "creating models in migrations" which involves actually putting a copy of the original model inside the migrations file to make it easier to create the right database. However, anyone running from git master will currently pick up the "mistaken" commit.

There basically seem to be one of two possible solutions:

  • One, try to create a migration that's "smart"-ish. We can't check for constraints... sqlalchemy doesn't have support for that... but we could maybe try adding the constraint and just catch the exception if it isn't allowed?
  • That might not work though (and it does feel a bit "icky"). If it doesn't, we should simply correct the old migration and also create scripts that will add the constraint for people who may have picked up the bad migration from git master.
#552 fixed GMGTableBase uses default kwarg of {} in methods nyergler nyergler
Description

A few places in GMGTableBase have method definitions that look something like:

    def find_one(cls, query_dict={}):
       ...

This is almost certainly not what the authors intended. The default argument list is only evaluated once during execution, at import time. The code above creates a single dictionary as the default, and if this is mutated down the line, the mutated value becomes the default for subsequent calls. In these particular cases it's unlikely to cause problems -- that argument will almost certainly be passed in -- but in the event it's not, this can cause very strange, difficult to diagnose behavior. The correct approach is to use an immutable value as an argument default.

Note that this same problem exists for class level attributes: defining a class such as:

    class Foo(object):

        bar = {}

means that for *every* instance of Foo, self.bar will point to the *same* dict.

Batch Modify
Note: See TracBatchModify for help on using batch modify.
Note: See TracQuery for help on using queries.