-
Notifications
You must be signed in to change notification settings - Fork 0
/
To learn what hackers doing1.py
641 lines (416 loc) · 19.1 KB
/
To learn what hackers doing1.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
from django import forms
from django.contrib import admin
from django.utils.translation import ugettext_lazy as _ # what does " as _" mean?
from .models import * # is "*" a module?
from .forms import *
# Inlines
class pfCatalogFileTypeInline(admin.TabularInline): # 1. what's "class?"
model = pfCatalogFileType #
fields = ('pid', 'title', 'additional_price', 'pfcatalogfilespec',) #
readonly_fields = ('pid', 'title', 'additional_price',) #
can_delete = False #
extra = 0 #
class pfCatalogOptionTypeInline(admin.TabularInline):
model = pfCatalogOptionType
fields = ('pid', 'type', 'title', 'additional_price',)
readonly_fields = fields
can_delete = False
extra = 0
class pfCatalogVariantInline(admin.TabularInline):
model = pfCatalogVariant
fields = ('get_sku_part', 'pfsize', 'pfcolor', 'price', 'in_stock',)
readonly_fields = fields
can_delete = False
extra = 0
class pfStateInline(admin.TabularInline):
model = pfState
fields = ('code', 'name',)
readonly_fields = fields
can_delete = False
extra = 0
# Standard Admins
class bzBrandAdmin(admin.ModelAdmin):
form = bzBrandForm #form?
list_display = ['code', 'name', 'vendor', 'outlet', ] #
readonly_fields = ['id', 'date_added', 'date_updated']
list_filter = ['vendor', 'outlet', ] #
search_fields = ['id', 'code', 'name', ] #
admin.site.register(bzBrand, bzBrandAdmin) #
class bzCreativeCollectionAdmin(admin.ModelAdmin):
form = bzCreativeCollectionForm
list_display = [
'id', 'date_added', 'date_updated',
'code', 'name', 'bzbrand',
]
readonly_fields = ['id', 'date_added', 'date_updated']
list_filter = ['bzbrand', ]
search_fields = ['id', 'name', 'code', ]
admin.site.register(bzCreativeCollection, bzCreativeCollectionAdmin)
class bzCreativeDesignAdmin(admin.ModelAdmin):
form = bzCreativeDesignForm
list_display = [
'id', 'date_added', 'date_updated',
'code', 'name', 'bzcreativecollection',
]
readonly_fields = ['id', 'date_added', 'date_updated', ]
list_filter = ['bzcreativecollection', ]
search_fields = ['id', 'name', 'code', ]
admin.site.register(bzCreativeDesign, bzCreativeDesignAdmin)
class bzCreativeLayoutAdmin(admin.ModelAdmin):
form = bzCreativeLayoutForm
list_display = [
'id', 'date_added', 'date_updated',
'code', 'name', 'bzcreativecollection',
]
readonly_fields = ['id', 'date_added', 'date_updated', ]
list_filter = ['bzcreativecollection', ]
search_fields = ['id', 'name', 'code', ]
admin.site.register(bzCreativeLayout, bzCreativeLayoutAdmin)
class bzCreativeRenderingAdmin(admin.ModelAdmin):
form = bzCreativeRenderingForm
list_display = [
'id', 'date_added', 'date_updated',
'bzcreativedesign', 'bzcreativelayout',
]
readonly_fields = ['id', 'date_added', 'date_updated', ]
list_filter = ['bzcreativedesign', 'bzcreativelayout', ]
search_fields = ['id', ]
admin.site.register(bzCreativeRendering, bzCreativeRenderingAdmin)
class bzProductAdmin(admin.ModelAdmin):
form = bzProductForm
list_display = [
'id', 'date_added', 'date_updated',
'code', 'name', 'status',
'bzDesign', 'pfProduct', 'wooProduct', 'pfSyncProduct',
]
readonly_fields = ['id', 'date_added', 'date_updated', ]
list_filter = [
'status', 'bzDesign', 'pfProduct', 'wooProduct', 'pfSyncProduct',
]
search_fields = ['id', 'name', 'code', ]
admin.site.register(bzProduct, bzProductAdmin)
class bzProductVariantAdmin(admin.ModelAdmin):
form = bzProductVariantForm
list_display = [
'id', 'date_added', 'date_updated',
'code', 'is_active',
'bzproduct', 'pfcatalogvariant', 'pfcolor', 'pfsize', 'price',
]
readonly_fields = ['id', 'date_added', 'date_updated', ]
list_filter = [
'bzproduct', 'pfcatalogvariant', 'pfcolor', 'pfsize',
]
search_fields = ['id', 'code', ]
admin.site.register(bzProductVariant, bzProductVariantAdmin)
class wooAttributeAdminForm(forms.ModelForm):
class Meta:
model = wooAttribute
fields = '__all__'
class wooAttributeAdmin(admin.ModelAdmin):
form = wooAttributeAdminForm
list_display = ['id', 'date_added', 'date_updated',
'is_active', 'wid', 'name', 'slug', 'type', 'has_archives']
readonly_fields = ['id', 'date_added', 'date_updated',
'is_active', 'wid', 'name', 'slug',
'type', 'has_archives']
admin.site.register(wooAttribute, wooAttributeAdmin)
class wooCategoryAdminForm(forms.ModelForm):
class Meta:
model = wooCategory
fields = '__all__'
class wooCategoryAdmin(admin.ModelAdmin):
form = wooCategoryAdminForm
list_display = ['id', 'date_added', 'date_updated',
'is_active', 'wid', 'name', 'slug',
'parent', 'description', 'display', 'count',
'image_id', 'image_date_created']
readonly_fields = ['id', 'date_added', 'date_updated',
'is_active', 'wid', 'name',
'slug', 'parent', 'description', 'display',
'count', 'image_id', 'image_date_created']
admin.site.register(wooCategory, wooCategoryAdmin)
class wooImageAdminForm(forms.ModelForm):
class Meta:
model = wooImage
fields = '__all__'
class wooImageAdmin(admin.ModelAdmin):
form = wooImageAdminForm
list_display = ['id', 'date_added', 'date_updated',
'is_active', 'wid', 'date_created', 'alt', 'position']
readonly_fields = ['id', 'date_added', 'date_updated',
'is_active', 'wid', 'date_created', 'alt', 'position']
admin.site.register(wooImage, wooImageAdmin)
class wooProductAdminForm(forms.ModelForm):
class Meta:
model = wooProduct
fields = '__all__'
class wooProductAdmin(admin.ModelAdmin):
form = wooProductAdminForm
list_display = ['id', 'date_added', 'date_updated', 'is_active',
'wid', 'slug', 'permalink',
'date_created', 'dimension_length', 'dimension_width',
'dimension_height', 'weight', 'reviews_allowed']
readonly_fields = ['id', 'date_added', 'date_updated', 'is_active', 'wid',
'slug', 'permalink',
'date_created', 'dimension_length', 'dimension_width',
'dimension_height', 'weight', 'reviews_allowed']
admin.site.register(wooProduct, wooProductAdmin)
class wooShippingClassAdminForm(forms.ModelForm):
class Meta:
model = wooShippingClass
fields = '__all__'
class wooShippingClassAdmin(admin.ModelAdmin):
form = wooShippingClassAdminForm
list_display = ['id', 'wid', 'name', 'slug', 'description', 'count']
readonly_fields = ['id', 'wid', 'name', 'slug', 'description', 'count']
admin.site.register(wooShippingClass, wooShippingClassAdmin)
class wooStoreAdminForm(forms.ModelForm):
class Meta:
model = wooStore
fields = '__all__'
class wooStoreAdmin(admin.ModelAdmin):
form = wooStoreAdminForm
list_display = ['id', 'date_added', 'date_updated', 'code',
'base_url', 'consumer_secret', 'timezone', 'verify_ssl']
readonly_fields = ['id', 'date_added', 'date_updated', ]
search_fields = ['id', 'code', ]
list_filter = (
('timezone', admin.RelatedOnlyFieldListFilter),
)
admin.site.register(wooStore, wooStoreAdmin)
class wooTagAdminForm(forms.ModelForm):
class Meta:
model = wooTag
fields = '__all__'
class wooTagAdmin(admin.ModelAdmin):
form = wooTagAdminForm
list_display = ['id', 'date_added', 'date_updated',
'is_active', 'wid', 'name', 'slug', 'description', 'count']
readonly_fields = ['id', 'date_added', 'date_updated',
'is_active', 'wid', 'name', 'slug',
'description', 'count']
admin.site.register(wooTag, wooTagAdmin)
class wooTermAdminForm(forms.ModelForm):
class Meta:
model = wooTerm
fields = '__all__'
class wooTermAdmin(admin.ModelAdmin):
form = wooTermAdminForm
list_display = ['id', 'date_added', 'date_updated', 'wid', 'name',
'slug', 'menu_order', 'count', 'wr_tooltip', 'wr_label']
readonly_fields = ['id', 'date_added', 'date_updated', 'wid',
'name', 'slug', 'menu_order', 'count', 'wr_tooltip',
'wr_label']
admin.site.register(wooTerm, wooTermAdmin)
class wooVariantAdminForm(forms.ModelForm):
class Meta:
model = wooVariant
fields = '__all__'
class wooVariantAdmin(admin.ModelAdmin):
form = wooVariantAdminForm
list_display = ['id', 'date_added', 'date_updated', 'is_active',
'wid', 'date_created',
'permalink', 'sku', 'price', 'dimension_length',
'dimension_width', 'dimension_height', 'weight']
readonly_fields = ['id', 'date_added', 'date_updated', 'is_active',
'wid', 'date_created',
'permalink', 'sku', 'price', 'dimension_length',
'dimension_width', 'dimension_height', 'weight']
admin.site.register(wooVariant, wooVariantAdmin)
class wpMediaAdminForm(forms.ModelForm):
class Meta:
model = wpMedia
fields = '__all__'
class wpMediaAdmin(admin.ModelAdmin):
form = wpMediaAdminForm
list_display = ['id', 'date_added', 'date_updated', 'is_active',
'alt_text', 'width', 'height', 'file', 'author',
'mime_type', 'comment_status', 'wid',
'source_url', 'template', 'ping_status', 'caption',
'link', 'slug', 'modified', 'guid', 'description',
'modified_gmt', 'title', 'date_gmt', 'type']
readonly_fields = ['id', 'date_added', 'date_updated', 'is_active',
'alt_text', 'width', 'height', 'file', 'author',
'mime_type', 'comment_status', 'wid',
'source_url', 'template', 'ping_status', 'caption',
'link', 'slug', 'modified', 'guid', 'description',
'modified_gmt', 'title', 'date_gmt', 'type']
admin.site.register(wpMedia, wpMediaAdmin)
class wpMediaSizeAdminForm(forms.ModelForm):
class Meta:
model = wpMediaSize
fields = '__all__'
class wpMediaSizeAdmin(admin.ModelAdmin):
form = wpMediaSizeAdminForm
list_display = ['id', 'date_added', 'date_updated', 'is_active',
'name', 'file', 'mime_type',
'width', 'height', 'source_url']
readonly_fields = ['id', 'date_added', 'date_updated', 'is_active',
'name', 'file', 'mime_type',
'width', 'height', 'source_url']
admin.site.register(wpMediaSize, wpMediaSizeAdmin)
class pfCountryAdminForm(forms.ModelForm):
class Meta:
model = pfCountry
fields = '__all__'
class pfCountryAdmin(admin.ModelAdmin):
form = pfCountryAdminForm
list_display = ['id', 'date_added', 'date_updated', 'code', 'name']
readonly_fields = ['id', 'date_added', 'date_updated', 'code', 'name']
admin.site.register(pfCountry, pfCountryAdmin)
class pfStateAdminForm(forms.ModelForm):
class Meta:
model = pfState
fields = '__all__'
class pfStateAdmin(admin.ModelAdmin):
form = pfStateAdminForm
list_display = ['id', 'date_added', 'date_updated', 'code', 'name']
readonly_fields = ['id', 'date_added', 'date_updated', 'code', 'name']
admin.site.register(pfState, pfStateAdmin)
class pfSyncProductAdminForm(forms.ModelForm):
class Meta:
model = pfSyncProduct
fields = '__all__'
class pfSyncProductAdmin(admin.ModelAdmin):
form = pfSyncProductAdminForm
list_display = ['id', 'date_added', 'date_updated', 'pid', 'external_id',
'variants', 'synced']
readonly_fields = ['id', 'date_added', 'date_updated',
'pid', 'external_id', 'variants', 'synced']
admin.site.register(pfSyncProduct, pfSyncProductAdmin)
class pfSyncVariantAdminForm(forms.ModelForm):
class Meta:
model = pfSyncVariant
fields = '__all__'
class pfSyncVariantAdmin(admin.ModelAdmin):
form = pfSyncVariantAdminForm
list_display = ['id', 'date_added', 'date_updated',
'pid', 'external_id', 'synced']
readonly_fields = ['id', 'date_added', 'date_updated',
'pid', 'external_id', 'synced']
admin.site.register(pfSyncVariant, pfSyncVariantAdmin)
class pfSyncItemOptionAdminForm(forms.ModelForm):
class Meta:
model = pfSyncItemOption
fields = '__all__'
class pfSyncItemOptionAdmin(admin.ModelAdmin):
form = pfSyncItemOptionAdminForm
list_display = ['id', 'date_added', 'date_updated', 'pid', 'value']
readonly_fields = ['id', 'date_added', 'date_updated', 'pid', 'value']
admin.site.register(pfSyncItemOption, pfSyncItemOptionAdmin)
class pfCatalogColorAdminForm(forms.ModelForm):
class Meta:
model = pfCatalogColor
fields = '__all__'
class pfCatalogColorAdmin(admin.ModelAdmin):
form = pfCatalogColorAdminForm
list_display = ['name', 'code', 'label_clean', 'hex_code', ]
readonly_fields = ['name', 'hex_code', ]
list_editable = ['code', 'label_clean', ]
search_fields = ['name', 'code', 'label_clean', 'hex_code', ]
admin.site.register(pfCatalogColor, pfCatalogColorAdmin)
class pfCatalogSizeAdminForm(forms.ModelForm):
class Meta:
model = pfCatalogSize
fields = '__all__'
class pfCatalogSizeAdmin(admin.ModelAdmin):
form = pfCatalogSizeAdminForm
list_display = ['name', 'code', 'label_clean', 'sort_group', 'sort_order']
readonly_fields = ['name']
list_filter = ['sort_group', ]
admin.site.register(pfCatalogSize, pfCatalogSizeAdmin)
class pfCatalogFileSpecAdminForm(forms.ModelForm):
class Meta:
model = pfCatalogFileSpec
fields = '__all__'
class pfCatalogFileSpecAdmin(admin.ModelAdmin):
form = pfCatalogFileSpecAdminForm
list_display = ['id', 'date_added', 'date_updated', 'name', 'note',
'width', 'height',
'width_in', 'height_in', 'ratio', 'colorsystem']
readonly_fields = ['id', 'date_added', 'date_updated', 'name', 'note',
'width', 'height',
'width_in', 'height_in', 'ratio', 'colorsystem']
admin.site.register(pfCatalogFileSpec, pfCatalogFileSpecAdmin)
class pfCatalogFileTypeAdminForm(forms.ModelForm):
class Meta:
model = pfCatalogFileType
fields = '__all__'
class pfCatalogFileTypeAdmin(admin.ModelAdmin):
form = pfCatalogFileTypeAdminForm
list_display = ['id', 'date_added', 'date_updated',
'pid', 'title', 'additional_price']
readonly_fields = ['id', 'date_added', 'date_updated',
'pid', 'title', 'additional_price']
admin.site.register(pfCatalogFileType, pfCatalogFileTypeAdmin)
class pfCatalogOptionTypeAdminForm(forms.ModelForm):
class Meta:
model = pfCatalogOptionType
fields = '__all__'
class pfCatalogOptionTypeAdmin(admin.ModelAdmin):
form = pfCatalogOptionTypeAdminForm
list_display = ['id', 'date_added', 'date_updated',
'pid', 'title', 'type', 'additional_price']
readonly_fields = ['id', 'date_added', 'date_updated',
'pid', 'title', 'type', 'additional_price']
admin.site.register(pfCatalogOptionType, pfCatalogOptionTypeAdmin)
class pfCatalogProductAdminForm(forms.ModelForm):
class Meta:
model = pfCatalogProduct
fields = '__all__'
class pfCatalogProductAdmin(admin.ModelAdmin):
form = pfCatalogProductAdminForm
list_display = ['id', 'date_added', 'date_updated', 'is_active',
'pid', 'ptype', 'brand', 'model', 'image', 'variant_count']
readonly_fields = ['id', 'date_added', 'date_updated', 'is_active',
'pid', 'ptype', 'brand', 'model',
'image', 'variant_count']
admin.site.register(pfCatalogProduct, pfCatalogProductAdmin)
class pfCatalogVariantAdminForm(forms.ModelForm):
class Meta:
model = pfCatalogVariant
fields = '__all__'
class pfCatalogVariantAdmin(admin.ModelAdmin):
form = pfCatalogVariantAdminForm
list_display = ['id', 'date_added', 'date_updated', 'is_active',
'pid', 'name', 'image', 'price', 'in_stock', 'weight']
readonly_fields = ['id', 'date_added', 'date_updated', 'is_active',
'pid', 'name', 'image', 'price', 'in_stock', 'weight']
admin.site.register(pfCatalogVariant, pfCatalogVariantAdmin)
class pfStoreAdminForm(forms.ModelForm):
class Meta:
model = pfStore
fields = '__all__'
class pfStoreAdmin(admin.ModelAdmin):
form = pfStoreAdminForm
list_display = ['id', 'date_added', 'date_updated', 'code', 'name',
'website', 'created', 'key']
readonly_fields = ['id', 'date_added', 'date_updated', 'code',
'name', 'website', 'created', 'key',
'return_address', 'billing_address',
'payment_type', 'payment_number_mask', 'payment_expires', ]
admin.site.register(pfStore, pfStoreAdmin)
class pfPrintFileAdminForm(forms.ModelForm):
class Meta:
model = pfPrintFile
fields = '__all__'
class pfPrintFileAdmin(admin.ModelAdmin):
form = pfPrintFileAdminForm
list_display = ['id', 'date_added', 'date_updated', 'pid', 'ptype',
'phash', 'url', 'filename',
'mime_type', 'size', 'width', 'height', 'dpi',
'status', 'created', 'thumbnail_url', 'visible']
readonly_fields = ['id', 'date_added', 'date_updated', 'pid',
'ptype', 'phash', 'url', 'filename',
'mime_type', 'size', 'width', 'height', 'dpi',
'status', 'created', 'thumbnail_url', 'visible']
admin.site.register(pfPrintFile, pfPrintFileAdmin)
class MimeTypeAdmin(admin.ModelAdmin):
pass
admin.site.register(MimeType, MimeTypeAdmin)
class pfFileTypeAdmin(admin.ModelAdmin):
pass
admin.site.register(pfFileType, pfFileTypeAdmin)
class pfFileStatusAdmin(admin.ModelAdmin):
pass
admin.site.register(pfFileStatus, pfFileStatusAdmin)