0.6.11
profile subscribe view
This commit is contained in:
@@ -34,7 +34,11 @@ def show_cur_subscribe_ajax(request):
|
|||||||
else:
|
else:
|
||||||
tpl_name = 'blocks/profile/b_subscribe_current.html'
|
tpl_name = 'blocks/profile/b_subscribe_current.html'
|
||||||
|
|
||||||
|
all_options = SubscribeOption.objects.filter(enable=True)
|
||||||
subscribes = Subscribe.objects.filter(enable=True)
|
subscribes = Subscribe.objects.filter(enable=True)
|
||||||
|
for subscribe in subscribes:
|
||||||
|
subscribe_options_ids = subscribe.options.values_list('id', flat=True)
|
||||||
|
subscribe.disabled_options = all_options.exclude(id__in=subscribe_options_ids)
|
||||||
|
|
||||||
Dict = {
|
Dict = {
|
||||||
'subscribe_for_user': subscribe_for_user,
|
'subscribe_for_user': subscribe_for_user,
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ class SubscribeOption(BaseModel):
|
|||||||
class Meta:
|
class Meta:
|
||||||
verbose_name = _('Опция подписки')
|
verbose_name = _('Опция подписки')
|
||||||
verbose_name_plural = _('Опции подписки')
|
verbose_name_plural = _('Опции подписки')
|
||||||
|
ordering = ['order']
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -46,6 +46,8 @@ INSTALLED_APPS = [
|
|||||||
'django.contrib.staticfiles',
|
'django.contrib.staticfiles',
|
||||||
'django.contrib.humanize',
|
'django.contrib.humanize',
|
||||||
|
|
||||||
|
'colorfield',
|
||||||
|
|
||||||
'ckeditor',
|
'ckeditor',
|
||||||
'ckeditor_uploader',
|
'ckeditor_uploader',
|
||||||
|
|
||||||
|
|||||||
@@ -9,5 +9,5 @@ geopy
|
|||||||
channels==4.0.0
|
channels==4.0.0
|
||||||
daphne==4.0.0
|
daphne==4.0.0
|
||||||
channels-redis==4.1.0
|
channels-redis==4.1.0
|
||||||
|
django-colorfield
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user