English
Open in Telegram
OOmadbek Qosimov's blog

Omadbek Qosimov's blog

@python_Oqdev · channel · Tech · indexed since 2026-07-19
28subscribers
145posts in the index
O
Omadbek Qosimov's blog
Photo
click to show
punycode domain nginx serverga joylashtirayotganda include proxy_params; ni yozish shart emas chunki siz Xost sarlavhasini ikki marta kiritgansiz. proxy_set_header Host $host; include proxy_params; Faylni ko'rib chiqsangiz, proxy_paramsu allaqachon o'rnatilganligini ko'rasiz. Uni qayta o'rnatish ikki qiymatning vergul bilan birlashtirilishiga olib keladi. Ushbu fayl ichida siz ushbu faylni qo'shganingizda foydalaniladigan oldindan o'rnatilgan sarlavhalarni topasiz. O'zingizning konfiguratsiyangizda ushbu qatorlarni takrorlashingiz shart emas. ubuntu@vmtest-ubuntu2004:~$ cat /etc/nginx/proxy_params proxy_set_header Host $http_host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; Siz o'zingizning qo'shimchangizni proxy_set_header Host $host; konfiguratsiyadan olib tashlashingiz mumkin. batafsil #deploy #nginx #punycode
1 · 168 ·
O
Photo
click to show
docker error "chunked" pip3 uninstall requests pip3 install requests=2.28.1 #docker #chunked
236 ·
O
Omadbek Qosimov's blog
Photo
click to show
pg_hba.conf postgresga tashqi iplardan kirish uchun ruxsat ochish #postgresql #network
1 · 240 ·
O
ReplyPhoto
recourse.py from import_export import resources, fields from .models import Order from import_export.widgets import ForeignKeyWidget,ManyToManyWidget from apps.depreciation.models import DepreciationItem from apps.profile.models import User class OrderResource(resources.ModelResource): customer = fields.Field( column_name='Customer Name', attribute='user', widget=ForeignKeyWidget(User, 'id')) saler = fields.Field( column_name='Saler Name', attribute='user', widget=ForeignKeyWidget(User, 'id')) depreciation = fields.Field(column_name="Depreciation") category = fields.Field(column_name='Category name') class Meta: model = Order fields = ('id', 'status', 'customer','price','category','depreciation','created_at') def dehydrate_category(self, order): return order.product.depreciation_cat.title def dehydrate_depreciation(self, order): deprecation = DepreciationItem.objects.get(office = order.product.office,category = order.product.depreciation_cat) return f"year:{deprecation.year}, office: {deprecation.office.title}, percantage: {deprecation.percentage}" def dehydrate_customer(self, order): if order.user: return f"{order.user.first_name} {order.user.last_name}" return order.user.username def dehydrate_saler(self, order): if order.saler: return order.saler.get_full_name() if order.saler.get_full_name() else order.saler.username return "" admin.py @admin.register(Order) class OrderAdmin(AdminChartMixin, ImportExportModelAdmin): list_display = ('product', 'user', 'status', 'created_at', 'updated_at') list_filter = ('status', 'created_at', 'updated_at') list_editable = ('status', ) list_chart_type = "pie" list_chart_data = {} list_chart_options = {"aspectRatio": 6} list_chart_config = None readonly_fields = ('saler',) resource_cl
197 ·
O
Omadbek Qosimov's blog
Photo
click to show
for m2m changing for pre_save signal #m2m #pre_save #bug
236 ·
O
Omadbek Qosimov's blog
Photo
click to show
Order by property but its not optimization code #property , #filter
238 ·
O
Omadbek Qosimov's blog
Photo
click to show
class DescriptionVariationModelInline(admin.TabularInline): model= models.DescriptionVariationModel extra = 22 max_num = 22 line_numbering = 0 fields = ['line_number','context'] readonly_fields = ('line_number',) def line_number(self, obj): self.line_numbering += 1 return self.line_numbering
1 · 511 ·
Omadbek Qosimov's blog
File
Screencast from 2024-10-26 01-16-01.webm · 156 KB · click to show
File
dynamic_admin_category.zip · 28 KB · click to show
2 · 362 ·

An open public feed from the search index ChatCrawler — “Google for public Telegram”; refreshed as the venue is crawled. Times are UTC.

Public content only, official Telegram API. About · FAQ · Index limits · Remove a page · Catalog · Search · How we count