Remove underscores from column names in setFromDb()
See original GitHub issueI find myself having to re-write the fields and columns for very basic crud models, just because the titles of the columns have underscores in them. For instance, this is a model that simply has text fields, so the setFromDb()
function would be entirely sufficient, but I will need to write all the addColumns()
and addFields()
functions in order to remove the underscores:
Would there be any issues caused by labeling these columns and fields with removed underscores?
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (6 by maintainers)
Top Results From Across the Web
How to remove underscore from column names of an R data ...
How to remove underscore from column names of an R data frame? - When we import data from outside sources then the header...
Read more >How to remove underscores from column names within plots?
One useful answer below is to rename the resulting data frame to replace the underscores with spaces. Another I just thought of is...
Read more >Show Operation :: 4.1 Docs - Backpack for Laravel
Inside this method, it uses setFromDb() to try to magically figure out all attributes you would like shown for this Model, and shows...
Read more >Remove underscore for headertext columns - MSDN - Microsoft
I am using this linq query to fetch columns from my DB. protected void Page_Load(object sender, EventArgs e) { string CS = ConfigurationManager....
Read more >All changes - LiveAgent Changelog
[Fix] Call to a member function getConversationId() on null, ... [Fix] Remove useless field "Confirm message" from pre-chat edit dialog (#7941) ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@tabacitu I think that would be non breaking and be a good change. I do however like @lloy0076 solution better - a callable function would let me customize the names of all of my columns, without having to re-write all of the fields and columns. There are probably people out there who use snake case for their column names (no friends of mine, to be sure!) who may have different logic for their app. With a callable we could do something like:
This avoids all of the fields and columns being manually added, and adds a ton of flexibility. You could even set column titles using application logic if you wanted, ie. using the Crud/Settings package.
Yup, I think #688 is a good fix for this.