Skip to content

Releases: nimaxin/adminsite

adminsite 0.6.1

Choose a tag to compare

@github-actions github-actions released this 02 Nov 13:09
pip install adminsite==0.6.1

A small fix to AdminUsers: a username in fullwidth letters is now the same name as one in normal letters.

Before upgrading:

  • An account whose username has fullwidth letters has to be renamed on the Users page before it can sign in.

What changed:

  • With AdminUsers, admin in fullwidth letters is now the same username as admin, so the two can no longer be separate accounts.

adminsite 0.6.0

Choose a tag to compare

@github-actions github-actions released this 25 Oct 09:35
pip install adminsite==0.6.0

Every password box can now show what is typed, and a choice filter with many options is a picker in the filters drawer, as a relation filter is.

Before upgrading:

  • A project that overrides base.html, login.html, password.html, _filters.html, _icons.html, widgets/password.html, widgets/_picker.html or widgets/_option.html should start its copy again from the new one.

What changed:

  • Every password box has a button at its end that shows what is typed and hides it again: on the sign in page, on Change password and for a PasswordField in a form. In Edge it takes the place of the browser's own.
  • In the filters drawer, a choice filter with more than 10 options is a picker, as a relation filter is: a box that narrows the options as you type and holds the ones picked as chips, with each option's count in the list (#108). A list of 10 or fewer stays as boxes to tick, and no longer scrolls inside the drawer.

adminsite 0.5.1

Choose a tag to compare

@github-actions github-actions released this 22 Oct 11:42
pip install adminsite==0.5.1

A release of fixes for the users and roles added in 0.5.0. A superuser now sees the sign ins on the Activity page whatever a view's scope_query leaves out, and a role's grid shows each action's label once in a box that several actions share.

