Django
- 21 ответ
- 0 вопросов
13
Вклад в тег
class property(object):
def __init__(self, fget):
self.fget = fget
def __get__(self, obj, type = None):
return self.fget(obj)
obj = Person()
# obj.full_name_2()
Person.__dict__['full_name_2'](obj)
# obj.full_name_1
Person.__dict__['full_name_1'].__get__(obj)
./project_name/
./project_name/settings.py
./project_name/urls.py
./project_name/static/
./project_name/static/css/...
./project_name/static/js/...
./project_name/static/imgs/...
./dealer/
./dealer/admin.py
./dealer/models.py
./dealer/views.py
./dealer/urls.py
./dealer/templates/
./dealer/templates/dealer/
./dealer/templates/dealer/list.html
./vehicles/
./vehicles/admin.py
./vehicles/models.py
./vehicles/logistics/
./vehicles/logistics/models.py
./vehicles/logistics/admin.py
./vehicles/logistics/views.py
./vehicles/logistics/urls.py
./vehicles/logistics/templates/
./vehicles/logistics/templates/logistics/tracking.html
./vehicles/logistics/static/
./vehicles/logistics/static/js/app/tracking/
./vehicles/logistics/static/js/app/tracking/main.js
./vehicles/logistics/static/js/app/tracking/app.js
./vehicles/logistics/static/js/app/tracking/...
./vehicles/sales/
./vehicles/sales/models.py
./vehicles/sales/admin.py
./vehicles/sales/views.py
./vehicles/sales/urls.py
./vehicles/sales/templates/
./vehicles/sales/templates/sales/invoices.html
./vehicles/sales/static/
./vehicles/sales/static/js/app/invoices/
./vehicles/sales/static/js/app/invoices/main.js
./vehicles/sales/static/js/app/invoices/app.js
./vehicles/sales/static/js/app/invoices/...
./static/
./media/
./templates/
./templates/base.html
./templates/...
class EditForm(forms.ModelForm):
category = forms.ModelChoiceField(
queryset=Category.objects.all(),
label='Categories',
widget=forms.Select()
)
class Meta:
model = Item
fields = ('category', 'mode', 'type', 'delivery' )
Category
из моделей.entries__set
is_published=True
, когда сами же пишете, что нужны неопубликованные...