From 6eda1540d2123337ee07866803f4a937f26898b7 Mon Sep 17 00:00:00 2001 From: Johannes Maron Date: Fri, 19 Dec 2025 00:30:50 +0100 Subject: [PATCH 1/3] Update readme --- README.md | 97 ++++++++++++++----------------------------- images/logo-dark.svg | 16 +++++++ images/logo-light.svg | 16 +++++++ 3 files changed, 64 insertions(+), 65 deletions(-) create mode 100644 images/logo-dark.svg create mode 100644 images/logo-light.svg diff --git a/README.md b/README.md index 795efde..7e9f911 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,19 @@ +

+ + + + Django DynNames: Advanced filename patterns using f-Strings + +
+ Documentation | + Issues | + Changelog | + Funding 💚 +

+ # Django Dynamic Filenames -Write advanced filename patterns using the [Format String -Syntax](https://docs.python.org/3/library/string.html#format-string-syntax). +Write advanced filename patterns using the [Format String Syntax](https://docs.python.org/3/library/string.html#format-string-syntax). ## Getting Started @@ -35,77 +47,32 @@ Auto slug example: ### Field names -`ext` - -: File extension including the dot. - -`name` - -: Filename excluding the folders. - -`model_name` - -: Name of the Django model. - -`app_label` +- `ext`: File extension including the dot. +- `name`: Filename excluding the folders. +- `model_name`: Name of the Django model. +- `app_label`: App label of the Django model. +- `instance`: Instance of the model before it has been saved. You may not have a primary key at this point. +- `uuid`: UUID version 4 that supports multiple type specifiers. + The UUID will be the same should you use it twice in the same string, + but different on each invocation of the `upload_to` callable. -: App label of the Django model. - -`instance` - -: Instance of the model before it has been saved. You may not have a -primary key at this point. - -`uuid` - -: UUID version 4 that supports multiple type specifiers. The UUID will -be the same should you use it twice in the same string, but -different on each invocation of the `upload_to` callable. - -``` The type specifiers allow you to format the UUID in different ways, e.g. `{uuid:x}` will give you a with a hexadecimal UUID. The supported type specifiers are: -`s` +- `s`: String representation of a UUID including dashes. +- `i`: Integer representation of a UUID. Like to `UUID.int`. +- `x`: Hexadecimal (Base16) representation of a UUID. Like to `UUID.hex`. +- `X`: Upper case hexadecimal representation of a UUID. Like to `UUID.hex`. +- `base32`: Base32 representation of a UUID without padding. +- `base64`: Base64 representation of a UUID without padding. -: String representation of a UUID including dashes. +> [!WARNING] +> Not all file systems support Base64 file names. -`i` - -: Integer representation of a UUID. Like to `UUID.int`. - -`x` - -: Hexadecimal (Base16) representation of a UUID. Like to - `UUID.hex`. - -`X` - -: Upper case hexadecimal representation of a UUID. Like to - `UUID.hex`. - -`base32` - -: Base32 representation of a UUID without padding. - -`base64` - -: Base64 representation of a UUID without padding. - - :::: warning - ::: title - Warning - ::: - - Not all file systems support Base64 file names. - :::: - -All type specifiers also support precisions to cut the string, e.g. -`{{uuid:.2base32}}` would only return the first 2 characters of a -Base32 encoded UUID. -``` +All type specifiers also support precisions to cut the string, +e.g. `{{uuid:.2base32}}` would only return the first 2 characters of a Base32 encoded UUID. ### Type specifiers diff --git a/images/logo-dark.svg b/images/logo-dark.svg new file mode 100644 index 0000000..58cf288 --- /dev/null +++ b/images/logo-dark.svg @@ -0,0 +1,16 @@ + + + + + + + + Django + + + DynFN + + + Advanced filename patterns using f-Strings + + diff --git a/images/logo-light.svg b/images/logo-light.svg new file mode 100644 index 0000000..e41436c --- /dev/null +++ b/images/logo-light.svg @@ -0,0 +1,16 @@ + + + + + + + + Django + + + DynFN + + + Advanced filename patterns using f-Strings + + From bd670b217c0bd06ee94bfab39ba382302004faa4 Mon Sep 17 00:00:00 2001 From: Johannes Maron Date: Fri, 19 Dec 2025 00:41:53 +0100 Subject: [PATCH 2/3] Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 7e9f911..3537b34 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,13 @@

- - - Django DynNames: Advanced filename patterns using f-Strings + + + Django DynNames: Advanced filename patterns using f-Strings
- Documentation | - Issues | - Changelog | + Documentation | + Issues | + Changelog | Funding 💚

From ca67afa750d84869d2ac3cdce93ca73ddc1b6c85 Mon Sep 17 00:00:00 2001 From: Johannes Maron Date: Fri, 19 Dec 2025 00:42:59 +0100 Subject: [PATCH 3/3] Fix name --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3537b34..81d2cf4 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ - Django DynNames: Advanced filename patterns using f-Strings + Django DynFN: Advanced filename patterns using f-Strings
Documentation |