Metadata-Version: 2.1
Name: edc-form-label
Version: 0.1.0
Summary: Customize Django's form label in realtime
Home-page: http://github.com/clinicedc/edc-form-label
Author: Erik van Widenfelt
Author-email: ew2789@gmail.com
License: GPL license, see LICENSE
Keywords: django edc form
Platform: UNKNOWN
Classifier: Environment :: Web Environment
Classifier: Framework :: Django
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
Requires-Dist: Django

|pypi| |travis| |coverage|

edc-form-label
-------------
Customize Django's form label in realtime



For example:

For a sequence of data collection timepoints, we ask the question, "Are you circumcised". At some point we hope the  response will be YES. But until then we need to ask "Since we last saw you in October 2018, were you circumcised?", etc.

.. code-block:: python

	from edc_form_label import FormLabel, CustomFormLabel


	class MyCustomLabelCondition(CustomLabelCondition):
	    def check(self, **kwargs):
	        if self.previous_obj.circumcised == NO:
	            return True
	        return False


	@register(MyModel)
	class MyModelAdmin(admin.ModelAdmin):

	    fieldsets = (
	        (None, {
	            'fields': (
	                'subject_visit',
	                'report_datetime',
	                'circumcised')},
	         ),
	    )

	    custom_form_labels = [
	        FormLabel(
	            field='circumcised',
	            custom_label='Since we last saw you in {previous_visit}, were you circumcised?',
	            condition_cls=MyCustomLabelCondition)
	    ]



.. |pypi| image:: https://img.shields.io/pypi/v/edc-form-label.svg
    :target: https://pypi.python.org/pypi/edc-form-label

.. |travis| image:: https://travis-ci.com/clinicedc/edc-form-label.svg?branch=develop
    :target: https://travis-ci.com/clinicedc/edc-form-label

.. |coverage| image:: https://coveralls.io/repos/github/clinicedc/edc-form-label/badge.svg?branch=develop
    :target: https://coveralls.io/github/clinicedc/edc-form-label?branch=develop


