question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Custom Field Type ignores `addon_label`

See original GitHub issue

Consider the example below, I would expect the label to show the text “hi” but instead Lektor only prints “0”. If I replace the type “test” with “integer” it works as expected.

Model:

[fields.why]
type = test
addon_label = hi

Python custom lektor.types.base.Type:

class TestType(Type):
    widget = 'integer'

    def value_from_raw(self, raw: 'RawValue') -> int:
        return int(raw.value or '0')

[...]
self.env.add_type(TestType)

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
relikdcommented, Nov 15, 2022

And also here https://www.getlektor.com/docs/api/db/type/, where the “wrong” type is used.

0reactions
dairikicommented, Nov 15, 2022

I’ve just opened lektor/lektor-website#357 to track this.

Closing this ticket…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Python: TypeError: required field "type_ignores" missing from ...
I think you should try these advices Basic Flask app not running (TypeError: required field "type_ignores" missing from Module).
Read more >
Make custom field look like the Duration field - ServiceNow
Solved: I am wondering if there is a way to make a custom field look like the OOB Duration field. I have a...
Read more >
Why is a custom field not appearing in forms after changing its ...
I found that if a Select field has options_per_line set in civicrm_custom_field , then it fails to render, as described. A workaround is...
Read more >
Issue Collector: Can we add a field "Label" and cu...
I have tried the above option but unable to add a "Label" or Custom field of type "Label" to the Issue collector form....
Read more >
Defining Custom Fields - AddSearch Documentation
A custom field meta tag with unrecognized data type value will be ignored. Search results can be filtered against custom fields in the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found