Forms can now be grouped in the sidebar. This is useful when you have lots of forms and want to keep things organised. Thanks to @sinisaos for this.
Added a missing JPEG file for an example form.
Added more example forms.
Piccolo Admin forms can now be used to download files, e.g. CSV and PDF files, which are really useful for reporting purposes. Many thanks to @sinisaos for the help on this.
Make the MFA Setup URL relative, so it works when Piccolo Admin isn't mounted at the root.
Initial release for Multi-factor Authentication support.
Many thanks to @sinisaos and @Skelmis for their help with this.
When downloading a CSV file from the row listing page, you can now specify which columns you want to download.
On the add row and edit row forms, the save button is now temporarily disabled after being pressed (until the API call finishes). This is to prevent a user from accidentally clicking the button multiple times. Thanks to @sinisaos for helping with this.
Improved the array widget for arrays of Time
/ Date
/ Timestamp
/
Timestamptz
.
Fixed a bug with array inputs in custom forms (thanks to @sinisaos for this).
Added CSP (Content Security Policy) middleware to stop malicious SVG files from executing JavaScript. This was possible if:
- Local media storage was enabled
- SVG uploads were allowed from untrusted sources
- When viewing an uploaded SVG in Piccolo Admin, if you open the SVG in a new tab then it's possible for JavaScript embedded in the SVG file to run.
It's recommended that you upgrade to this version. Thanks to @Skelmis for this.
Fixed a bug with the bulk update button not being translated.
Thanks to @jrycw for reporting the issue, and @sinisaos for the fix.
Added translations for Traditional Chinese (thanks to @jrycw for this).
Fixed a bug with filtering Array
columns when choices are defined. Thanks
to @sinisaos for discovering the solution.
Fixed a bug with Array
columns which have choices defined. Both a
select
and input
widget were being shown.
Added Python 3.12 support.
When filtering Varchar
and Text
columns, you can now specify the
match
. Previously, it always defaulted to contains
, but now you can
specify starts
, ends
and exact
. For example, you can now filter for
a movie with a name starting with Star Wars
.
When filtering numeric / date / time columns, you can now specify the
not equals
operator. For example, give me all the movie tickets which
aren't on a certain day.
Fixed some minor bugs, and added additional Playwright tests.
Improved CSV downloads - the user now has the option of using commas or semicolons as delimiters. In Piccolo Admin v1 we had changed to using semicolons by default, which was causing confusion.
The sidebar styles were improved (see this issue for more info).
Fixed a regression in Piccolo Admin v1, where nullable boolean fields defaulted
to null
instead of all
in the filter sidebar. This was caused by
changes in Pydantic v2, where the JSON schema changed.
Big improvements to Timestamptz
columns:
- Piccolo Admin now displays the timezone in the UI.
- The resolution of the widget can be specified using
TableConfig.time_resolution
, so you can decide if the user can pick seconds / milliseconds.
Updated to work with Piccolo v1 (which uses Pydantic v2).
The front end code has also been substantially upgraded to Vue v3.
The default rate limiting is now more aggressive. This can be overridden using
the rate_limit_provider
argument of create_admin
.
Improved the handling of nullable Varchar
/ Text
columns in the UI.
Improved the handling of nullable JSON
/ JSONB
columns in the UI.
When deleting a row, if a problem is encountered then an error message is now shown in the UI.
This is useful if we have constraints on the table (for example
ON DELETE RESTRICT
).
Support for Python 3.7 was dropped as it's now end of life.
Improved the behaviour of the referencing tables links on the detail page.
Improved the UI for JSON fields (the cursor would sometimes jump to the bottom).
Version pinning Pydantic to v1, as v2 has breaking changes.
We will add support for Pydantic v2 in a future release.
Thanks to @sinisaos for helping with this.
Improved the UI for password inputs (e.g. on the change password page). Thanks to @sinisaos for this.
Fixed a bug with nullable date fields.
Improved handling of nullable email fields.
Thanks to @sinisaos for adding this.
Custom links can now be added to the sidebar. This allows quick navigation to specific pages in the admin, or to external websites. For example:
create_admin(
sidebar_links={
"Top Movies": "/admin/#/movies/?__order=-popularity",
}
...
)
Thanks to @sinisaos for adding this.
- Improved the type annotations for
FormConfig
. - Fixed a bug with array fields in custom forms (thanks to @sinisaos for fixing this).
Multiple columns can now be used for sorting the rows in the UI.
Setting the default order for a table is now possible. For example, if we want to order movies by rating:
create_admin(
tables=[
TableConfig(
Movie,
order_by=[
OrderBy(Movie.rating, ascending=False)
]
)
)
)
Thanks to @sinisaos and @sumitsharansatsangi for their help with this.
Added Turkish translations (thanks to @omerucel for this).
Nullable UUID fields now work correctly.
Add back JSON formatting in list view which was removed by accident.
Nullable number fields now work correctly.
Fixed a bug with nullable Boolean
columns - filtering wasn't working in the
sidebar.
Added the link_column
option to TableConfig
. By default, the primary key
is used in the list view of Piccolo Admin to link to the edit page. Using
link_column
you can specify a different column (for example, if you hid
the primary key using visible_columns
). Thanks to @sinisaos for helping
with this.
Tables can now be grouped in the sidebar - this is helpful if you have lots of
tables. To do this, use the menu_group
argument of TableConfig
.
Thanks to @sinisaos and @sumitsharansatsangi for their help with this.
A fix to make Piccolo Admin work with fastapi>=0.89.0
.
- Improved German translations (thanks to @hblunck for this).
- When submitting a form, scroll to the top of the page if an error occurs so the error box is visible (thanks to @sinisaos for this).
- If a custom
BaseUser
table is used for authentication, which uses aUUID
as the primary key, it now works.
If an Array
column has choices
specified, then Piccolo Admin will
show dropdowns, so the user can pick one of the choices.
Fixed a bug with TableConfig
and exclude_visible_columns
. Thanks to
@web-maker for this fix.
- Python 3.11 is now officially supported.
- Added debug mode:
create_admin(tables=[MyTable], debug=True)
. - Logging exceptions for 500 errors.
- Fixed a typo in the docs about how to use validators (thanks to @sinisaos for reporting this).
- Updated the tests for Starlette / FastAPI's new test client. This means that
fastapi==0.87.0
/starlette==0.21.0
are now the minimum versions supported. Thanks to @sinisaos for this.
Lots of small enhancements.
- Fixed bugs with the foreign key selector. Sometimes the edit button didn't work. Also, sometimes the value shown in the input box wasn't refreshing when navigating to a new page.
- The HTML title now matches the
site_name
parameter increate_admin
(thanks to @sinisaos for this). - Updated Vue to the latest version.
- Internal code refactoring.
Validators
can now be specified in TableConfig
.
This allows fine grained access control - for example, only allowing some users
to send POST
requests to certain API endpoints:
from piccolo_api.crud.endpoints import PiccoloCRUD
from starlette.exceptions import HTTPException
from starlette.requests import Request
async def manager_only(
piccolo_crud: PiccoloCRUD,
request: Request
):
# The Piccolo `BaseUser` can be accessed from the request.
user = request.user.user
# Assuming we have another database table where we record
# users with certain permissions.
manager = await Manager.exists().where(manager.user == user)
if not manager:
# Raise a Starlette exception if we want to reject the
# request.
raise HTTPException(
status_code=403,
detail="Only managers are allowed to do this"
)
admin = create_admin(
tables=TableConfig(
Movie,
validators=Validators(post_single=[manager_only])
)
)
Updated the date / datetime / time picker.
Fixed an issue with installing piccolo_admin
in editable mode with pip
.
Thanks to @peterschutt for reporting this issue.
Improved the UI for error messages. Thanks to @sinisaos for adding this.
Camelcase column names could break parts of Piccolo Admin. It now works as expected:
class Person(Table):
# This now works:
firstName = Varchar()
Even though camelcase is unusual in Python, a user may be using an existing database, so it makes sense to support it. Thanks to @sumitsharansatsangi for reporting this issue.
When piccolo_admin
is installed, an admin_demo
script is made available
on the command line, which launches a Piccolo Admin demo.
It wasn't working due to a missing folder, which has now been fixed.
Fixed a bug with custom forms - under some situations they would fail to render. Thanks to @sinisaos for discovering this issue. See PR 208 for more info.
Improved the French translations (courtesy @LeMeteore).
Added translations for simplified Chinese characters (courtesy @mnixry).
The media endpoints now obey the read_only
option of create_admin
.
Read only mode is used for online demos.
Thanks to @sinisaos for adding this.
Added media upload support - to both a local folder, and S3.
Images, videos, PDFs, and audio files can be viewed within the UI.
This is the one of the biggest updates we've ever made!
Thanks to @sinisaos for all of the help.
Added Ukrainian translations (courtesy @ruslan-rv-ua).
Added Russian translations (courtesy @northpowered).
Modified the release process, so it works on GitHub (courtesy @olliglorioso).
Added Finnish translations (courtesy @olliglorioso).
Added translations, to make the UI more accessible in a variety of languages (thanks to @sinisaos for helping with this).
TableConfig
now has a hooks
argument - so custom logic can be run when
a row is added / deleted / modified. Thanks to @Anton-Karpenko for suggesting
this feature.
The WYSIWYG editor we use for rich_text_columns
has been modified, so the
user can now create HTML headings. Thanks to @tigerline86 for suggesting this
feature and @sinisaos for implementing it.
Rows can now be bulk modified - for example, if you have 100 blog posts which
need converting to draft=False
, it can now be easily done using the
Piccolo Admin GUI in a single operation (courtesy @sinisaos).
More sandbox fixes.
Fixed a bug with the sandbox.
The user can now change their password in the Piccolo Admin UI (courtesy @sinisaos).
After submitting a custom form with Piccolo Admin, the UI used to show the response message in a popup at the bottom of the screen. It now shows a success page instead, which is better if the response message is long, as it's easier for the user to read. Thanks to @ethagnawl for reporting this issue.
Added a warning if a Piccolo Table
column is both secret=True
and
required=True
, as it's unsupported by Piccolo admin (courtesy @ethagnawl).
You can now use a rich text editor for Text
columns (courtesy @sinisaos).
from piccolo_admin.endpoints import TableConfig
from movies.tables import Movie
movie_config = TableConfig(
Movie,
rich_text_columns=[
Movie.description
]
)
create_admin(movie_config)
This is useful when using Piccolo Admin for authoring content in blogs etc.
Fixes for Table
classes which have custom primary key columns.
More z-index refinements (thanks @sinisaos).
Fixed a bug with the z-index of the sidebar on mobile. Thanks to @sinisaos for discovering this issue.
Improved the UI when the network is slow (courtesy @sinisaos).
With FormConfig
, if the Pydantic model has a default value provided, this
is rendered in the form UI (thanks to @simplynail for this idea).
The textarea
and button
elements were using the browser's default font,
instead of our custom font.
Improved the docstring for create_admin
.
Fixed a bug where a filter for a column with choices defined would default to
Null
instead of All
.
Added new UI for the foreign key selector.
Fixed a bug where resetting the filters in the sidebar would set them to
less than
. Now they reset to equals
. Courtesy @sinisaos.
Fixed a bug where a filter for a column with choices would default to
'Null'
instead of 'All'
.
Added a visible_filters
option to TableConfig
, allowing the user to
specify which filters are shown in the filter sidebar. This is useful if you
have a lot of columns. Courtesy @sinisaos.
Improved the navigation sidebar UI - each section can now be hidden, and the appearance has been improved when table names are very long. Courtesy @sinisaos.
Added docs for Javascript formatting to help new contributors.
Added TableConfig
, which allows more fine grained control over how the
UI behaves for a given Table
. Currently it allows you to specify which
columns are visible on the list page, but more options will be added in the
future. Courtesy @sinisaos.
Fixed bugs with nullable ForeignKey
and Timestamp
columns - the UI
would try sending back an empty string, instead of a null
value. Courtesy
@sinisaos.
JSON values are now displayed in a nicer format in the UI (courtesy @sinisaos).
The popup banner displayed at the bottom of the page will now turn red when showing an error (it was already green in the past). Courtesy @sinisaos.
FormConfig.endpoint
now works with async functions.
Fixing a bug where setting FormConfig.description
to None
caused a
serialisation error.
Added custom forms (courtesy @sinisaos).
It's very easy to use - just provide a Pydantic model, and a function for handling posted data. Piccolo Admin will then auto generate all of the UI necessary.
Using the swagger_ui
endpoint from Piccolo API for the Swagger docs, so
it works with the CSRF middleware.
Rewrote admin_demo command to expose configuration options on the command line.
- Bumped Node dependencies with security warnings.
- Slightly changed light mode styles (blue-grey sidebar instead of grey).
- Fixed the admin_demo command which is installed by setup.py - the path was wrong.
Modified the UI to support columns with a choices
attribute set. A select
input element is shown.
Fixed issue with BigInt
values being displayed incorrectly.
Added support for Array
column type.
Exposing the site name on the login page, courtesy of sinisaos.
Added tooltips using the help_text
attribute on Table
.
Added tooltips using the help_text
attribute on Column
.
- The foreign key selector in the add and edit row forms now use the search based UI, courtesy of sinisaos.
- Fixing a Vue JS warning about a route parameter being undefined.
- Exposed the
host
andport
options directly in the sandbox CLI. - Fixing a bug with read only mode. Was raising a 500 with disallowed HTTPS methods
- The foreign key selector in the sidebar is now search based, rather than a select element, courtesy of sinisaos. This makes the admin work better with very large data sets.
- Fixed a bug with nullable foreign keys. The value can now be set to null without a validation error.
Added an --inflate
option to the CLI in example.py. This allows lots of
dummy data to be added during development.
Fixing a bug with the date time picker on mobile devices - thanks sinisaos!
Fixing a bug where clearing the filters wasn't clearing the duration widget's value, as it uses a hidden input - thanks sinisaos!
Added missing trailing slash to table detail endpoints.
Fixing auth API URL - thanks sinisaos!
requirements.txt fixes
Updated Node dependencies, and fixed requirements clash with FastAPI and Starlette.
- Refactored
AdminRouter
to useFastAPI
. This means the API is fully documented - courtesy of sinisaos. - Moved auth endpoints from
/api/
to/auth/
, to separate auth from the main API.
Fixing a bug with fetching meta information from the API (Piccolo version, site name etc). When a user isn't logged in, it would fail. It now calls the API again after a successful login - courtesy of sinisaos.
- Can override the nav bar title (defaults to Piccolo Admin) - courtesy of sinisaos.
- Other nav bar improvements, such as truncating long usernames.
- Added page size selector - courtesy of sinisaos.
- Minor fixes
Added bulk deletion, and a custom widget for timedelta - courtesy of sinisaos.
Added a CSV export button to the row listing - courtesy of sinisaos.
- Removed dependency number for
uvicorn
andHypercorn
- only the very high level API is being used, which is unlikely to change, and was causing issues for some users when installing via Poetry. - Bumped node dependencies.
Fixing packaging issues - add Python 3.8 classifier, and missing index.html file.
Subtle UI fixes - page selector, and setTimeout
typo.
Added allowed_hosts
argument to create_admin
- otherwise CSRF
middleware will block requests when running under HTTPS.
Using latest piccolo, and piccolo_api.
- Improved pagination when there's lots of data.
- Bumped node dependencies.
Bumped node requirements because of security warning.
Bumped node and pip requirements.
Bumped node and pip requirements.
Added support for Numeric and Real column types in Piccolo.
Exposing more configuration options for session auth.
Disabling redirect on session auth.
Loosening requirements for Piccolo projects.
Bumped requirements.
Bumped requirements and added apps to piccolo_app migration dependencies.
Converted into a Piccolo app.
Bumped requirements.
Supporting piccolo 0.10.0.
Updated requirements.
Updated dependencies, and vendored remaining Javascript.
Using rate limit middleware on login endpoint. Auto including related tables. Using PATCH instead of PUT when editing a row. UI improvements.
Using textarea for Text database fields, using new API schema format, and various UI improvements.
Updated piccolo_api requirements.
UI improvements, and catching 404 errors.
Added 'about' modal to UI.
Updated sandbox - populates data.
Added sandbox, for deploying demo version online.
UI improvements, including light mode. Support for pagination, and operators in filters.
Fixed typo - missing trailing slash.
Improved auth error handling, and adding defaults automatically when adding a new row.
Login is working, and various UI improvements.
Updated to work with Piccolo API code layout changes.
Making edit row work.
Added missing assets.
Added missing assets.
Fixing filters.
Initial release.