when i see the database it revert back , i.e there is no data after some time , i don't understand y it happens.
def unit_url_creater_with_page():
tab_list = ['info', 'listings', 'photos', 'plans', 'prices', 'payments',
'specifications', 'documents', 'local']
unit_cont_type = ContentType.objects.get(app_label="main", model="Unit")
unitobj = Unit.objects.all()
for uobj in unitobj:
ret_dict_for_url = unit_url(uobj)
main_url = ret_dict_for_url["url"]
main_url = "/".join(filter(None, main_url.lower().split("/")))
main_url = "/%s/" %("-".join(main_url.split()))
meta_description = ret_dict_for_url["meta_description"]
meta_title = ret_dict_for_url["meta_title"]
meta_keywords = ret_dict_for_url["meta_keywords"]
pobj, pobj_bool = Page.objects.get_or_create( url = main_url,
entity_type_id= unit_cont_type_id,
meta_description = meta_description,
meta_title = meta_title,
meta_keywords = meta_keywords)
if pobj_bool:
print pobj.url
for url_last_word in tab_list:
url_now = "%s%s/" %(main_url, url_last_word)
pobj, pobj_bool = Page.objects.get_or_create( url = url_now,
entity_type_id= unit_cont_type_id,
meta_description = meta_description,
meta_title = meta_title,
meta_keywords = meta_keywords)
if pobj_bool:
print pobj.url
print "#"*124
print "the end"