Skip to main content

tiddlywebplugins.form

Provides a Serializer to transform HTML form-data into an object that can be put into the store.

Also adds POST support to the standard set of URLs and support for uploading binary files.

URLs with POST support are:

/bags/foo/tiddlers /recipes/foo/tiddlers

To use, add tiddlywebplugins.form to your system_plugins in tiddlywebconfig.py.

You can then POST tiddlers to the server as follows:

  1. set up an HTML form with any named elements. Supported names include:

    title - tiddler.title (this is optional and, depends upon which URL you POST to. Additionally, if you POST to /bags/foo/tiddlers without a title, you will get a UUID title instead). text - tiddler.text tags - tiddler.tags (this can be a list (eg checkboxes), or a string formatted as per standard TiddlyWiki tags). created - tiddler.created modified - tiddler.modified file - this is a special case and represents a binary file so must take the form of an HTML <input type=”file” /> tag. If this is specified, you may include tags and a title, but anything else will be ignored.

  2. Content type (enctype attribute in HTML form lingo) of the form must be either appilcation/x-www-form-urlencoded or multipart/form-data (if uploading a binary file)

  3. POST the form (ie - set the method to POST) to one of the above URLs (ie - set the action attribute), replacing foo as required.

  4. Optionally specificy a redirect to redirect to a different page.

Example Usage:

say you want to POST a new tiddler to the bag “common”, you might include the following HTML:

<form action=”/bags/common/tiddlers” method=”POST”> <input type=”text” name=”title” value=”New Tiddler” /> <textarea name=”text” rows=”5” cols=”40”></textarea> <input type=”text” name=”tags” /> <input type=”submit” value=”Save” /> </form>

Alternatively, you may want to upload a binary file to the bag “common”:

<form action=”/bags/common/tiddlers” method=”POST” enctype=”multipart/form-data”> <input type=”file” name=”file” /> <input type=”submit” value=”Upload” /> </form>

There is also a Binary Upload Plugin for TiddlyWiki designed specifically to work with tiddlyweplugins.form. You can find it at https://raw.githubusercontent.com/TiddlySpace/tiddlyspace/master/src/plugins/BinaryUploadPlugin.js

You can find the source code at https://github.com/tiddlyweb/tiddlywebplugins.form

Release files for tiddlywebplugins.form 0.12.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tiddlywebplugins.form 0.12.1
File Size Uploaded
tiddlywebplugins.form-0.12.1.tar.gz 18.5 kB Details

Release files / tiddlywebplugins.form-0.12.1.tar.gz

Download URL tiddlywebplugins.form-0.12.1.tar.gz
Size 18.5 kB
Tags Source
SHA-256 checksum
How to use checksums
35103aa316a896d290a2781282c439237c06147153f17c31a0a105961e430796
BLAKE2b-256 checksum
How to use checksums
1d1b58d7ad239fca4d40c4e8dbf83ade98a1a3d7aa195c3628ca9f9f36e62532
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.12.1 This release

1 release file

0.12

1 release file

0.11

1 release file

0.10

1 release file

0.9

1 release file

0.8

1 release file

0.7

1 release file

0.6

1 release file

0.5

1 release file

0.4

1 release file

0.3

1 release file

0.2

1 release file

0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page