# Path: djangoplus/templatetags/djangoplus_tags.py
# @register.filter_function
# def moneyformat(value, decimal_places=2, thousands_separator=''):
#     """Returns a float value in monetary format, using MONETARY_LOCALE
#     setting and locale functions"""
#     decimal_places = decimal_places is None and 2 or decimal_places
#     thousands_separator = thousands_separator or app_settings.THOUSANDS_SEPARATOR
# 
#     import locale
# 
#     if app_settings.MONETARY_LOCALE:
#         locale.setlocale(locale.LC_NUMERIC, app_settings.MONETARY_LOCALE)
# 
#     format = r"%0.0"+str(decimal_places)+'f'
# 
#     value = value or 0.0
# 
#     ret = locale.format(format, float(value), grouping=True)
# 
#     if thousands_separator:
#         dec_sep = thousands_separator == ',' and '.' or ','
#         parts = ret.split(dec_sep)
#         ret = split1000(parts[0].replace(thousands_separator, ''), thousands_separator)
# 
#         if len(parts) > 1:
#             ret += dec_sep + parts[1]
# 
#     return ret
# 
# Path: djangoplus/app_settings.py
# MONETARY_LOCALE = getattr(settings, 'MONETARY_LOCALE', '')
# THOUSANDS_SEPARATOR = getattr(settings, 'THOUSANDS_SEPARATOR', '')
# STATIC_FILES_PATH = getattr(settings, 'STATIC_FILES_PATH', 'uploads')
# ROBOT_PROTECTION_DOMAIN = getattr(settings, 'ROBOT_PROTECTION_DOMAIN', None)
# RESULT_OK = getattr(settings, 'RESULT_OK', 'ok')
# RESULT_ERROR = getattr(settings, 'RESULT_ERROR', 'error')
# AJAX_FK_USE_MEDIA = getattr(settings, 'AJAX_FK_USE_MEDIA', True)


import types, re, decimal
from datetime import date, time, datetime
from django.utils.safestring import mark_safe
from django.db import models
from django.template.defaultfilters import yesno, linebreaksbr, urlize
from django.utils.text import capfirst
from django.utils import dateformat
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist
    from django.utils.formats import get_format
        from django.utils.formats import localize
        from django.utils.translation import get_date_formats
from djangoplus.templatetags.djangoplus_tags import moneyformat
from djangoplus import app_settings

            yield ret

    def render_single_object(self, obj, tr_template=None, td_template=None):
        """Renders a single object. It is util internally or can be used for
        granulary customizations"""
        # Customized templates
        tr_template = tr_template or self._meta.tr_template
        td_template = td_template or self._meta.td_template

        fields = self._meta.fields or self.get_model_fields()
        row = []

        for i, f_name in enumerate(fields):
            f_value = self.get_field_display_value(f_name, obj)
            f_value = self.get_linkable_field_value(
                    obj, f_name, f_value,
                    force=not self._meta.list_display_links and i == 0,
                    )

            if isinstance(f_value, decimal.Decimal):
                f_value = moneyformat(f_value, None, app_settings.THOUSANDS_SEPARATOR)

            if self._meta.show_if_none or f_value is not None:
                row.append(td_template%{'field_name': f_name, 'value': f_value})
            else:
                row.append(td_template%{'field_name': f_name, 'value': '&nbsp;'})

        tds = ''.join(row) + self.render_buttons_cell(obj)


# Path: djangoplus/templatetags/djangoplus_tags.py
# @register.filter_function
# def moneyformat(value, decimal_places=2, thousands_separator=''):
#     """Returns a float value in monetary format, using MONETARY_LOCALE
#     setting and locale functions"""
#     decimal_places = decimal_places is None and 2 or decimal_places
#     thousands_separator = thousands_separator or app_settings.THOUSANDS_SEPARATOR
# 
#     import locale
# 
#     if app_settings.MONETARY_LOCALE:
#         locale.setlocale(locale.LC_NUMERIC, app_settings.MONETARY_LOCALE)
# 
#     format = r"%0.0"+str(decimal_places)+'f'
# 
#     value = value or 0.0
# 
#     ret = locale.format(format, float(value), grouping=True)
# 
#     if thousands_separator:
#         dec_sep = thousands_separator == ',' and '.' or ','
#         parts = ret.split(dec_sep)
#         ret = split1000(parts[0].replace(thousands_separator, ''), thousands_separator)
# 
#         if len(parts) > 1:
#             ret += dec_sep + parts[1]
# 
#     return ret
# 
# Path: djangoplus/app_settings.py
# MONETARY_LOCALE = getattr(settings, 'MONETARY_LOCALE', '')
# THOUSANDS_SEPARATOR = getattr(settings, 'THOUSANDS_SEPARATOR', '')
# STATIC_FILES_PATH = getattr(settings, 'STATIC_FILES_PATH', 'uploads')
# ROBOT_PROTECTION_DOMAIN = getattr(settings, 'ROBOT_PROTECTION_DOMAIN', None)
# RESULT_OK = getattr(settings, 'RESULT_OK', 'ok')
# RESULT_ERROR = getattr(settings, 'RESULT_ERROR', 'error')
# AJAX_FK_USE_MEDIA = getattr(settings, 'AJAX_FK_USE_MEDIA', True)


# Path: djangoplus/model_info.py
import types, re, decimal
from datetime import date, time, datetime
from django.utils.safestring import mark_safe
from django.db import models
from django.template.defaultfilters import yesno, linebreaksbr, urlize
from django.utils.text import capfirst
from django.utils import dateformat
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist
    from django.utils.formats import get_format
        from django.utils.formats import localize
        from django.utils.translation import get_date_formats
from djangoplus.templatetags.djangoplus_tags import moneyformat
from djangoplus import app_settings


            yield ret

    def render_single_object(self, obj, tr_template=None, td_template=None):
        """Renders a single object. It is util internally or can be used for
        granulary customizations"""
        # Customized templates
        tr_template = tr_template or self._meta.tr_template
        td_template = td_template or self._meta.td_template

        fields = self._meta.fields or self.get_model_fields()
        row = []

        for i, f_name in enumerate(fields):
            f_value = self.get_field_display_value(f_name, obj)
            f_value = self.get_linkable_field_value(
                    obj, f_name, f_value,
                    force=not self._meta.list_display_links and i == 0,
                    )

            if isinstance(f_value, decimal.Decimal):
                f_value = moneyformat(f_value, None, app_settings.THOUSANDS_SEPARATOR)

            if self._meta.show_if_none or f_value is not None:
                row.append(td_template%{'field_name': f_name, 'value': f_value})
            else:
                row.append(td_template%{'field_name': f_name, 'value': '&nbsp;'})

        tds = ''.join(row) + self.render_buttons_cell(obj)


        return self.format_tr_by_template(obj, tr_template, tds)