from django.db import models

class MoneyField(models.DecimalField):
    
    def __init__(self, *args, **kwargs):
        # Default to the max size for SQL Server's money datatype
        kwargs['max_digits'] = kwargs.get('max_digits', 20)
        kwargs['decimal_places'] = kwargs.get('decimal_places', 2)
        super(MoneyField, self).__init__(*args, **kwargs)
    
    def get_placeholder(self, value):
        return r'CONVERT(money, %s)'