http://qs1969.pair.com?node_id=11142704


in reply to Re: XPD - Do more with your PerlMonks XP
in thread XPD - Do more with your PerlMonks XP

On the bright side, you can use ListAndEdit to just configure complex webmasks without writing code. For example, here is all i needed to implement the whole of "My NFT":

<module> <modname>xpd_user_nft</modname> <pm>ListAndEdit::Main</pm> <options> <db>maindb</db> <pagetitle>My NFT</pagetitle> <webpath>/xpd/nft/mynft</webpath> <table>xpd.nft</table> <primarykey> <item column="nft_id"/> </primarykey> <orderby>creation_time DESC</orderby> <session>sessionsettings</session> <guess_stats>1</guess_stats> <column_filters>1</column_filters> <candelete>0</candelete> <cancreate>0</cancreate> <useserial>0</useserial> <list> <item header="ID" column="nft_id" type="text"/> <item header="Time" column="creation_time" type="date" +/> <item header="Creator" column="creator" type="text"/> <item header="Title" column="title" type="text"/> <item header="Description" column="description" type=" +text"/> <item header="Image" column="image_data_base64" type=" +image"/> <item header="Price" column="sale_price" type="text"/> <item header="Market" column="sell_on_market" type="bo +olean"/> </list> <edit> <item header="ID" column="nft_id" type="display"/> <item header="Time" column="creation_time" type="displ +ay"/> <item header="Creator" column="creator" type="display" +/> <item header="Title" column="title" type="display"/> <item header="Description" column="description" type=" +display"/> <item header="Image" column="image_data_base64" type=" +imagedisplay"/> <item header="Sell on market" column="sell_on_market" +type="checkbox"/> <item header="Price" column="sale_price" type="number" + value_min="0" value_max="1000000" step="1" hasdecimal="0"/> </edit> <restrict> <item column="owner" value="USER"/> </restrict> </options> </module>

The downside is that it takes a couple of big statemachines and a lot on startup validation&preparation code to make that work. For example, it checks against the configured database table and matches if the configured display/edit type is compatible with the column type.

perl -e 'use Crypt::Digest::SHA256 qw[sha256_hex]; print substr(sha256_hex("the Answer To Life, The Universe And Everything"), 6, 2), "\n";'