Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

  • Yeah, the transactions happen in a background worker. I'm working on a way to update the list when the sale actually happens. But that is still in the early design stages.
  • The "market" list filters out your own items, so you don't accidently buy from yourself. You can filter or sort the "Market" column in "My NFT" to see your listings.
  • The lists (My NFT, Market, etc) are pre-filtered (server side forced filters) lists. So the label at the bottom gets a bit confused. I'll have to fix that some day, but my ListAndEdit module isn't the easiest to maintain. It's super practical and i use it a lot, but over the years of extending it the code has had a bit of a spaghettification problem..

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";'

In reply to Re^2: XPD - Do more with your PerlMonks XP by cavac
in thread XPD - Do more with your PerlMonks XP by cavac

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (None)
    As of 2024-05-23 16:06 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      No recent polls found