Skip to content

0.50.0

Choose a tag to compare

@dantownsend dantownsend released this 20 Sep 21:38
· 690 commits to master since this release

There are lots of great improvements in this release:

where clause changes

The where clause can now accept multiple arguments (courtesy @AliSayyah):

Concert.select().where(
    Concert.venue.name == 'Royal Albert Hall',
    Concert.band_1.name == 'Pythonistas'
).run_sync()

It's another way of expressing AND. It's equivalent to both of these:

Concert.select().where(
    Concert.venue.name == 'Royal Albert Hall'
).where(
    Concert.band_1.name == 'Pythonistas'
).run_sync()

Concert.select().where(
    (Concert.venue.name == 'Royal Albert Hall') & (Concert.band_1.name == 'Pythonistas')
).run_sync()

create method

Added a create method, which is an easier way of creating objects (courtesy @AliSayyah).

# This still works:
band = Band(name="C-Sharps", popularity=100)
band.save().run_sync()

# But now we can do it in a single line using `create`:
band = Band.objects().create(name="C-Sharps", popularity=100).run_sync()

piccolo schema generate bug fix

Fixed a bug with piccolo schema generate where columns with unrecognised column types were omitted from the output (courtesy @AliSayyah).

--trace docs

Added docs for the --trace argument, which can be used with Piccolo commands to get a traceback if the command fails (courtesy @hipertracker).

DoublePrecision column type

Added DoublePrecision column type, which is similar to Real in that it stores float values. However, those values are stored with greater precision (courtesy @AliSayyah).

AppRegistry improvements

Improved AppRegistry, so if a user only adds the app name (e.g. blog), instead of blog.piccolo_app, it will now emit a warning, and will try to import blog.piccolo_app (courtesy @aliereno).