Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add function for accessing new/existing custom fields of a card by name #246

Merged
merged 2 commits into from May 31, 2018

Conversation

JuergenBS
Copy link
Contributor

As enhancement for the new custom field functionality I added a new function for getting a proper custom field instance for a specific card - only by specifying the custom field name.

Examples:
cf = card_obj.get_custom_field_by_name('MyText')
cf.value = u'This is my test text'
cf = card_obj.get_custom_field_by_name('MyBool')
cf.value = True

@sarumont
Copy link
Owner

Looks good, but there should be a null check and fetch before processing the local data, as self.customFields may yet be None.

Examples:
 cf = card_obj.get_custom_field_by_name('MyText')
 cf.value = u'This is my test text'
 cf = card_obj.get_custom_field_by_name('MyBool')
 cf.value = True
@JuergenBS
Copy link
Contributor Author

JuergenBS commented May 31, 2018

I added lazy loading for card.customFields. The data is now actively fetched on first access or the json_obj provided by from_json() or fetch() is used. I hope, this change doesn't break anything.

@sarumont sarumont merged commit 7e9acf2 into sarumont:master May 31, 2018
@sarumont
Copy link
Owner

Looks good, @JuergenBS - thanks!

@james-d-f
Copy link

Could we add something similar to get the custom field definitions for a board by name, or would that not make sense?

@sarumont
Copy link
Owner

@jamesf-brainlabs Yeah, I think that makes sense. Having an accessor would make unravelling that a bit more efficient.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants