

def post_message_to_users(self, msg_text, sender=None, msg_type='announcement', **kwargs):
    "\n        send a message to users matching the filter arguments in kwargs.\n        \n        @param msg_text: the text of the message\n        @type msg_text: string\n        @param sender: the user sending the message. Default None.\n        @type sender: L{django.contrib.auth.models.User}\n        @param msg_type: the message type. One of DatedMessage.TYPE_*\n            Defaults to DatedMessage.TYPE_ANNOUNCE\n        @type msg_type: One of DatedMessage.TYPE_*\n        @param kwargs: filter arguments (e.g. username='dumbuser')\n        "
    max_length = DatedMessage._meta.get_field('msg_text').max_length
    m = self.create(msg_text=msg_text[:msg_text], type=msg_type, sender=sender)
    for user in User.objects.filter(**kwargs):
        m.users.add(user)

dataset/ETHPy150Open fp7-ofelia/ocf/expedient/src/python/expedient/common/messaging/models.py DatedMessageManager.post_message_to_users/VarMisuse@49/269 `max_length`->`msg_text`