You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
776 B
29 lines
776 B
from form_check import translit_with_separator
|
|
from signal_additional_func import fill_missing_languages, fill_meta_information
|
|
|
|
|
|
def post_save_handler(sender, **kwargs):
|
|
"""
|
|
receiver function
|
|
take object
|
|
fill missing languages
|
|
fill settings if its exist for this object
|
|
|
|
"""
|
|
obj = kwargs['instance']
|
|
fill_missing_languages(obj)
|
|
fill_meta_information(obj)
|
|
|
|
from country.models import Country
|
|
def post_save_translation_handler(sender, **kwargs):
|
|
"""
|
|
receiver function
|
|
take object and change url
|
|
"""
|
|
obj = kwargs['instance']
|
|
if obj.language_code == 'ru':
|
|
c = Country.objects.all()[0]
|
|
c.url = 'tttt'
|
|
c.save()
|
|
#obj.master.url = translit_with_separator(obj.name)
|
|
#obj.master.save() |