Support for Double Field

Created on 25 July 2023, over 1 year ago
Updated 4 August 2023, over 1 year ago

Problem/Motivation

In our project we are using the module Double Field . We need to get these items out of our API, that's why I made a patch to get content from the double field in my schema.

Remaining tasks

For our use case we knew that both fields where strings, therefor we could predefine this. In the future there should be a type check for more use cases. Since the double field allows:

  • Boolean
  • Text
  • Text (long)
  • Integer
  • Float
  • Decimal
  • Email
  • Telephone
  • Date
  • Url
Feature request
Status

Fixed

Version

2.0

Component

Code

Created by

🇧🇪Belgium cedricl

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @cedricl
  • 🇦🇺Australia almunnings Melbourne, 🇦🇺

    Oooh, Thats an interesting one!
    We would need to split them out into new types to get the correct combos of first/second.

    DoubleTextText
    DoubleTextBoolean
    DoubleBooleanText
    DoubleBooleanBoolean etc etc

    This could create... 100 unique types.

    https://onecompiler.com/python/3zfjmemyx

    If we did it, it could be really handy to some folks, but it's also adding ~~a lot~~ of types to the schema, which isn't ideal.

    I wonder if we treated the type of the subfield as the instance of that subfield.

    eg
    node article / field_my_subfield
    first: int (Player score)
    second: text (Player name)

    turns into a type of...

    NodeArticle {
      mySubfield: NodeArticleMySubfield
    }
    
    NodeArticleMySubfield {
      first: Int
      second: Text
    }

    The odds of someone needing 100 type combos over a few double fields, this might be a better direction.

    I'll have a sleep on it and start prototyping

  • Status changed to Needs work over 1 year ago
  • 🇦🇺Australia almunnings Melbourne, 🇦🇺
  • 🇦🇺Australia almunnings Melbourne, 🇦🇺

    Ok, take a look on dev. Give it a whirl.

    What a puzzle! Thanks for the feature suggestion.

  • Status changed to Fixed over 1 year ago
  • 🇦🇺Australia almunnings Melbourne, 🇦🇺
  • Status changed to Fixed over 1 year ago
  • 🇦🇺Australia almunnings Melbourne, 🇦🇺

    This is now part of beta9.

    Thanks!

Production build 0.71.5 2024