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.

Newly added fields with a "def" should get that def for existing documents in the database, for field types where this is safe and sensible

See original GitHub issue

Running 2.59.0.

I’ve been trying to get some default options loaded for my widgets. Seems like it’s either completely broken, the documentation is incorrect, or I am doing it wrong.

I have tried for pretty much all field types, but no matter what I do, it loads the first option in a select, it does not load a text in a string field etc.

I’m using def to set the default value against the value of the select or as a string if a string field.

I would like to dig into the source and try to find out why, but I’m pretty new around here, so I thought I would report it here first… maybe it’s not just me?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:17 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
boutellcommented, Jun 23, 2018

def should work, we will take a look.

On Sat, Jun 23, 2018, 5:42 AM Carsten notifications@github.com wrote:

Very strange. I tested the select field with a virgin widget but after saving options for tests, I can confirm your behavior.

I managed to set def as value on the input string field. But unfortunately, Apostrophe does not use the value attribute. It places the values inside a shadow-root.

That is the end of my wisdom.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/apostrophecms/apostrophe/issues/1442#issuecomment-399658460, or mute the thread https://github.com/notifications/unsubscribe-auth/AAB9fRTcZI7KfMcfmJaOd2k4Dtl857Bjks5t_g1vgaJpZM4U0rES .

0reactions
stale[bot]commented, Jun 19, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Chapter 3. Data, Tables, and Database Design - O'Reilly
In a properly designed database, new data adds rows, not fields. (When you're designing tables, you have to think about how they're going...
Read more >
Add a field to a form or report - Microsoft Support
On the Design tab, in the Tools group, click Add Existing Fields. -OR-. Press ALT+F8. In the Field List pane, find the table...
Read more >
ArcGIS field data types
When you create feature classes and tables, you select a data type for each field. The available types include a variety of number...
Read more >
Working with forms - Django documentation
A form's fields are themselves classes; they manage form data and perform validation when a form is submitted. A DateField and a FileField...
Read more >
Django Tutorial Part 10: Testing a Django web application
Often you will add a test class for each model/view/form you want to test, ... We have to access the field using 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