What changed:

  • With AdminUsers, a superuser sees the sign ins on the Activity page and can filter by them, where a view whose scope_query leaves out rows for everyone hid them (#104).
  • On a role's grid, a box that several actions share shows each of their labels once, where an action offered on the list and on the record page read "Retry, Retry" (#105).

adminsite 0.5.0

Choose a tag to compare

@github-actions github-actions released this 20 Oct 14:37
pip install adminsite==0.5.0

Users and roles managed in the admin: auth=AdminUsers() keeps the admin's own users in your database, superusers add people and give them roles, and each role is a grid of what its holders may do on each view and page.

Before upgrading:

  • A project that overrides base.html, index.html, login.html, _field.html or _icons.html should start its copy again from the new one.

What changed:

  • AdminUsers, in the new adminsite.users, signs people in against three tables on user_metadata, and adds Users and Roles pages that only superusers open, beside Activity (#100). A role's grid has a box for each permission each view offers, the actions' own permissions among them, and the views and pages follow what a person's roles allow.
  • adminsite users create nima --superuser makes the first superuser from a terminal, finding the Admin in main.py, app.py or app/main.py, or wherever --admin says.
  • Everyone signed in through AdminUsers changes their own password from the account menu. A new password, or an account switched off, signs that person out everywhere else.
  • AuthProvider.grants_for lets a provider of your own grant permissions view by view, as roles do, with Grants. AuthProvider.change_password and AuthProvider.sign_in_note let it offer Change password and put a line above the sign in form.
  • Someone signed in who may open nothing is told to ask an administrator for access, where the overview showed an empty card.

adminsite 0.4.1

Choose a tag to compare

@github-actions github-actions released this 19 Oct 10:14
pip install adminsite==0.4.1

A small release. A form edits a string column without a length, as Mapped[str] declares, on one line, where it gave it a box like a Text column's. adminsite also supports Python 3.15.

Before upgrading:

  • A column for long text declared without a length, such as a description written Mapped[str], is now edited on one line. Declare it Text, or give it TextAreaField on its view, to keep the box.

What changed:

  • adminsite supports Python 3.15 and is tested on it, like 3.11 to 3.14.
  • A string column without a length, such as Mapped[str] or String(), is edited on one line (#101). It was edited in a box like a Text column, so a form of names and codes was all boxes, and Enter added a line instead of saving. Text, MySQL's MEDIUMTEXT and LONGTEXT, and a String longer than 255 keep the box.

adminsite 0.4.0

Choose a tag to compare

@github-actions github-actions released this 16 Oct 16:05
pip install adminsite==0.4.0

An action's message now sits under the page's heading and stays until it is closed, and a field can say what its empty value means, such as "Every region" for a multi-select left empty. The folded sidebar scrolls a long list of views without a scrollbar.

Before upgrading:

  • Message no longer takes sticky: every message now stays until it is closed, so leave it out.
  • A project that overrides base.html, detail.html, _row.html, _empty.html, _message.html, _value_saved.html or _icons.html should start its copy again from the new one.

What changed:

  • An action's message sits under the page's heading, across the page, and stays until it is closed or the page changes. It was a box in the corner that faded after six seconds, covered the page's own buttons, and let a long file name or key run under its close button.
  • With more views than fit, the folded sidebar scrolls its icons without a scrollbar, which on Windows took half its width and pushed the icons aside, and fades the edge with more icons past it. Unfolded, its scrollbar is thin and quiet, and the open page's link is scrolled into view.
  • Every field takes empty_text, for an empty value that means something: empty_text="Every region" on a multi-select left empty. The list and the record page show it faint, like a placeholder, where they showed a hyphen, and the export writes it into the empty cell. A link to records takes it too.

adminsite 0.3.0

Choose a tag to compare

@github-actions github-actions released this 15 Oct 12:48
pip install adminsite==0.3.0

More of a list fits on a screen. Compact mode, a switch in the account menu, draws lists and record pages closer together, so a laptop shows 14 rows of a list where it showed 9, and the sidebar folds to its icons to give a list's columns 176px more. Each person chooses both for themselves, and forms keep their spacing.

Before upgrading:

  • A project that overrides base.html, list.html, detail.html, _table.html, _row.html, _toolbar.html, _saved_tabs.html, _filter_chips.html, _records_total.html or _icons.html should start its copy again from the new one.

What changed:

  • Compact mode: a switch in the account menu, beside Dark mode, draws lists and record pages closer together. A list's rows are 36px apart where they were 48, so a screen holds about half as many rows again. Each person turns it on for themselves, and forms keep their spacing.
  • The sidebar folds to its icons from a button beside the admin's name, which gives the page 176px more room for a list's columns. Each name shows when the pointer rests on its icon, and each person's choice is kept.

adminsite 0.2.1

Choose a tag to compare

@github-actions github-actions released this 14 Oct 20:59
pip install adminsite==0.2.1

A release of fixes. Mounted in Litestar, the admin opens every page, where before only its front page did. Saved views and the filters drawer behave as people expect: a saved view opens from anywhere on its tab and asks before it is removed, and a picked filter choice such as "Today" can be let go from the drawer, which now has a Clear all on a computer too.

Before upgrading:

  • A project that overrides base.html, form.html, _filters.html, _filters_footer.html, _list_forms.html or _saved_tabs.html should start its copy again from the new one.

What changed:

  • The bar that holds a form's Save button has the cards' quiet shadow, where it cast the large shadow of a menu.
  • Mounted in Litestar, the admin opens every page, where only its front page opened and the rest returned 404 (#89). The Litestar example in Getting started sets copy_scope=True, as Litestar asks.
  • A saved view's tab opens the view wherever it is clicked, where its "shared" label did nothing, and its × asks before it removes the view (#90).
  • The filters drawer has a Clear all on a computer too, where only phones had one, and a choice that takes one value, such as "Today" or Yes, is let go when picked again, where it stayed picked (#91). Two date filters on one list keep their shortcuts apart, where picking one unticked the other's.

adminsite 0.2.0

Choose a tag to compare

@github-actions github-actions released this 13 Oct 14:54
pip install adminsite==0.2.0

Forms have a new look: a field is white in the light theme and nearly black in the dark one, with a border that shows, and cards stand on a darker ground with their titles in a band. Three fixes matter to anyone on 0.1.0: saving a record could erase, in every inline row, a field that holds several values; leaving a text empty could make the database refuse the whole save; and a filtered list on a big table stopped counting at 10,000.

The docs are rewritten to be shorter and easier to follow. Getting started builds an admin in one file that runs as written, each page starts with the common case, and the examples link to the models they use. The docs are built with Zensical and published with each release, so they match the version on PyPI.

Before upgrading:

  • On a view with count_mode = CountMode.ESTIMATED, a search, a filter or scope_query is now counted exactly, which on a very large table takes a full count (#82).
  • A project that overrides form.html, detail.html, index.html, activity.html, import.html, error.html, _inlines.html, _page_numbers.html, _records_total.html or widgets/checkbox.html should start its copy again from the new one.
  • A project that builds its own stylesheet should build it again from the new frontend/input.css, which draws the new fields. The ground behind the cards is now daisyUI's base-200, and --subtle colours the band that holds a card's title.

What changed:

  • A record whose text column cannot be null but has a default, such as note: Mapped[str] = mapped_column(default=""), can be saved with that text empty. The edit form, inline rows, values changed in the list, the API and the import read the empty text as None, and the database refused the whole save. It is now stored as "", as is the key of a file removed from such a column. Any other field whose column cannot be null, such as a number or a choice, left empty on a record that exists is refused under its input, since a default only fills in a new record, unless the field is given required=False. The edit form marks such a field required, so a choice there no longer offers Not set (#84).
  • On a view with count_mode = CountMode.ESTIMATED, a search, a filter or scope_query is counted exactly. The count stopped at 10,000, so the list, the filters drawer and the Actions menu said "more than 10,000" and the pager had no page numbers. The rows still come first and the total follows (#82).
  • In an inline row, an EnumField with multiple=True and a link to many records work as they do on a view's own form. The row's values did not show, so saving the parent, even only to rename it, erased that field in every row, and a save kept only the first value picked. A link to many records made the parent's edit page fail with a server error as soon as a row held linked records. A link in a row searched among over a hundred records also keeps what was picked when the form comes back with an error (#87).
  • A new look for forms. A field is white in the light theme and nearly black in the dark one, with a border that shows, and its border and a ring take the accent while you type, where it drew a thick black frame. Cards stand on a darker ground with their titles in a band, a select has a thin arrow, date and time fields use the admin's own icons, a file field is a place to drop a file, and a disabled field looks disabled.
  • A switch on a form says No while it is off. It said Yes either way.

adminsite 0.1.0

Choose a tag to compare

@github-actions github-actions released this 10 Oct 14:05
pip install adminsite==0.1.0

adminsite leaves alpha: installing it no longer needs an exact version, and the package is marked Beta. A SQLModel model works as it is. On SQLAlchemy 2.1 the search box and a link's picker now find its text, and the Databases page says how a view names its columns.

Before upgrading:

  • adminsite needs Pydantic 2.10 or later. An earlier Pydantic leaves out of its JSON schema which keys a dict may hold, so in a form built from a schema, a dict keyed by a Literal or an enum took any text as a key instead of offering its keys, and the record page did not name them.
  • A column of a TypeDecorator that names no Python type now gets the field of the type it wraps, so one over DateTime gets a date and time picker where it had a text input. If your type holds something other than what it wraps, give its column the field you want, or name its python_type.

What changed:

  • A column of a type of your own, a TypeDecorator, that names no Python type gets the field of the type it wraps, on SQLAlchemy 2.0 and 2.1 alike. On 2.1 such a column over String, as every str of a SQLModel model is, was not text to the admin: the search box and a link's picker found nothing in it, and a long one got a one-line input.