diff --git a/api/__pycache__/__init__.cpython-312.pyc b/api/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..79afa0365e5fe9919817e1d91e32cc914f8126d4 Binary files /dev/null and b/api/__pycache__/__init__.cpython-312.pyc differ diff --git a/api/__pycache__/__init__.cpython-313.pyc b/api/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..261293fda09fb47a2ba1b03b690a807400e04c36 Binary files /dev/null and b/api/__pycache__/__init__.cpython-313.pyc differ diff --git a/api/__pycache__/urls.cpython-312.pyc b/api/__pycache__/urls.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b138d15b09932a3f3068fd1bae744382b35d0b11 Binary files /dev/null and b/api/__pycache__/urls.cpython-312.pyc differ diff --git a/api/__pycache__/urls.cpython-313.pyc b/api/__pycache__/urls.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..585c110f5e6ee44bc90552bee77c1ee6e6b1d126 Binary files /dev/null and b/api/__pycache__/urls.cpython-313.pyc differ diff --git a/api/__pycache__/views.cpython-312.pyc b/api/__pycache__/views.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..50bbc7e10bd226e732b92d92227beff0e52f5e3c Binary files /dev/null and b/api/__pycache__/views.cpython-312.pyc differ diff --git a/api/__pycache__/views.cpython-313.pyc b/api/__pycache__/views.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7c663e2b7046ef93d5cc2ad3713bb59c42927094 Binary files /dev/null and b/api/__pycache__/views.cpython-313.pyc differ diff --git a/api/urls.py b/api/urls.py index b5b8e9d2cbcfc142641d54a2c73916852fc07b60..405182a71299f52b23fc7bd9a3f0021422c32db5 100644 --- a/api/urls.py +++ b/api/urls.py @@ -9,4 +9,6 @@ urlpatterns = [ path('product-category', product_category, name='product_category'), path('coupon-list', CouponListView.as_view(), name='coupon_List'), path('coupon-redeem', CouponRedeemView.as_view(), name='coupon_redeem'), + path('product-list', ProductListView.as_view(), name='product_List'), + path('best-sellers', BestSellersView.as_view(), name='best_sellers'), ] \ No newline at end of file diff --git a/api/views.py b/api/views.py index b5ee0492b94b15dce4990276b82569df8c59f3a6..1665827700f2b5d397207be579e62740a00f173d 100644 --- a/api/views.py +++ b/api/views.py @@ -12,8 +12,9 @@ from io import BytesIO from PIL import Image, ImageDraw from barcode import Code128 -authToken = 'fab57498544244e38bfc2741880f8d61:ed9628295b0642e1b38308795c9cdadd58012df4ceb84a3b9d441c017a1eeac0' - +authToken = '54bef1bd2916433d8f1d821a8822c377:b0be3750efa7486288df03b53076b3c59d710d9f85a34f1a9594d08dda4c4b61' +RevelUrl = "https://101smokeshop.revelup.com" +wooCommerceAuth = "consumer_key=ck_be3c4f80816fa3750154af5c100ad03e450b10b1&consumer_secret=cs_c513ff4e21e426234ca7b2b589c6a88a3749dee2" def create_barcode_from_binary(binary_text, height=100, line_width=2): """ @@ -52,7 +53,7 @@ def create_barcode_from_binary(binary_text, height=100, line_width=2): class HomeView(APIView): def get(self, request): message = "Welcome at home!" - return Response({'message': message}) + return JsonResponse({'message': message}) class BarCodeView(APIView): def get(self, request,code): @@ -73,13 +74,13 @@ class EstablishmentListView(APIView): global authToken def get(self, request): - url = "https://101smokeshop-uat.revelup.com/enterprise/Establishment/?order_by=id&limit=10&offset=0" + url = RevelUrl + "/enterprise/Establishment/?order_by=id&limit=10&offset=0" headers = { 'API-AUTHENTICATION': authToken } response = requests.get(url, headers=headers) data = response.json().get("objects", []) - urlBase = "https://101smokeshop-uat.revelup.com" + urlBase = RevelUrl + "" for i in range(len(data)): try: @@ -96,7 +97,7 @@ class EstablishmentListView(APIView): def resources_forward(request, resource_name,image_id): - url = "https://101smokeshop-uat.revelup.com/resources/"+resource_name+"/"+image_id + url = RevelUrl + "/resources/"+resource_name+"/"+image_id headers = { 'API-AUTHENTICATION': authToken } @@ -107,7 +108,7 @@ def resources_forward(request, resource_name,image_id): def product_category(request): global authToken - url = "https://101smokeshop-uat.revelup.com/products/ProductCategory/" + url = RevelUrl + "/products/ProductCategory/" headers = { 'API-AUTHENTICATION': authToken } @@ -115,6 +116,48 @@ def product_category(request): data = response.json()["objects"] return JsonResponse({"data": data}) +class ProductListView(APIView): + permission_classes = [IsAuthenticated] + def get(self, request): + url = "https://101smokeshop.com/wp-json/wc/v3/products?"+wooCommerceAuth+"&orderby=popularity" + + response = requests.request("GET", url) + try: + data = response.json() + productData = [] + for product in data: + temp={ + "id": product["id"], + "name": product["name"], + "image": product["images"][0]["src"], + "link": product["permalink"] + } + productData.append(temp) + return JsonResponse({"data": productData}) + except json.JSONDecodeError: + print(response.text) + +class BestSellersView(APIView): + permission_classes = [IsAuthenticated] + def get(self, request): + url = "https://101smokeshop.com/wp-json/wc/v3/products?"+wooCommerceAuth+"&orderby=menu_order" + + response = requests.request("GET", url) + try: + data = response.json() + best_sellers = [] + for product in data: + temp={ + "id": product["id"], + "name": product["name"], + "image": product["images"][0]["src"], + "link": product["permalink"], + "price": product["price"] if product["price"] else product["regular_price"] if product["regular_price"] else product["sale_price"] if product["sale_price"] else 0 + } + best_sellers.append(temp) + return JsonResponse({"data": best_sellers}) + except json.JSONDecodeError: + print(response.text) class CouponListView(APIView): permission_classes = [IsAuthenticated] diff --git a/authentication/__pycache__/__init__.cpython-312.pyc b/authentication/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..eed9d8951d19a5c6e78aee7bab3e8ffb0fbaa251 Binary files /dev/null and b/authentication/__pycache__/__init__.cpython-312.pyc differ diff --git a/authentication/__pycache__/__init__.cpython-313.pyc b/authentication/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b884a7b07a64bbec84bcb0203cafbe190e6e3c81 Binary files /dev/null and b/authentication/__pycache__/__init__.cpython-313.pyc differ diff --git a/authentication/__pycache__/admin.cpython-312.pyc b/authentication/__pycache__/admin.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b1713f68a325e36cc7d7c04fde58222ec1b5ef2e Binary files /dev/null and b/authentication/__pycache__/admin.cpython-312.pyc differ diff --git a/authentication/__pycache__/admin.cpython-313.pyc b/authentication/__pycache__/admin.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5bf656ca73880cf66fe6a45f2ed71550bffeef3a Binary files /dev/null and b/authentication/__pycache__/admin.cpython-313.pyc differ diff --git a/authentication/__pycache__/apps.cpython-312.pyc b/authentication/__pycache__/apps.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..30527b66826a679b14eead84f0e26de372fefbef Binary files /dev/null and b/authentication/__pycache__/apps.cpython-312.pyc differ diff --git a/authentication/__pycache__/apps.cpython-313.pyc b/authentication/__pycache__/apps.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fdbbd39acb81221a734ace445a17a971c62e7e29 Binary files /dev/null and b/authentication/__pycache__/apps.cpython-313.pyc differ diff --git a/authentication/__pycache__/models.cpython-312.pyc b/authentication/__pycache__/models.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a46447ae96930374302d8b2ccd87ec2b6e103378 Binary files /dev/null and b/authentication/__pycache__/models.cpython-312.pyc differ diff --git a/authentication/__pycache__/models.cpython-313.pyc b/authentication/__pycache__/models.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..74ccd7b3df28c95efdf16bef3c5cdc51561cf152 Binary files /dev/null and b/authentication/__pycache__/models.cpython-313.pyc differ diff --git a/authentication/__pycache__/urls.cpython-312.pyc b/authentication/__pycache__/urls.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..458d2b7f1566c988e9cbdccb6578efdd0f31cdd9 Binary files /dev/null and b/authentication/__pycache__/urls.cpython-312.pyc differ diff --git a/authentication/__pycache__/urls.cpython-313.pyc b/authentication/__pycache__/urls.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..66bb171004107502f5233ae6a869054e87a27912 Binary files /dev/null and b/authentication/__pycache__/urls.cpython-313.pyc differ diff --git a/authentication/__pycache__/views.cpython-312.pyc b/authentication/__pycache__/views.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4734d3bdcaa27b313d928d79b6c9a102420380e0 Binary files /dev/null and b/authentication/__pycache__/views.cpython-312.pyc differ diff --git a/authentication/__pycache__/views.cpython-313.pyc b/authentication/__pycache__/views.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4b9bc6b595a606cec659c89d6d356abf5757866f Binary files /dev/null and b/authentication/__pycache__/views.cpython-313.pyc differ diff --git a/authentication/migrations/__pycache__/0001_initial.cpython-312.pyc b/authentication/migrations/__pycache__/0001_initial.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0be379365c048dffb43ea7e030667f2ed2aefdb5 Binary files /dev/null and b/authentication/migrations/__pycache__/0001_initial.cpython-312.pyc differ diff --git a/authentication/migrations/__pycache__/0001_initial.cpython-313.pyc b/authentication/migrations/__pycache__/0001_initial.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a8cc0525b19393ce4510814f5b09895fcce1e644 Binary files /dev/null and b/authentication/migrations/__pycache__/0001_initial.cpython-313.pyc differ diff --git a/authentication/migrations/__pycache__/0002_alter_userdata_coupons_alter_userdata_otp.cpython-312.pyc b/authentication/migrations/__pycache__/0002_alter_userdata_coupons_alter_userdata_otp.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..31ec4e906b26a09352f3b46dcb44d0da935b6b7a Binary files /dev/null and b/authentication/migrations/__pycache__/0002_alter_userdata_coupons_alter_userdata_otp.cpython-312.pyc differ diff --git a/authentication/migrations/__pycache__/0002_alter_userdata_coupons_alter_userdata_otp.cpython-313.pyc b/authentication/migrations/__pycache__/0002_alter_userdata_coupons_alter_userdata_otp.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d239f113c63a36702dbdeee34945dc449353a515 Binary files /dev/null and b/authentication/migrations/__pycache__/0002_alter_userdata_coupons_alter_userdata_otp.cpython-313.pyc differ diff --git a/authentication/migrations/__pycache__/0003_alter_coupon_expirydate.cpython-312.pyc b/authentication/migrations/__pycache__/0003_alter_coupon_expirydate.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..efd66706d2d10a6b18882cdbae41ed5e91e45e0d Binary files /dev/null and b/authentication/migrations/__pycache__/0003_alter_coupon_expirydate.cpython-312.pyc differ diff --git a/authentication/migrations/__pycache__/0003_alter_coupon_expirydate.cpython-313.pyc b/authentication/migrations/__pycache__/0003_alter_coupon_expirydate.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7df15fc353d238f114ba2cfaa978f0929b41e62a Binary files /dev/null and b/authentication/migrations/__pycache__/0003_alter_coupon_expirydate.cpython-313.pyc differ diff --git a/authentication/migrations/__pycache__/0004_coupon_discription.cpython-312.pyc b/authentication/migrations/__pycache__/0004_coupon_discription.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..66702d6141e1718105496afe0cf8ef6ac8b8085f Binary files /dev/null and b/authentication/migrations/__pycache__/0004_coupon_discription.cpython-312.pyc differ diff --git a/authentication/migrations/__pycache__/0004_coupon_discription.cpython-313.pyc b/authentication/migrations/__pycache__/0004_coupon_discription.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9046bc8fca2056837b93cf7fc7a8bb284abbad33 Binary files /dev/null and b/authentication/migrations/__pycache__/0004_coupon_discription.cpython-313.pyc differ diff --git a/authentication/migrations/__pycache__/0005_userdata_refcode.cpython-312.pyc b/authentication/migrations/__pycache__/0005_userdata_refcode.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4643788a008f89a16791a69d4b1221d933316880 Binary files /dev/null and b/authentication/migrations/__pycache__/0005_userdata_refcode.cpython-312.pyc differ diff --git a/authentication/migrations/__pycache__/0005_userdata_refcode.cpython-313.pyc b/authentication/migrations/__pycache__/0005_userdata_refcode.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c0652eec71128e65c507764efac03b10e060caa6 Binary files /dev/null and b/authentication/migrations/__pycache__/0005_userdata_refcode.cpython-313.pyc differ diff --git a/authentication/migrations/__pycache__/0006_userdata_activatedcoupons.cpython-312.pyc b/authentication/migrations/__pycache__/0006_userdata_activatedcoupons.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2a9463af6d818a01f9ae24a645757166014cc293 Binary files /dev/null and b/authentication/migrations/__pycache__/0006_userdata_activatedcoupons.cpython-312.pyc differ diff --git a/authentication/migrations/__pycache__/0006_userdata_activatedcoupons.cpython-313.pyc b/authentication/migrations/__pycache__/0006_userdata_activatedcoupons.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3aa460e78eeb07293933b3bc091c4fe4d550164b Binary files /dev/null and b/authentication/migrations/__pycache__/0006_userdata_activatedcoupons.cpython-313.pyc differ diff --git a/authentication/migrations/__pycache__/0007_userdata_revelid.cpython-312.pyc b/authentication/migrations/__pycache__/0007_userdata_revelid.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..214d5cd26bbaf4816cabc19469123d236722a4c8 Binary files /dev/null and b/authentication/migrations/__pycache__/0007_userdata_revelid.cpython-312.pyc differ diff --git a/authentication/migrations/__pycache__/0007_userdata_revelid.cpython-313.pyc b/authentication/migrations/__pycache__/0007_userdata_revelid.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9a1626ebf4bd6fac25c1ecedb7a360758301211f Binary files /dev/null and b/authentication/migrations/__pycache__/0007_userdata_revelid.cpython-313.pyc differ diff --git a/authentication/migrations/__pycache__/0008_alter_userdata_pincode.cpython-312.pyc b/authentication/migrations/__pycache__/0008_alter_userdata_pincode.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d0b39f40af586590fdef923431d30f6ce140486e Binary files /dev/null and b/authentication/migrations/__pycache__/0008_alter_userdata_pincode.cpython-312.pyc differ diff --git a/authentication/migrations/__pycache__/0008_alter_userdata_pincode.cpython-313.pyc b/authentication/migrations/__pycache__/0008_alter_userdata_pincode.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e353eb7a22eb99a0c0235536f44d5ed71b76bb5f Binary files /dev/null and b/authentication/migrations/__pycache__/0008_alter_userdata_pincode.cpython-313.pyc differ diff --git a/authentication/migrations/__pycache__/__init__.cpython-312.pyc b/authentication/migrations/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3913cf6164feddc476d9738b8af9982524ce1f85 Binary files /dev/null and b/authentication/migrations/__pycache__/__init__.cpython-312.pyc differ diff --git a/authentication/migrations/__pycache__/__init__.cpython-313.pyc b/authentication/migrations/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bda10a68c27e876c67dba6a3b9e4ab04a9f781b0 Binary files /dev/null and b/authentication/migrations/__pycache__/__init__.cpython-313.pyc differ diff --git a/oneOone/__pycache__/__init__.cpython-312.pyc b/oneOone/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..16244ae376e872bafa42f2e9bbc7747e6d754219 Binary files /dev/null and b/oneOone/__pycache__/__init__.cpython-312.pyc differ diff --git a/oneOone/__pycache__/__init__.cpython-313.pyc b/oneOone/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..88812cfc1ac7cc023d9d243720e1f2be79ccb056 Binary files /dev/null and b/oneOone/__pycache__/__init__.cpython-313.pyc differ diff --git a/oneOone/__pycache__/settings.cpython-312.pyc b/oneOone/__pycache__/settings.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f30367888c226d9c82daff7a76c06b2fc7c1df33 Binary files /dev/null and b/oneOone/__pycache__/settings.cpython-312.pyc differ diff --git a/oneOone/__pycache__/settings.cpython-313.pyc b/oneOone/__pycache__/settings.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d780d99d2e0beeadfd8db57ce44305857c6388ca Binary files /dev/null and b/oneOone/__pycache__/settings.cpython-313.pyc differ diff --git a/oneOone/__pycache__/urls.cpython-312.pyc b/oneOone/__pycache__/urls.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..70a7a2f0d4dec42cef642f97abbd96efbe65ec49 Binary files /dev/null and b/oneOone/__pycache__/urls.cpython-312.pyc differ diff --git a/oneOone/__pycache__/urls.cpython-313.pyc b/oneOone/__pycache__/urls.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2712ca5c43014408ac495530dca0d3aa17529023 Binary files /dev/null and b/oneOone/__pycache__/urls.cpython-313.pyc differ diff --git a/oneOone/__pycache__/wsgi.cpython-312.pyc b/oneOone/__pycache__/wsgi.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fa26b4ce4024c7b0d6f12a95a0f6385afd7f3489 Binary files /dev/null and b/oneOone/__pycache__/wsgi.cpython-312.pyc differ diff --git a/oneOone/__pycache__/wsgi.cpython-313.pyc b/oneOone/__pycache__/wsgi.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..223fb1ddd168370e8720e187bf470678f64a09eb Binary files /dev/null and b/oneOone/__pycache__/wsgi.cpython-313.pyc differ diff --git a/oneOone/settings.py b/oneOone/settings.py index 684930939c4a39714f2b49c523cc9d4e0f0d0a97..82a24c69cd544087833c36f3b1ce9184322e6ee2 100644 --- a/oneOone/settings.py +++ b/oneOone/settings.py @@ -26,42 +26,13 @@ SECRET_KEY = "django-insecure-8&2s2s)--3hof($4+pkt0@$l1tz8so+$t=%yq9y0on=s$2_^$p # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True -ALLOWED_HOSTS = ["*", "127.0.0.1", "192.168.81.1", "192.168.12.61", "thejagstudio-101.hf.space"] -CORS_ALLOWED_ORIGINS = [ - "http://localhost:8081", - "http://localhost:19006", - "http://192.168.81.1:8000", - "http://192.168.12.61:8000", - "https://s4t6xdgk-8000.inc1.devtunnels.ms", - "http://thejagstudio-101.hf.space", - "https://thejagstudio-101.hf.space" -] -CSRF_TRUSTED_ORIGINS = [ - "http://localhost:8081", - "http://192.168.81.1:8000", - "http://192.168.12.61:8000", - "http://localhost:19006", - "https://s4t6xdgk-8000.inc1.devtunnels.ms", - "http://thejagstudio-101.hf.space", - "https://thejagstudio-101.hf.space" -] +ALLOWED_HOSTS = ["*", "127.0.0.1", "192.168.81.1", "192.168.12.61", "thejagstudio-101.hf.space", "10.0.0.227"] +CORS_ALLOWED_ORIGINS = ["http://localhost:8081", "http://localhost:19006", "http://192.168.81.1:8000", "http://10.0.0.227:8000", "http://192.168.12.61:8000", "https://s4t6xdgk-8000.inc1.devtunnels.ms", "http://thejagstudio-101.hf.space", "https://thejagstudio-101.hf.space"] +CSRF_TRUSTED_ORIGINS = ["http://localhost:8081", "http://192.168.81.1:8000", "http://192.168.12.61:8000", "http://10.0.0.227:8000", "http://localhost:19006", "https://s4t6xdgk-8000.inc1.devtunnels.ms", "http://thejagstudio-101.hf.space", "https://thejagstudio-101.hf.space"] # Application definition -INSTALLED_APPS = [ - "django.contrib.admin", - "django.contrib.auth", - "django.contrib.contenttypes", - "django.contrib.sessions", - "django.contrib.messages", - "django.contrib.staticfiles", - "rest_framework", - "rest_framework_simplejwt", - "rest_framework_simplejwt.token_blacklist", - "import_export", - "corsheaders", - "authentication" -] +INSTALLED_APPS = ["django.contrib.admin", "django.contrib.auth", "django.contrib.contenttypes", "django.contrib.sessions", "django.contrib.messages", "django.contrib.staticfiles", "rest_framework", "rest_framework_simplejwt", "rest_framework_simplejwt.token_blacklist", "import_export", "corsheaders", "authentication", "wordpress_api"] MIDDLEWARE = [ "django.middleware.security.SecurityMiddleware", @@ -99,15 +70,27 @@ WSGI_APPLICATION = "oneOone.wsgi.application" # https://docs.djangoproject.com/en/4.2/ref/settings/#databases DATABASES = { - 'default': { - 'ENGINE': 'django.db.backends.postgresql', - 'NAME': 'postgres', - 'USER': 'postgres.igsosentooipcjyflmnw', - 'PORT': 6543, - 'PASSWORD': 'bfHBTQr6xCAwdbts', - 'HOST': 'aws-0-us-east-1.pooler.supabase.com', - } + "default": { + "ENGINE": "django.db.backends.postgresql", + "NAME": "postgres", + "USER": "postgres.igsosentooipcjyflmnw", + "PORT": 6543, + "PASSWORD": "bfHBTQr6xCAwdbts", + "HOST": "aws-0-us-east-1.pooler.supabase.com", + "OPTIONS": { + "gssencmode": "disable", + }, + }, + "woocommerce": { + "ENGINE": "django.db.backends.mysql", + "NAME": "hvyakryx_wp944", + "USER": "hvyakryx_appBestBeauty", + "PASSWORD": "C-H8_VD~jG9a", + "HOST": "216.137.176.112", + "PORT": "3306", + }, } +DATABASE_ROUTERS = ["routers.db_routers.AuthRouter", "routers.db_routers.WoocommerceRouter"] # "default": { # "ENGINE": "django.db.backends.sqlite3", # "NAME": BASE_DIR / "db.sqlite3", @@ -156,21 +139,17 @@ STATIC_URL = "static/" DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField" REST_FRAMEWORK = { - 'DEFAULT_AUTHENTICATION_CLASSES': ( - 'rest_framework_simplejwt.authentication.JWTAuthentication', - ), - 'DEFAULT_PERMISSION_CLASSES': ( - 'rest_framework.permissions.AllowAny', - ), + "DEFAULT_AUTHENTICATION_CLASSES": ("rest_framework_simplejwt.authentication.JWTAuthentication",), + "DEFAULT_PERMISSION_CLASSES": ("rest_framework.permissions.AllowAny",), } SIMPLE_JWT = { - 'ACCESS_TOKEN_LIFETIME': timedelta(minutes=720), - 'REFRESH_TOKEN_LIFETIME': timedelta(days=60), - 'ROTATE_REFRESH_TOKENS': True, - 'BLACKLIST_AFTER_ROTATION': True, - 'UPDATE_LAST_LOGIN': True, + "ACCESS_TOKEN_LIFETIME": timedelta(days=60), + "REFRESH_TOKEN_LIFETIME": timedelta(days=60), + "ROTATE_REFRESH_TOKENS": True, + "BLACKLIST_AFTER_ROTATION": True, + "UPDATE_LAST_LOGIN": True, } -EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' +EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend" diff --git a/oneOone/urls.py b/oneOone/urls.py index 51cb881f76f92847f7fdf1437e45cb6cb43da989..38834f68f31b0c5daf3241f515a84c36d149d42c 100644 --- a/oneOone/urls.py +++ b/oneOone/urls.py @@ -8,4 +8,5 @@ urlpatterns = [ path('api-auth/', include('rest_framework.urls')), path('api/auth/', include('authentication.urls')), path('api/', include('api.urls')), + path('api/wordpress/', include('wordpress_api.urls')), ] diff --git a/routers/__pycache__/db_routers.cpython-312.pyc b/routers/__pycache__/db_routers.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6e14b3ace6312132eb0a21b4fc9cb83e90977b72 Binary files /dev/null and b/routers/__pycache__/db_routers.cpython-312.pyc differ diff --git a/routers/db_routers.py b/routers/db_routers.py new file mode 100644 index 0000000000000000000000000000000000000000..572337c2446f5933043a77e6ffa11f96aae72e35 --- /dev/null +++ b/routers/db_routers.py @@ -0,0 +1,33 @@ +class AuthRouter: + route_app_labels = {'auth', 'contenttypes', 'sessions', 'admin'} + + def db_for_read(self, model, **hints): + if model._meta.app_label in self.route_app_labels: + return 'default' + return None + + def db_for_write(self, model, **hints): + if model._meta.app_label in self.route_app_labels: + return 'default' + return None + + def allow_relation(self, obj1, obj2, **hints): + if ( + obj1._meta.app_label in self.route_app_labels or + obj2._meta.app_label in self.route_app_labels + ): + return True + return None + + def allow_migrate(self, db, app_label, model_name=None, **hints): + if app_label in self.route_app_labels: + return db == 'default' + return None + +class WoocommerceRouter: + route_app_labels = {'woocommerce'} + + def db_for_read(self, model, **hints): + if model._meta.app_label in self.route_app_labels: + return 'woocommerce' + return None \ No newline at end of file diff --git a/wordpress_api/__init__.py b/wordpress_api/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/wordpress_api/__pycache__/__init__.cpython-312.pyc b/wordpress_api/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bdee594fd49177c070e739fc2b68c35726081cec Binary files /dev/null and b/wordpress_api/__pycache__/__init__.cpython-312.pyc differ diff --git a/wordpress_api/__pycache__/admin.cpython-312.pyc b/wordpress_api/__pycache__/admin.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..537764a33284b890d793928c470b09ce4edd731c Binary files /dev/null and b/wordpress_api/__pycache__/admin.cpython-312.pyc differ diff --git a/wordpress_api/__pycache__/apps.cpython-312.pyc b/wordpress_api/__pycache__/apps.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6b30cefa06e4c1cd9942b80bcbdc2747aa19b71c Binary files /dev/null and b/wordpress_api/__pycache__/apps.cpython-312.pyc differ diff --git a/wordpress_api/__pycache__/models.cpython-312.pyc b/wordpress_api/__pycache__/models.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c693dcd3559e9b5f9f5e889ad14c157997934769 Binary files /dev/null and b/wordpress_api/__pycache__/models.cpython-312.pyc differ diff --git a/wordpress_api/__pycache__/serializers.cpython-312.pyc b/wordpress_api/__pycache__/serializers.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7102ef34449630ec203691cac26f28d747e199a4 Binary files /dev/null and b/wordpress_api/__pycache__/serializers.cpython-312.pyc differ diff --git a/wordpress_api/__pycache__/urls.cpython-312.pyc b/wordpress_api/__pycache__/urls.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7dbe3ec96dbdef9cd117cb98ca5f193184e3d608 Binary files /dev/null and b/wordpress_api/__pycache__/urls.cpython-312.pyc differ diff --git a/wordpress_api/__pycache__/views.cpython-312.pyc b/wordpress_api/__pycache__/views.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9d04500c4afa858ddaba070df2aeedf0a4324167 Binary files /dev/null and b/wordpress_api/__pycache__/views.cpython-312.pyc differ diff --git a/wordpress_api/admin.py b/wordpress_api/admin.py new file mode 100644 index 0000000000000000000000000000000000000000..8a93520809d2d9f696dba5f0c95fec5032255eca --- /dev/null +++ b/wordpress_api/admin.py @@ -0,0 +1,98 @@ +# from import_export.admin import ImportExportModelAdmin +# from django.contrib import admin +# from .models import * + +# def get_char_and_int_fields(model): +# return [ +# f.name for f in model._meta.fields +# if isinstance(f, (models.CharField, models.IntegerField, models.BigIntegerField, models.SmallIntegerField)) +# ] + +# def get_all_fields(model): +# return [f.name for f in model._meta.fields] + +# # Dynamically create admin classes for all models +# for model in [ +# Wp1DActionschedulerActions, +# Wp1DActionschedulerClaims, +# Wp1DActionschedulerGroups, +# Wp1DActionschedulerLogs, +# Wp1DCommentmeta, +# Wp1DComments, +# Wp1DFsmptEmailLogs, +# Wp1DKbpCountdownEntry, +# Wp1DKbpFormEntry, +# Wp1DKbpFormEntrymeta, +# Wp1DKbpFormEvents, +# Wp1DKbpQueryIndex, +# Wp1DLinks, +# Wp1DOptions, +# Wp1DPostmeta, +# Wp1DPosts, +# Wp1DSnippets, +# Wp1DSocialUsers, +# Wp1DTermRelationships, +# Wp1DTermTaxonomy, +# Wp1DTermmeta, +# Wp1DTerms, +# Wp1DUrAbandonedData, +# Wp1DUrAbandonedMeta, +# Wp1DUrUserPostVisits, +# Wp1DUserRegistrationSessions, +# Wp1DUsermeta, +# Wp1DUsers, +# Wp1DWcAdminNoteActions, +# Wp1DWcAdminNotes, +# Wp1DWcCategoryLookup, +# Wp1DWcCustomerLookup, +# Wp1DWcDownloadLog, +# Wp1DWcOrderAddresses, +# Wp1DWcOrderCouponLookup, +# Wp1DWcOrderOperationalData, +# Wp1DWcOrderProductLookup, +# Wp1DWcOrderStats, +# Wp1DWcOrderTaxLookup, +# Wp1DWcOrders, +# Wp1DWcOrdersMeta, +# Wp1DWcProductAttributesLookup, +# Wp1DWcProductDownloadDirectories, +# Wp1DWcProductMetaLookup, +# Wp1DWcRateLimits, +# Wp1DWcReservedStock, +# Wp1DWcTaxRateClasses, +# Wp1DWcWebhooks, +# Wp1DWoocommerceApiKeys, +# Wp1DWoocommerceAttributeTaxonomies, +# Wp1DWoocommerceDownloadableProductPermissions, +# Wp1DWoocommerceLog, +# Wp1DWoocommerceOrderItemmeta, +# Wp1DWoocommerceOrderItems, +# Wp1DWoocommercePaymentTokenmeta, +# Wp1DWoocommercePaymentTokens, +# Wp1DWoocommerceSessions, +# Wp1DWoocommerceShippingZoneLocations, +# Wp1DWoocommerceShippingZoneMethods, +# Wp1DWoocommerceShippingZones, +# Wp1DWoocommerceTaxRateLocations, +# Wp1DWoocommerceTaxRates, +# Wp1DWpcbFolders, +# Wp1DWpcbSnippets, +# Wp1DWpsmtpLogs, +# Wp1DWpvividOptions, +# Wp1DWpvividScanResult, +# Wp1DWpvividUnusedUploadsFiles, +# Wp1DYoastIndexable, +# Wp1DYoastIndexableHierarchy, +# Wp1DYoastMigrations, +# Wp1DYoastPrimaryTerm, +# Wp1DYoastSeoLinks, +# ]: +# admin_class = type( +# f"{model.__name__}Admin", +# (ImportExportModelAdmin,), +# { +# "list_display": get_all_fields(model), +# "search_fields": get_char_and_int_fields(model), +# } +# ) +# admin.site.register(model, admin_class) \ No newline at end of file diff --git a/wordpress_api/apps.py b/wordpress_api/apps.py new file mode 100644 index 0000000000000000000000000000000000000000..88f62ddd669fd424dad5261852136aa88c1d5905 --- /dev/null +++ b/wordpress_api/apps.py @@ -0,0 +1,6 @@ +from django.apps import AppConfig + + +class WordpressApiConfig(AppConfig): + default_auto_field = "django.db.models.BigAutoField" + name = "wordpress_api" diff --git a/wordpress_api/migrations/0001_initial.py b/wordpress_api/migrations/0001_initial.py new file mode 100644 index 0000000000000000000000000000000000000000..5c986406bcb1796d68079a797bdc568ab033a7d3 --- /dev/null +++ b/wordpress_api/migrations/0001_initial.py @@ -0,0 +1,1629 @@ +# Generated by Django 5.2.2 on 2025-06-05 16:20 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [] + + operations = [ + migrations.CreateModel( + name="Wp1DActionschedulerActions", + fields=[ + ("action_id", models.BigAutoField(primary_key=True, serialize=False)), + ("hook", models.CharField(max_length=191)), + ("status", models.CharField(max_length=20)), + ("scheduled_date_gmt", models.DateTimeField(blank=True, null=True)), + ("scheduled_date_local", models.DateTimeField(blank=True, null=True)), + ("priority", models.PositiveIntegerField()), + ("args", models.CharField(blank=True, max_length=191, null=True)), + ("schedule", models.TextField(blank=True, null=True)), + ("group_id", models.PositiveBigIntegerField()), + ("attempts", models.IntegerField()), + ("last_attempt_gmt", models.DateTimeField(blank=True, null=True)), + ("last_attempt_local", models.DateTimeField(blank=True, null=True)), + ("claim_id", models.PositiveBigIntegerField()), + ( + "extended_args", + models.CharField(blank=True, max_length=8000, null=True), + ), + ], + options={ + "db_table": "wp1d_actionscheduler_actions", + "managed": False, + }, + ), + migrations.CreateModel( + name="Wp1DActionschedulerClaims", + fields=[ + ("claim_id", models.BigAutoField(primary_key=True, serialize=False)), + ("date_created_gmt", models.DateTimeField(blank=True, null=True)), + ], + options={ + "db_table": "wp1d_actionscheduler_claims", + "managed": False, + }, + ), + migrations.CreateModel( + name="Wp1DActionschedulerGroups", + fields=[ + ("group_id", models.BigAutoField(primary_key=True, serialize=False)), + ("slug", models.CharField(max_length=255)), + ], + options={ + "db_table": "wp1d_actionscheduler_groups", + "managed": False, + }, + ), + migrations.CreateModel( + name="Wp1DActionschedulerLogs", + fields=[ + ("log_id", models.BigAutoField(primary_key=True, serialize=False)), + ("action_id", models.PositiveBigIntegerField()), + ("message", models.TextField()), + ("log_date_gmt", models.DateTimeField(blank=True, null=True)), + ("log_date_local", models.DateTimeField(blank=True, null=True)), + ], + options={ + "db_table": "wp1d_actionscheduler_logs", + "managed": False, + }, + ), + migrations.CreateModel( + name="Wp1DCommentmeta", + fields=[ + ("meta_id", models.BigAutoField(primary_key=True, serialize=False)), + ("comment_id", models.PositiveBigIntegerField()), + ("meta_key", models.CharField(blank=True, max_length=255, null=True)), + ("meta_value", models.TextField(blank=True, null=True)), + ], + options={ + "db_table": "wp1d_commentmeta", + "managed": False, + }, + ), + migrations.CreateModel( + name="Wp1DComments", + fields=[ + ( + "comment_id", + models.BigAutoField( + db_column="comment_ID", primary_key=True, serialize=False + ), + ), + ( + "comment_post_id", + models.PositiveBigIntegerField(db_column="comment_post_ID"), + ), + ("comment_author", models.TextField()), + ("comment_author_email", models.CharField(max_length=100)), + ("comment_author_url", models.CharField(max_length=200)), + ( + "comment_author_ip", + models.CharField(db_column="comment_author_IP", max_length=100), + ), + ("comment_date", models.DateTimeField()), + ("comment_date_gmt", models.DateTimeField()), + ("comment_content", models.TextField()), + ("comment_karma", models.IntegerField()), + ("comment_approved", models.CharField(max_length=20)), + ("comment_agent", models.CharField(max_length=255)), + ("comment_type", models.CharField(max_length=20)), + ("comment_parent", models.PositiveBigIntegerField()), + ("user_id", models.PositiveBigIntegerField()), + ], + options={ + "db_table": "wp1d_comments", + "managed": False, + }, + ), + migrations.CreateModel( + name="Wp1DFsmptEmailLogs", + fields=[ + ( + "id", + models.BigAutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("site_id", models.PositiveIntegerField(blank=True, null=True)), + ("to", models.CharField(blank=True, max_length=255, null=True)), + ( + "from_field", + models.CharField( + blank=True, db_column="from", max_length=255, null=True + ), + ), + ("subject", models.CharField(blank=True, max_length=255, null=True)), + ("body", models.TextField(blank=True, null=True)), + ("headers", models.TextField(blank=True, null=True)), + ("attachments", models.TextField(blank=True, null=True)), + ("status", models.CharField(blank=True, max_length=20, null=True)), + ("response", models.TextField(blank=True, null=True)), + ("extra", models.TextField(blank=True, null=True)), + ("retries", models.PositiveIntegerField(blank=True, null=True)), + ("resent_count", models.PositiveIntegerField(blank=True, null=True)), + ("source", models.CharField(blank=True, max_length=255, null=True)), + ("created_at", models.DateTimeField(blank=True, null=True)), + ("updated_at", models.DateTimeField(blank=True, null=True)), + ], + options={ + "db_table": "wp1d_fsmpt_email_logs", + "managed": False, + }, + ), + migrations.CreateModel( + name="Wp1DKbpCountdownEntry", + fields=[ + ("id", models.BigAutoField(primary_key=True, serialize=False)), + ("campaign", models.CharField(blank=True, max_length=255, null=True)), + ("end_date", models.CharField(blank=True, max_length=255, null=True)), + ( + "remove_date", + models.CharField(blank=True, max_length=255, null=True), + ), + ("user_id", models.PositiveBigIntegerField()), + ("user_ip", models.CharField(max_length=50)), + ("uuid", models.CharField(max_length=100)), + ], + options={ + "db_table": "wp1d_kbp_countdown_entry", + "managed": False, + }, + ), + migrations.CreateModel( + name="Wp1DKbpFormEntry", + fields=[ + ("id", models.BigAutoField(primary_key=True, serialize=False)), + ("name", models.CharField(blank=True, max_length=255, null=True)), + ("form_id", models.CharField(blank=True, max_length=55, null=True)), + ("post_id", models.PositiveBigIntegerField()), + ("user_id", models.PositiveBigIntegerField()), + ("date_created", models.DateTimeField()), + ("user_ip", models.CharField(max_length=100)), + ("user_device", models.CharField(blank=True, max_length=55, null=True)), + ("referer", models.CharField(blank=True, max_length=255, null=True)), + ("status", models.CharField(blank=True, max_length=10, null=True)), + ("uuid", models.CharField(max_length=100)), + ], + options={ + "db_table": "wp1d_kbp_form_entry", + "managed": False, + }, + ), + migrations.CreateModel( + name="Wp1DKbpFormEntrymeta", + fields=[ + ("meta_id", models.BigAutoField(primary_key=True, serialize=False)), + ("kbp_form_entry_id", models.PositiveBigIntegerField()), + ("meta_key", models.CharField(blank=True, max_length=255, null=True)), + ("meta_value", models.TextField(blank=True, null=True)), + ], + options={ + "db_table": "wp1d_kbp_form_entrymeta", + "managed": False, + }, + ), + migrations.CreateModel( + name="Wp1DKbpFormEvents", + fields=[ + ("id", models.BigAutoField(primary_key=True, serialize=False)), + ("event_type", models.CharField(max_length=128)), + ("event_post", models.IntegerField()), + ("event_time", models.DateTimeField()), + ("event_count", models.PositiveIntegerField()), + ("event_consolidated", models.IntegerField()), + ], + options={ + "db_table": "wp1d_kbp_form_events", + "managed": False, + }, + ), + migrations.CreateModel( + name="Wp1DKbpQueryIndex", + fields=[ + ("id", models.BigAutoField(primary_key=True, serialize=False)), + ("object_id", models.PositiveIntegerField(blank=True, null=True)), + ("hash", models.CharField(blank=True, max_length=50, null=True)), + ( + "facet_value", + models.CharField(blank=True, max_length=191, null=True), + ), + ("facet_name", models.CharField(blank=True, max_length=191, null=True)), + ("facet_id", models.PositiveIntegerField(blank=True, null=True)), + ("facet_parent", models.PositiveIntegerField(blank=True, null=True)), + ("facet_order", models.PositiveIntegerField(blank=True, null=True)), + ], + options={ + "db_table": "wp1d_kbp_query_index", + "managed": False, + }, + ), + migrations.CreateModel( + name="Wp1DLinks", + fields=[ + ("link_id", models.BigAutoField(primary_key=True, serialize=False)), + ("link_url", models.CharField(max_length=255)), + ("link_name", models.CharField(max_length=255)), + ("link_image", models.CharField(max_length=255)), + ("link_target", models.CharField(max_length=25)), + ("link_description", models.CharField(max_length=255)), + ("link_visible", models.CharField(max_length=20)), + ("link_owner", models.PositiveBigIntegerField()), + ("link_rating", models.IntegerField()), + ("link_updated", models.DateTimeField()), + ("link_rel", models.CharField(max_length=255)), + ("link_notes", models.TextField()), + ("link_rss", models.CharField(max_length=255)), + ], + options={ + "db_table": "wp1d_links", + "managed": False, + }, + ), + migrations.CreateModel( + name="Wp1DOptions", + fields=[ + ("option_id", models.BigAutoField(primary_key=True, serialize=False)), + ("option_name", models.CharField(max_length=191, unique=True)), + ("option_value", models.TextField()), + ("autoload", models.CharField(max_length=20)), + ], + options={ + "db_table": "wp1d_options", + "managed": False, + }, + ), + migrations.CreateModel( + name="Wp1DPostmeta", + fields=[ + ("meta_id", models.BigAutoField(primary_key=True, serialize=False)), + ("post_id", models.PositiveBigIntegerField()), + ("meta_key", models.CharField(blank=True, max_length=255, null=True)), + ("meta_value", models.TextField(blank=True, null=True)), + ], + options={ + "db_table": "wp1d_postmeta", + "managed": False, + }, + ), + migrations.CreateModel( + name="Wp1DPosts", + fields=[ + ( + "id", + models.BigAutoField( + db_column="ID", primary_key=True, serialize=False + ), + ), + ("post_author", models.PositiveBigIntegerField()), + ("post_date", models.DateTimeField()), + ("post_date_gmt", models.DateTimeField()), + ("post_content", models.TextField()), + ("post_title", models.TextField()), + ("post_excerpt", models.TextField()), + ("post_status", models.CharField(max_length=20)), + ("comment_status", models.CharField(max_length=20)), + ("ping_status", models.CharField(max_length=20)), + ("post_password", models.CharField(max_length=255)), + ("post_name", models.CharField(max_length=200)), + ("to_ping", models.TextField()), + ("pinged", models.TextField()), + ("post_modified", models.DateTimeField()), + ("post_modified_gmt", models.DateTimeField()), + ("post_content_filtered", models.TextField()), + ("post_parent", models.PositiveBigIntegerField()), + ("guid", models.CharField(max_length=255)), + ("menu_order", models.IntegerField()), + ("post_type", models.CharField(max_length=20)), + ("post_mime_type", models.CharField(max_length=100)), + ("comment_count", models.BigIntegerField()), + ], + options={ + "db_table": "wp1d_posts", + "managed": False, + }, + ), + migrations.CreateModel( + name="Wp1DSnippets", + fields=[ + ("id", models.BigAutoField(primary_key=True, serialize=False)), + ("name", models.TextField()), + ("description", models.TextField()), + ("code", models.TextField()), + ("tags", models.TextField()), + ("scope", models.CharField(max_length=15)), + ("priority", models.SmallIntegerField()), + ("active", models.IntegerField()), + ("modified", models.DateTimeField()), + ("revision", models.BigIntegerField()), + ("cloud_id", models.CharField(blank=True, max_length=255, null=True)), + ], + options={ + "db_table": "wp1d_snippets", + "managed": False, + }, + ), + migrations.CreateModel( + name="Wp1DSocialUsers", + fields=[ + ( + "social_users_id", + models.AutoField(primary_key=True, serialize=False), + ), + ("id", models.IntegerField(db_column="ID")), + ("type", models.CharField(max_length=20)), + ("identifier", models.CharField(max_length=100)), + ("register_date", models.DateTimeField(blank=True, null=True)), + ("login_date", models.DateTimeField(blank=True, null=True)), + ("link_date", models.DateTimeField(blank=True, null=True)), + ], + options={ + "db_table": "wp1d_social_users", + "managed": False, + }, + ), + migrations.CreateModel( + name="Wp1DTermmeta", + fields=[ + ("meta_id", models.BigAutoField(primary_key=True, serialize=False)), + ("term_id", models.PositiveBigIntegerField()), + ("meta_key", models.CharField(blank=True, max_length=255, null=True)), + ("meta_value", models.TextField(blank=True, null=True)), + ], + options={ + "db_table": "wp1d_termmeta", + "managed": False, + }, + ), + migrations.CreateModel( + name="Wp1DTermRelationships", + fields=[ + ( + "pk", + models.CompositePrimaryKey( + "object_id", + "term_taxonomy_id", + blank=True, + editable=False, + primary_key=True, + serialize=False, + ), + ), + ("object_id", models.PositiveBigIntegerField()), + ("term_taxonomy_id", models.PositiveBigIntegerField()), + ("term_order", models.IntegerField()), + ], + options={ + "db_table": "wp1d_term_relationships", + "managed": False, + }, + ), + migrations.CreateModel( + name="Wp1DTerms", + fields=[ + ("term_id", models.BigAutoField(primary_key=True, serialize=False)), + ("name", models.CharField(max_length=200)), + ("slug", models.CharField(max_length=200)), + ("term_group", models.BigIntegerField()), + ], + options={ + "db_table": "wp1d_terms", + "managed": False, + }, + ), + migrations.CreateModel( + name="Wp1DTermTaxonomy", + fields=[ + ( + "term_taxonomy_id", + models.BigAutoField(primary_key=True, serialize=False), + ), + ("term_id", models.PositiveBigIntegerField()), + ("taxonomy", models.CharField(max_length=32)), + ("description", models.TextField()), + ("parent", models.PositiveBigIntegerField()), + ("count", models.BigIntegerField()), + ], + options={ + "db_table": "wp1d_term_taxonomy", + "managed": False, + }, + ), + migrations.CreateModel( + name="Wp1DUrAbandonedData", + fields=[ + ("id", models.BigAutoField(primary_key=True, serialize=False)), + ("form_id", models.IntegerField(blank=True, null=True)), + ("referer", models.CharField(blank=True, max_length=255, null=True)), + ("user_id", models.BigIntegerField(blank=True, null=True)), + ("fields", models.TextField(blank=True, null=True)), + ("status", models.CharField(blank=True, max_length=20, null=True)), + ("created_at", models.DateTimeField(blank=True, null=True)), + ], + options={ + "db_table": "wp1d_ur_abandoned_data", + "managed": False, + }, + ), + migrations.CreateModel( + name="Wp1DUrAbandonedMeta", + fields=[ + ("meta_id", models.BigAutoField(primary_key=True, serialize=False)), + ("abandon_id", models.CharField(max_length=255)), + ("meta_key", models.CharField(blank=True, max_length=255, null=True)), + ("meta_value", models.TextField(blank=True, null=True)), + ], + options={ + "db_table": "wp1d_ur_abandoned_meta", + "managed": False, + }, + ), + migrations.CreateModel( + name="Wp1DUrUserPostVisits", + fields=[ + ("id", models.BigAutoField(primary_key=True, serialize=False)), + ("session_id", models.CharField(max_length=255)), + ("page_url", models.CharField(max_length=255)), + ("referer_url", models.CharField(max_length=255)), + ("duration", models.IntegerField(blank=True, null=True)), + ("user_id", models.BigIntegerField(blank=True, null=True)), + ("form_id", models.IntegerField(blank=True, null=True)), + ("form_abandoned", models.IntegerField(blank=True, null=True)), + ("form_submitted", models.IntegerField(blank=True, null=True)), + ("created_at", models.DateTimeField(blank=True, null=True)), + ], + options={ + "db_table": "wp1d_ur_user_post_visits", + "managed": False, + }, + ), + migrations.CreateModel( + name="Wp1DUsermeta", + fields=[ + ("umeta_id", models.BigAutoField(primary_key=True, serialize=False)), + ("user_id", models.PositiveBigIntegerField()), + ("meta_key", models.CharField(blank=True, max_length=255, null=True)), + ("meta_value", models.TextField(blank=True, null=True)), + ], + options={ + "db_table": "wp1d_usermeta", + "managed": False, + }, + ), + migrations.CreateModel( + name="Wp1DUserRegistrationSessions", + fields=[ + ("session_id", models.BigAutoField(primary_key=True, serialize=False)), + ("session_key", models.CharField(max_length=32)), + ("session_value", models.TextField()), + ("session_expiry", models.PositiveBigIntegerField()), + ], + options={ + "db_table": "wp1d_user_registration_sessions", + "managed": False, + }, + ), + migrations.CreateModel( + name="Wp1DUsers", + fields=[ + ( + "id", + models.BigAutoField( + db_column="ID", primary_key=True, serialize=False + ), + ), + ("user_login", models.CharField(max_length=60)), + ("user_pass", models.CharField(max_length=255)), + ("user_nicename", models.CharField(max_length=50)), + ("user_email", models.CharField(max_length=100)), + ("user_url", models.CharField(max_length=100)), + ("user_registered", models.DateTimeField()), + ("user_activation_key", models.CharField(max_length=255)), + ("user_status", models.IntegerField()), + ("display_name", models.CharField(max_length=250)), + ], + options={ + "db_table": "wp1d_users", + "managed": False, + }, + ), + migrations.CreateModel( + name="Wp1DWcAdminNoteActions", + fields=[ + ("action_id", models.BigAutoField(primary_key=True, serialize=False)), + ("note_id", models.PositiveBigIntegerField()), + ("name", models.CharField(max_length=255)), + ("label", models.CharField(max_length=255)), + ("query", models.TextField()), + ("status", models.CharField(max_length=255)), + ("actioned_text", models.CharField(max_length=255)), + ( + "nonce_action", + models.CharField(blank=True, max_length=255, null=True), + ), + ("nonce_name", models.CharField(blank=True, max_length=255, null=True)), + ], + options={ + "db_table": "wp1d_wc_admin_note_actions", + "managed": False, + }, + ), + migrations.CreateModel( + name="Wp1DWcAdminNotes", + fields=[ + ("note_id", models.BigAutoField(primary_key=True, serialize=False)), + ("name", models.CharField(max_length=255)), + ("type", models.CharField(max_length=20)), + ("locale", models.CharField(max_length=20)), + ("title", models.TextField()), + ("content", models.TextField()), + ("content_data", models.TextField(blank=True, null=True)), + ("status", models.CharField(max_length=200)), + ("source", models.CharField(max_length=200)), + ("date_created", models.DateTimeField()), + ("date_reminder", models.DateTimeField(blank=True, null=True)), + ("is_snoozable", models.IntegerField()), + ("layout", models.CharField(max_length=20)), + ("image", models.CharField(blank=True, max_length=200, null=True)), + ("is_deleted", models.IntegerField()), + ("is_read", models.IntegerField()), + ("icon", models.CharField(max_length=200)), + ], + options={ + "db_table": "wp1d_wc_admin_notes", + "managed": False, + }, + ), + migrations.CreateModel( + name="Wp1DWcCategoryLookup", + fields=[ + ( + "pk", + models.CompositePrimaryKey( + "category_tree_id", + "category_id", + blank=True, + editable=False, + primary_key=True, + serialize=False, + ), + ), + ("category_tree_id", models.PositiveBigIntegerField()), + ("category_id", models.PositiveBigIntegerField()), + ], + options={ + "db_table": "wp1d_wc_category_lookup", + "managed": False, + }, + ), + migrations.CreateModel( + name="Wp1DWcCustomerLookup", + fields=[ + ("customer_id", models.BigAutoField(primary_key=True, serialize=False)), + ( + "user_id", + models.PositiveBigIntegerField(blank=True, null=True, unique=True), + ), + ("username", models.CharField(max_length=60)), + ("first_name", models.CharField(max_length=255)), + ("last_name", models.CharField(max_length=255)), + ("email", models.CharField(blank=True, max_length=100, null=True)), + ("date_last_active", models.DateTimeField(blank=True, null=True)), + ("date_registered", models.DateTimeField(blank=True, null=True)), + ("country", models.CharField(max_length=2)), + ("postcode", models.CharField(max_length=20)), + ("city", models.CharField(max_length=100)), + ("state", models.CharField(max_length=100)), + ], + options={ + "db_table": "wp1d_wc_customer_lookup", + "managed": False, + }, + ), + migrations.CreateModel( + name="Wp1DWcDownloadLog", + fields=[ + ( + "download_log_id", + models.BigAutoField(primary_key=True, serialize=False), + ), + ("timestamp", models.DateTimeField()), + ("permission_id", models.PositiveBigIntegerField()), + ("user_id", models.PositiveBigIntegerField(blank=True, null=True)), + ( + "user_ip_address", + models.CharField(blank=True, max_length=100, null=True), + ), + ], + options={ + "db_table": "wp1d_wc_download_log", + "managed": False, + }, + ), + migrations.CreateModel( + name="Wp1DWcOrderAddresses", + fields=[ + ("id", models.BigAutoField(primary_key=True, serialize=False)), + ("order_id", models.PositiveBigIntegerField()), + ( + "address_type", + models.CharField(blank=True, max_length=20, null=True), + ), + ("first_name", models.TextField(blank=True, null=True)), + ("last_name", models.TextField(blank=True, null=True)), + ("company", models.TextField(blank=True, null=True)), + ("address_1", models.TextField(blank=True, null=True)), + ("address_2", models.TextField(blank=True, null=True)), + ("city", models.TextField(blank=True, null=True)), + ("state", models.TextField(blank=True, null=True)), + ("postcode", models.TextField(blank=True, null=True)), + ("country", models.TextField(blank=True, null=True)), + ("email", models.CharField(blank=True, max_length=320, null=True)), + ("phone", models.CharField(blank=True, max_length=100, null=True)), + ], + options={ + "db_table": "wp1d_wc_order_addresses", + "managed": False, + }, + ), + migrations.CreateModel( + name="Wp1DWcOrderCouponLookup", + fields=[ + ( + "pk", + models.CompositePrimaryKey( + "order_id", + "coupon_id", + blank=True, + editable=False, + primary_key=True, + serialize=False, + ), + ), + ("order_id", models.PositiveBigIntegerField()), + ("coupon_id", models.BigIntegerField()), + ("date_created", models.DateTimeField()), + ("discount_amount", models.FloatField()), + ], + options={ + "db_table": "wp1d_wc_order_coupon_lookup", + "managed": False, + }, + ), + migrations.CreateModel( + name="Wp1DWcOrderOperationalData", + fields=[ + ("id", models.BigAutoField(primary_key=True, serialize=False)), + ( + "order_id", + models.PositiveBigIntegerField(blank=True, null=True, unique=True), + ), + ( + "created_via", + models.CharField(blank=True, max_length=100, null=True), + ), + ( + "woocommerce_version", + models.CharField(blank=True, max_length=20, null=True), + ), + ("prices_include_tax", models.IntegerField(blank=True, null=True)), + ( + "coupon_usages_are_counted", + models.IntegerField(blank=True, null=True), + ), + ( + "download_permission_granted", + models.IntegerField(blank=True, null=True), + ), + ("cart_hash", models.CharField(blank=True, max_length=100, null=True)), + ("new_order_email_sent", models.IntegerField(blank=True, null=True)), + ("order_key", models.CharField(blank=True, max_length=100, null=True)), + ("order_stock_reduced", models.IntegerField(blank=True, null=True)), + ("date_paid_gmt", models.DateTimeField(blank=True, null=True)), + ("date_completed_gmt", models.DateTimeField(blank=True, null=True)), + ( + "shipping_tax_amount", + models.DecimalField( + blank=True, decimal_places=8, max_digits=26, null=True + ), + ), + ( + "shipping_total_amount", + models.DecimalField( + blank=True, decimal_places=8, max_digits=26, null=True + ), + ), + ( + "discount_tax_amount", + models.DecimalField( + blank=True, decimal_places=8, max_digits=26, null=True + ), + ), + ( + "discount_total_amount", + models.DecimalField( + blank=True, decimal_places=8, max_digits=26, null=True + ), + ), + ("recorded_sales", models.IntegerField(blank=True, null=True)), + ], + options={ + "db_table": "wp1d_wc_order_operational_data", + "managed": False, + }, + ), + migrations.CreateModel( + name="Wp1DWcOrderProductLookup", + fields=[ + ( + "order_item_id", + models.PositiveBigIntegerField(primary_key=True, serialize=False), + ), + ("order_id", models.PositiveBigIntegerField()), + ("product_id", models.PositiveBigIntegerField()), + ("variation_id", models.PositiveBigIntegerField()), + ("customer_id", models.PositiveBigIntegerField(blank=True, null=True)), + ("date_created", models.DateTimeField()), + ("product_qty", models.IntegerField()), + ("product_net_revenue", models.FloatField()), + ("product_gross_revenue", models.FloatField()), + ("coupon_amount", models.FloatField()), + ("tax_amount", models.FloatField()), + ("shipping_amount", models.FloatField()), + ("shipping_tax_amount", models.FloatField()), + ], + options={ + "db_table": "wp1d_wc_order_product_lookup", + "managed": False, + }, + ), + migrations.CreateModel( + name="Wp1DWcOrders", + fields=[ + ( + "id", + models.PositiveBigIntegerField(primary_key=True, serialize=False), + ), + ("status", models.CharField(blank=True, max_length=20, null=True)), + ("currency", models.CharField(blank=True, max_length=10, null=True)), + ("type", models.CharField(blank=True, max_length=20, null=True)), + ( + "tax_amount", + models.DecimalField( + blank=True, decimal_places=8, max_digits=26, null=True + ), + ), + ( + "total_amount", + models.DecimalField( + blank=True, decimal_places=8, max_digits=26, null=True + ), + ), + ("customer_id", models.PositiveBigIntegerField(blank=True, null=True)), + ( + "billing_email", + models.CharField(blank=True, max_length=320, null=True), + ), + ("date_created_gmt", models.DateTimeField(blank=True, null=True)), + ("date_updated_gmt", models.DateTimeField(blank=True, null=True)), + ( + "parent_order_id", + models.PositiveBigIntegerField(blank=True, null=True), + ), + ( + "payment_method", + models.CharField(blank=True, max_length=100, null=True), + ), + ("payment_method_title", models.TextField(blank=True, null=True)), + ( + "transaction_id", + models.CharField(blank=True, max_length=100, null=True), + ), + ("ip_address", models.CharField(blank=True, max_length=100, null=True)), + ("user_agent", models.TextField(blank=True, null=True)), + ("customer_note", models.TextField(blank=True, null=True)), + ], + options={ + "db_table": "wp1d_wc_orders", + "managed": False, + }, + ), + migrations.CreateModel( + name="Wp1DWcOrdersMeta", + fields=[ + ("id", models.BigAutoField(primary_key=True, serialize=False)), + ("order_id", models.PositiveBigIntegerField(blank=True, null=True)), + ("meta_key", models.CharField(blank=True, max_length=255, null=True)), + ("meta_value", models.TextField(blank=True, null=True)), + ], + options={ + "db_table": "wp1d_wc_orders_meta", + "managed": False, + }, + ), + migrations.CreateModel( + name="Wp1DWcOrderStats", + fields=[ + ( + "order_id", + models.PositiveBigIntegerField(primary_key=True, serialize=False), + ), + ("parent_id", models.PositiveBigIntegerField()), + ("date_created", models.DateTimeField()), + ("date_created_gmt", models.DateTimeField()), + ("date_paid", models.DateTimeField(blank=True, null=True)), + ("date_completed", models.DateTimeField(blank=True, null=True)), + ("num_items_sold", models.IntegerField()), + ("total_sales", models.FloatField()), + ("tax_total", models.FloatField()), + ("shipping_total", models.FloatField()), + ("net_total", models.FloatField()), + ("returning_customer", models.IntegerField(blank=True, null=True)), + ("status", models.CharField(max_length=200)), + ("customer_id", models.PositiveBigIntegerField()), + ], + options={ + "db_table": "wp1d_wc_order_stats", + "managed": False, + }, + ), + migrations.CreateModel( + name="Wp1DWcOrderTaxLookup", + fields=[ + ( + "pk", + models.CompositePrimaryKey( + "order_id", + "tax_rate_id", + blank=True, + editable=False, + primary_key=True, + serialize=False, + ), + ), + ("order_id", models.PositiveBigIntegerField()), + ("tax_rate_id", models.PositiveBigIntegerField()), + ("date_created", models.DateTimeField()), + ("shipping_tax", models.FloatField()), + ("order_tax", models.FloatField()), + ("total_tax", models.FloatField()), + ], + options={ + "db_table": "wp1d_wc_order_tax_lookup", + "managed": False, + }, + ), + migrations.CreateModel( + name="Wp1DWcProductAttributesLookup", + fields=[ + ( + "pk", + models.CompositePrimaryKey( + "product_or_parent_id", + "term_id", + "product_id", + "taxonomy", + blank=True, + editable=False, + primary_key=True, + serialize=False, + ), + ), + ("product_id", models.BigIntegerField()), + ("product_or_parent_id", models.BigIntegerField()), + ("taxonomy", models.CharField(max_length=32)), + ("term_id", models.BigIntegerField()), + ("is_variation_attribute", models.IntegerField()), + ("in_stock", models.IntegerField()), + ], + options={ + "db_table": "wp1d_wc_product_attributes_lookup", + "managed": False, + }, + ), + migrations.CreateModel( + name="Wp1DWcProductDownloadDirectories", + fields=[ + ("url_id", models.BigAutoField(primary_key=True, serialize=False)), + ("url", models.CharField(max_length=256)), + ("enabled", models.IntegerField()), + ], + options={ + "db_table": "wp1d_wc_product_download_directories", + "managed": False, + }, + ), + migrations.CreateModel( + name="Wp1DWcProductMetaLookup", + fields=[ + ( + "product_id", + models.BigIntegerField(primary_key=True, serialize=False), + ), + ("sku", models.CharField(blank=True, max_length=100, null=True)), + ( + "global_unique_id", + models.CharField(blank=True, max_length=100, null=True), + ), + ("virtual", models.IntegerField(blank=True, null=True)), + ("downloadable", models.IntegerField(blank=True, null=True)), + ( + "min_price", + models.DecimalField( + blank=True, decimal_places=4, max_digits=19, null=True + ), + ), + ( + "max_price", + models.DecimalField( + blank=True, decimal_places=4, max_digits=19, null=True + ), + ), + ("onsale", models.IntegerField(blank=True, null=True)), + ("stock_quantity", models.FloatField(blank=True, null=True)), + ( + "stock_status", + models.CharField(blank=True, max_length=100, null=True), + ), + ("rating_count", models.BigIntegerField(blank=True, null=True)), + ( + "average_rating", + models.DecimalField( + blank=True, decimal_places=2, max_digits=3, null=True + ), + ), + ("total_sales", models.BigIntegerField(blank=True, null=True)), + ("tax_status", models.CharField(blank=True, max_length=100, null=True)), + ("tax_class", models.CharField(blank=True, max_length=100, null=True)), + ], + options={ + "db_table": "wp1d_wc_product_meta_lookup", + "managed": False, + }, + ), + migrations.CreateModel( + name="Wp1DWcRateLimits", + fields=[ + ( + "rate_limit_id", + models.BigAutoField(primary_key=True, serialize=False), + ), + ("rate_limit_key", models.CharField(max_length=200, unique=True)), + ("rate_limit_expiry", models.PositiveBigIntegerField()), + ("rate_limit_remaining", models.SmallIntegerField()), + ], + options={ + "db_table": "wp1d_wc_rate_limits", + "managed": False, + }, + ), + migrations.CreateModel( + name="Wp1DWcReservedStock", + fields=[ + ( + "pk", + models.CompositePrimaryKey( + "order_id", + "product_id", + blank=True, + editable=False, + primary_key=True, + serialize=False, + ), + ), + ("order_id", models.BigIntegerField()), + ("product_id", models.BigIntegerField()), + ("stock_quantity", models.FloatField()), + ("timestamp", models.DateTimeField()), + ("expires", models.DateTimeField()), + ], + options={ + "db_table": "wp1d_wc_reserved_stock", + "managed": False, + }, + ), + migrations.CreateModel( + name="Wp1DWcTaxRateClasses", + fields=[ + ( + "tax_rate_class_id", + models.BigAutoField(primary_key=True, serialize=False), + ), + ("name", models.CharField(max_length=200)), + ("slug", models.CharField(max_length=200, unique=True)), + ], + options={ + "db_table": "wp1d_wc_tax_rate_classes", + "managed": False, + }, + ), + migrations.CreateModel( + name="Wp1DWcWebhooks", + fields=[ + ("webhook_id", models.BigAutoField(primary_key=True, serialize=False)), + ("status", models.CharField(max_length=200)), + ("name", models.TextField()), + ("user_id", models.PositiveBigIntegerField()), + ("delivery_url", models.TextField()), + ("secret", models.TextField()), + ("topic", models.CharField(max_length=200)), + ("date_created", models.DateTimeField()), + ("date_created_gmt", models.DateTimeField()), + ("date_modified", models.DateTimeField()), + ("date_modified_gmt", models.DateTimeField()), + ("api_version", models.SmallIntegerField()), + ("failure_count", models.SmallIntegerField()), + ("pending_delivery", models.IntegerField()), + ], + options={ + "db_table": "wp1d_wc_webhooks", + "managed": False, + }, + ), + migrations.CreateModel( + name="Wp1DWoocommerceApiKeys", + fields=[ + ("key_id", models.BigAutoField(primary_key=True, serialize=False)), + ("user_id", models.PositiveBigIntegerField()), + ( + "description", + models.CharField(blank=True, max_length=200, null=True), + ), + ("permissions", models.CharField(max_length=10)), + ("consumer_key", models.CharField(max_length=64)), + ("consumer_secret", models.CharField(max_length=43)), + ("nonces", models.TextField(blank=True, null=True)), + ("truncated_key", models.CharField(max_length=7)), + ("last_access", models.DateTimeField(blank=True, null=True)), + ], + options={ + "db_table": "wp1d_woocommerce_api_keys", + "managed": False, + }, + ), + migrations.CreateModel( + name="Wp1DWoocommerceAttributeTaxonomies", + fields=[ + ( + "attribute_id", + models.BigAutoField(primary_key=True, serialize=False), + ), + ("attribute_name", models.CharField(max_length=200)), + ( + "attribute_label", + models.CharField(blank=True, max_length=200, null=True), + ), + ("attribute_type", models.CharField(max_length=20)), + ("attribute_orderby", models.CharField(max_length=20)), + ("attribute_public", models.IntegerField()), + ], + options={ + "db_table": "wp1d_woocommerce_attribute_taxonomies", + "managed": False, + }, + ), + migrations.CreateModel( + name="Wp1DWoocommerceDownloadableProductPermissions", + fields=[ + ( + "permission_id", + models.BigAutoField(primary_key=True, serialize=False), + ), + ("download_id", models.CharField(max_length=36)), + ("product_id", models.PositiveBigIntegerField()), + ("order_id", models.PositiveBigIntegerField()), + ("order_key", models.CharField(max_length=200)), + ("user_email", models.CharField(max_length=200)), + ("user_id", models.PositiveBigIntegerField(blank=True, null=True)), + ( + "downloads_remaining", + models.CharField(blank=True, max_length=9, null=True), + ), + ("access_granted", models.DateTimeField()), + ("access_expires", models.DateTimeField(blank=True, null=True)), + ("download_count", models.PositiveBigIntegerField()), + ], + options={ + "db_table": "wp1d_woocommerce_downloadable_product_permissions", + "managed": False, + }, + ), + migrations.CreateModel( + name="Wp1DWoocommerceLog", + fields=[ + ("log_id", models.BigAutoField(primary_key=True, serialize=False)), + ("timestamp", models.DateTimeField()), + ("level", models.SmallIntegerField()), + ("source", models.CharField(max_length=200)), + ("message", models.TextField()), + ("context", models.TextField(blank=True, null=True)), + ], + options={ + "db_table": "wp1d_woocommerce_log", + "managed": False, + }, + ), + migrations.CreateModel( + name="Wp1DWoocommerceOrderItemmeta", + fields=[ + ("meta_id", models.BigAutoField(primary_key=True, serialize=False)), + ("order_item_id", models.PositiveBigIntegerField()), + ("meta_key", models.CharField(blank=True, max_length=255, null=True)), + ("meta_value", models.TextField(blank=True, null=True)), + ], + options={ + "db_table": "wp1d_woocommerce_order_itemmeta", + "managed": False, + }, + ), + migrations.CreateModel( + name="Wp1DWoocommerceOrderItems", + fields=[ + ( + "order_item_id", + models.BigAutoField(primary_key=True, serialize=False), + ), + ("order_item_name", models.TextField()), + ("order_item_type", models.CharField(max_length=200)), + ("order_id", models.PositiveBigIntegerField()), + ], + options={ + "db_table": "wp1d_woocommerce_order_items", + "managed": False, + }, + ), + migrations.CreateModel( + name="Wp1DWoocommercePaymentTokenmeta", + fields=[ + ("meta_id", models.BigAutoField(primary_key=True, serialize=False)), + ("payment_token_id", models.PositiveBigIntegerField()), + ("meta_key", models.CharField(blank=True, max_length=255, null=True)), + ("meta_value", models.TextField(blank=True, null=True)), + ], + options={ + "db_table": "wp1d_woocommerce_payment_tokenmeta", + "managed": False, + }, + ), + migrations.CreateModel( + name="Wp1DWoocommercePaymentTokens", + fields=[ + ("token_id", models.BigAutoField(primary_key=True, serialize=False)), + ("gateway_id", models.CharField(max_length=200)), + ("token", models.TextField()), + ("user_id", models.PositiveBigIntegerField()), + ("type", models.CharField(max_length=200)), + ("is_default", models.IntegerField()), + ], + options={ + "db_table": "wp1d_woocommerce_payment_tokens", + "managed": False, + }, + ), + migrations.CreateModel( + name="Wp1DWoocommerceSessions", + fields=[ + ("session_id", models.BigAutoField(primary_key=True, serialize=False)), + ("session_key", models.CharField(max_length=32, unique=True)), + ("session_value", models.TextField()), + ("session_expiry", models.PositiveBigIntegerField()), + ], + options={ + "db_table": "wp1d_woocommerce_sessions", + "managed": False, + }, + ), + migrations.CreateModel( + name="Wp1DWoocommerceShippingZoneLocations", + fields=[ + ("location_id", models.BigAutoField(primary_key=True, serialize=False)), + ("zone_id", models.PositiveBigIntegerField()), + ("location_code", models.CharField(max_length=200)), + ("location_type", models.CharField(max_length=40)), + ], + options={ + "db_table": "wp1d_woocommerce_shipping_zone_locations", + "managed": False, + }, + ), + migrations.CreateModel( + name="Wp1DWoocommerceShippingZoneMethods", + fields=[ + ("zone_id", models.PositiveBigIntegerField()), + ("instance_id", models.BigAutoField(primary_key=True, serialize=False)), + ("method_id", models.CharField(max_length=200)), + ("method_order", models.PositiveBigIntegerField()), + ("is_enabled", models.IntegerField()), + ], + options={ + "db_table": "wp1d_woocommerce_shipping_zone_methods", + "managed": False, + }, + ), + migrations.CreateModel( + name="Wp1DWoocommerceShippingZones", + fields=[ + ("zone_id", models.BigAutoField(primary_key=True, serialize=False)), + ("zone_name", models.CharField(max_length=200)), + ("zone_order", models.PositiveBigIntegerField()), + ], + options={ + "db_table": "wp1d_woocommerce_shipping_zones", + "managed": False, + }, + ), + migrations.CreateModel( + name="Wp1DWoocommerceTaxRateLocations", + fields=[ + ("location_id", models.BigAutoField(primary_key=True, serialize=False)), + ("location_code", models.CharField(max_length=200)), + ("tax_rate_id", models.PositiveBigIntegerField()), + ("location_type", models.CharField(max_length=40)), + ], + options={ + "db_table": "wp1d_woocommerce_tax_rate_locations", + "managed": False, + }, + ), + migrations.CreateModel( + name="Wp1DWoocommerceTaxRates", + fields=[ + ("tax_rate_id", models.BigAutoField(primary_key=True, serialize=False)), + ("tax_rate_country", models.CharField(max_length=2)), + ("tax_rate_state", models.CharField(max_length=200)), + ("tax_rate", models.CharField(max_length=8)), + ("tax_rate_name", models.CharField(max_length=200)), + ("tax_rate_priority", models.PositiveBigIntegerField()), + ("tax_rate_compound", models.IntegerField()), + ("tax_rate_shipping", models.IntegerField()), + ("tax_rate_order", models.PositiveBigIntegerField()), + ("tax_rate_class", models.CharField(max_length=200)), + ], + options={ + "db_table": "wp1d_woocommerce_tax_rates", + "managed": False, + }, + ), + migrations.CreateModel( + name="Wp1DWpcbFolders", + fields=[ + ( + "id", + models.BigAutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("name", models.CharField(max_length=150)), + ("savedtocloud", models.SmallIntegerField(db_column="savedToCloud")), + ("remoteid", models.IntegerField(db_column="remoteId")), + ("folder_order", models.IntegerField()), + ], + options={ + "db_table": "wp1d_wpcb_folders", + "managed": False, + }, + ), + migrations.CreateModel( + name="Wp1DWpcbSnippets", + fields=[ + ( + "id", + models.BigAutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("title", models.CharField(max_length=100)), + ("description", models.TextField()), + ("enabled", models.IntegerField()), + ("priority", models.IntegerField()), + ("runtype", models.CharField(db_column="runType", max_length=100)), + ("code", models.TextField()), + ("original_code", models.TextField()), + ("codetype", models.CharField(db_column="codeType", max_length=100)), + ("conditions", models.TextField()), + ("location", models.CharField(max_length=20)), + ( + "tagoptions", + models.CharField(db_column="tagOptions", max_length=100), + ), + ("hook", models.CharField(max_length=1000)), + ( + "rendertype", + models.CharField( + blank=True, db_column="renderType", max_length=20, null=True + ), + ), + ("minify", models.IntegerField()), + ("snippet_order", models.IntegerField()), + ( + "addtoquickactions", + models.SmallIntegerField(db_column="addToQuickActions"), + ), + ("savedtocloud", models.SmallIntegerField(db_column="savedToCloud")), + ("remoteid", models.IntegerField(db_column="remoteId")), + ("externalurl", models.SmallIntegerField(db_column="externalUrl")), + ("secret", models.CharField(max_length=50)), + ("folderid", models.IntegerField(db_column="folderId")), + ("error", models.IntegerField()), + ("errormessage", models.TextField(db_column="errorMessage")), + ("errortrace", models.TextField(db_column="errorTrace")), + ("errorline", models.IntegerField(db_column="errorLine")), + ("devmode", models.SmallIntegerField(db_column="devMode")), + ( + "lastmodified", + models.CharField(db_column="lastModified", max_length=100), + ), + ], + options={ + "db_table": "wp1d_wpcb_snippets", + "managed": False, + }, + ), + migrations.CreateModel( + name="Wp1DWpsmtpLogs", + fields=[ + ("mail_id", models.AutoField(primary_key=True, serialize=False)), + ("timestamp", models.DateTimeField()), + ("to", models.CharField(max_length=200)), + ("subject", models.CharField(max_length=200)), + ("message", models.TextField(blank=True, null=True)), + ("headers", models.TextField(blank=True, null=True)), + ("error", models.TextField(blank=True, null=True)), + ], + options={ + "db_table": "wp1d_wpsmtp_logs", + "managed": False, + }, + ), + migrations.CreateModel( + name="Wp1DWpvividOptions", + fields=[ + ("option_id", models.BigAutoField(primary_key=True, serialize=False)), + ("option_name", models.CharField(max_length=191, unique=True)), + ("option_value", models.TextField()), + ], + options={ + "db_table": "wp1d_wpvivid_options", + "managed": False, + }, + ), + migrations.CreateModel( + name="Wp1DWpvividScanResult", + fields=[ + ("id", models.BigAutoField(primary_key=True, serialize=False)), + ("path", models.TextField()), + ("from_post", models.IntegerField()), + ], + options={ + "db_table": "wp1d_wpvivid_scan_result", + "managed": False, + }, + ), + migrations.CreateModel( + name="Wp1DWpvividUnusedUploadsFiles", + fields=[ + ("id", models.BigAutoField(primary_key=True, serialize=False)), + ("path", models.TextField()), + ("folder", models.TextField()), + ], + options={ + "db_table": "wp1d_wpvivid_unused_uploads_files", + "managed": False, + }, + ), + migrations.CreateModel( + name="Wp1DYoastIndexable", + fields=[ + ( + "id", + models.BigAutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("permalink", models.TextField(blank=True, null=True)), + ( + "permalink_hash", + models.CharField(blank=True, max_length=40, null=True), + ), + ("object_id", models.BigIntegerField(blank=True, null=True)), + ("object_type", models.CharField(max_length=32)), + ( + "object_sub_type", + models.CharField(blank=True, max_length=32, null=True), + ), + ("author_id", models.BigIntegerField(blank=True, null=True)), + ("post_parent", models.BigIntegerField(blank=True, null=True)), + ("title", models.TextField(blank=True, null=True)), + ("description", models.TextField(blank=True, null=True)), + ("breadcrumb_title", models.TextField(blank=True, null=True)), + ("post_status", models.CharField(blank=True, max_length=20, null=True)), + ("is_public", models.IntegerField(blank=True, null=True)), + ("is_protected", models.IntegerField(blank=True, null=True)), + ("has_public_posts", models.IntegerField(blank=True, null=True)), + ("number_of_pages", models.PositiveIntegerField(blank=True, null=True)), + ("canonical", models.TextField(blank=True, null=True)), + ( + "primary_focus_keyword", + models.CharField(blank=True, max_length=191, null=True), + ), + ( + "primary_focus_keyword_score", + models.IntegerField(blank=True, null=True), + ), + ("readability_score", models.IntegerField(blank=True, null=True)), + ("is_cornerstone", models.IntegerField(blank=True, null=True)), + ("is_robots_noindex", models.IntegerField(blank=True, null=True)), + ("is_robots_nofollow", models.IntegerField(blank=True, null=True)), + ("is_robots_noarchive", models.IntegerField(blank=True, null=True)), + ("is_robots_noimageindex", models.IntegerField(blank=True, null=True)), + ("is_robots_nosnippet", models.IntegerField(blank=True, null=True)), + ("twitter_title", models.TextField(blank=True, null=True)), + ("twitter_image", models.TextField(blank=True, null=True)), + ("twitter_description", models.TextField(blank=True, null=True)), + ( + "twitter_image_id", + models.CharField(blank=True, max_length=191, null=True), + ), + ("twitter_image_source", models.TextField(blank=True, null=True)), + ("open_graph_title", models.TextField(blank=True, null=True)), + ("open_graph_description", models.TextField(blank=True, null=True)), + ("open_graph_image", models.TextField(blank=True, null=True)), + ( + "open_graph_image_id", + models.CharField(blank=True, max_length=191, null=True), + ), + ("open_graph_image_source", models.TextField(blank=True, null=True)), + ("open_graph_image_meta", models.TextField(blank=True, null=True)), + ("link_count", models.IntegerField(blank=True, null=True)), + ("incoming_link_count", models.IntegerField(blank=True, null=True)), + ( + "prominent_words_version", + models.PositiveIntegerField(blank=True, null=True), + ), + ("created_at", models.DateTimeField(blank=True, null=True)), + ("updated_at", models.DateTimeField()), + ("blog_id", models.BigIntegerField()), + ("language", models.CharField(blank=True, max_length=32, null=True)), + ("region", models.CharField(blank=True, max_length=32, null=True)), + ( + "schema_page_type", + models.CharField(blank=True, max_length=64, null=True), + ), + ( + "schema_article_type", + models.CharField(blank=True, max_length=64, null=True), + ), + ("has_ancestors", models.IntegerField(blank=True, null=True)), + ( + "estimated_reading_time_minutes", + models.IntegerField(blank=True, null=True), + ), + ("version", models.IntegerField(blank=True, null=True)), + ("object_last_modified", models.DateTimeField(blank=True, null=True)), + ("object_published_at", models.DateTimeField(blank=True, null=True)), + ( + "inclusive_language_score", + models.IntegerField(blank=True, null=True), + ), + ], + options={ + "db_table": "wp1d_yoast_indexable", + "managed": False, + }, + ), + migrations.CreateModel( + name="Wp1DYoastIndexableHierarchy", + fields=[ + ( + "pk", + models.CompositePrimaryKey( + "indexable_id", + "ancestor_id", + blank=True, + editable=False, + primary_key=True, + serialize=False, + ), + ), + ("indexable_id", models.PositiveIntegerField()), + ("ancestor_id", models.PositiveIntegerField()), + ("depth", models.PositiveIntegerField(blank=True, null=True)), + ("blog_id", models.BigIntegerField()), + ], + options={ + "db_table": "wp1d_yoast_indexable_hierarchy", + "managed": False, + }, + ), + migrations.CreateModel( + name="Wp1DYoastMigrations", + fields=[ + ( + "id", + models.BigAutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ( + "version", + models.CharField( + blank=True, max_length=191, null=True, unique=True + ), + ), + ], + options={ + "db_table": "wp1d_yoast_migrations", + "managed": False, + }, + ), + migrations.CreateModel( + name="Wp1DYoastPrimaryTerm", + fields=[ + ( + "id", + models.BigAutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("post_id", models.BigIntegerField(blank=True, null=True)), + ("term_id", models.BigIntegerField(blank=True, null=True)), + ("taxonomy", models.CharField(max_length=32)), + ("created_at", models.DateTimeField(blank=True, null=True)), + ("updated_at", models.DateTimeField()), + ("blog_id", models.BigIntegerField()), + ], + options={ + "db_table": "wp1d_yoast_primary_term", + "managed": False, + }, + ), + migrations.CreateModel( + name="Wp1DYoastSeoLinks", + fields=[ + ("id", models.BigAutoField(primary_key=True, serialize=False)), + ("url", models.CharField(blank=True, max_length=255, null=True)), + ("post_id", models.PositiveBigIntegerField(blank=True, null=True)), + ( + "target_post_id", + models.PositiveBigIntegerField(blank=True, null=True), + ), + ("type", models.CharField(blank=True, max_length=8, null=True)), + ("indexable_id", models.PositiveIntegerField(blank=True, null=True)), + ( + "target_indexable_id", + models.PositiveIntegerField(blank=True, null=True), + ), + ("height", models.PositiveIntegerField(blank=True, null=True)), + ("width", models.PositiveIntegerField(blank=True, null=True)), + ("size", models.PositiveIntegerField(blank=True, null=True)), + ("language", models.CharField(blank=True, max_length=32, null=True)), + ("region", models.CharField(blank=True, max_length=32, null=True)), + ], + options={ + "db_table": "wp1d_yoast_seo_links", + "managed": False, + }, + ), + ] diff --git a/wordpress_api/migrations/__init__.py b/wordpress_api/migrations/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/wordpress_api/migrations/__pycache__/0001_initial.cpython-312.pyc b/wordpress_api/migrations/__pycache__/0001_initial.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9e0eac4e1e9344c6a5e6fbaeb92014e02f27ae97 Binary files /dev/null and b/wordpress_api/migrations/__pycache__/0001_initial.cpython-312.pyc differ diff --git a/wordpress_api/migrations/__pycache__/__init__.cpython-312.pyc b/wordpress_api/migrations/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..31e8415ea771d12a2e22393857e753f99e055ad8 Binary files /dev/null and b/wordpress_api/migrations/__pycache__/__init__.cpython-312.pyc differ diff --git a/wordpress_api/models.py b/wordpress_api/models.py new file mode 100644 index 0000000000000000000000000000000000000000..02eca9cb1e509b5f9f07bfd0b6d8193d03a5716a --- /dev/null +++ b/wordpress_api/models.py @@ -0,0 +1,1120 @@ +from django.db import models + + +class Wp1DActionschedulerActions(models.Model): + action_id = models.BigAutoField(primary_key=True) + hook = models.CharField(max_length=191) + status = models.CharField(max_length=20) + scheduled_date_gmt = models.DateTimeField(blank=True, null=True) + scheduled_date_local = models.DateTimeField(blank=True, null=True) + priority = models.PositiveIntegerField() + args = models.CharField(max_length=191, blank=True, null=True) + schedule = models.TextField(blank=True, null=True) + group_id = models.PositiveBigIntegerField() + attempts = models.IntegerField() + last_attempt_gmt = models.DateTimeField(blank=True, null=True) + last_attempt_local = models.DateTimeField(blank=True, null=True) + claim_id = models.PositiveBigIntegerField() + extended_args = models.CharField(max_length=8000, blank=True, null=True) + + class Meta: + managed = False + db_table = 'wp1d_actionscheduler_actions' + + +class Wp1DActionschedulerClaims(models.Model): + claim_id = models.BigAutoField(primary_key=True) + date_created_gmt = models.DateTimeField(blank=True, null=True) + + class Meta: + managed = False + db_table = 'wp1d_actionscheduler_claims' + + +class Wp1DActionschedulerGroups(models.Model): + group_id = models.BigAutoField(primary_key=True) + slug = models.CharField(max_length=255) + + class Meta: + managed = False + db_table = 'wp1d_actionscheduler_groups' + + +class Wp1DActionschedulerLogs(models.Model): + log_id = models.BigAutoField(primary_key=True) + action_id = models.PositiveBigIntegerField() + message = models.TextField() + log_date_gmt = models.DateTimeField(blank=True, null=True) + log_date_local = models.DateTimeField(blank=True, null=True) + + class Meta: + managed = False + db_table = 'wp1d_actionscheduler_logs' + + +class Wp1DCommentmeta(models.Model): + meta_id = models.BigAutoField(primary_key=True) + comment_id = models.PositiveBigIntegerField() + meta_key = models.CharField(max_length=255, blank=True, null=True) + meta_value = models.TextField(blank=True, null=True) + + class Meta: + managed = False + db_table = 'wp1d_commentmeta' + + +class Wp1DComments(models.Model): + comment_id = models.BigAutoField(db_column='comment_ID', primary_key=True) # Field name made lowercase. + comment_post_id = models.PositiveBigIntegerField(db_column='comment_post_ID') # Field name made lowercase. + comment_author = models.TextField() + comment_author_email = models.CharField(max_length=100) + comment_author_url = models.CharField(max_length=200) + comment_author_ip = models.CharField(db_column='comment_author_IP', max_length=100) # Field name made lowercase. + comment_date = models.DateTimeField() + comment_date_gmt = models.DateTimeField() + comment_content = models.TextField() + comment_karma = models.IntegerField() + comment_approved = models.CharField(max_length=20) + comment_agent = models.CharField(max_length=255) + comment_type = models.CharField(max_length=20) + comment_parent = models.PositiveBigIntegerField() + user_id = models.PositiveBigIntegerField() + + class Meta: + managed = False + db_table = 'wp1d_comments' + + +class Wp1DFsmptEmailLogs(models.Model): + site_id = models.PositiveIntegerField(blank=True, null=True) + to = models.CharField(max_length=255, blank=True, null=True) + from_field = models.CharField(db_column='from', max_length=255, blank=True, null=True) # Field renamed because it was a Python reserved word. + subject = models.CharField(max_length=255, blank=True, null=True) + body = models.TextField(blank=True, null=True) + headers = models.TextField(blank=True, null=True) + attachments = models.TextField(blank=True, null=True) + status = models.CharField(max_length=20, blank=True, null=True) + response = models.TextField(blank=True, null=True) + extra = models.TextField(blank=True, null=True) + retries = models.PositiveIntegerField(blank=True, null=True) + resent_count = models.PositiveIntegerField(blank=True, null=True) + source = models.CharField(max_length=255, blank=True, null=True) + created_at = models.DateTimeField(blank=True, null=True) + updated_at = models.DateTimeField(blank=True, null=True) + + class Meta: + managed = False + db_table = 'wp1d_fsmpt_email_logs' + + +class Wp1DKbpCountdownEntry(models.Model): + id = models.BigAutoField(primary_key=True) + campaign = models.CharField(max_length=255, blank=True, null=True) + end_date = models.CharField(max_length=255, blank=True, null=True) + remove_date = models.CharField(max_length=255, blank=True, null=True) + user_id = models.PositiveBigIntegerField() + user_ip = models.CharField(max_length=50) + uuid = models.CharField(max_length=100) + + class Meta: + managed = False + db_table = 'wp1d_kbp_countdown_entry' + + +class Wp1DKbpFormEntry(models.Model): + id = models.BigAutoField(primary_key=True) + name = models.CharField(max_length=255, blank=True, null=True) + form_id = models.CharField(max_length=55, blank=True, null=True) + post_id = models.PositiveBigIntegerField() + user_id = models.PositiveBigIntegerField() + date_created = models.DateTimeField() + user_ip = models.CharField(max_length=100) + user_device = models.CharField(max_length=55, blank=True, null=True) + referer = models.CharField(max_length=255, blank=True, null=True) + status = models.CharField(max_length=10, blank=True, null=True) + uuid = models.CharField(max_length=100) + + class Meta: + managed = False + db_table = 'wp1d_kbp_form_entry' + + +class Wp1DKbpFormEntrymeta(models.Model): + meta_id = models.BigAutoField(primary_key=True) + kbp_form_entry_id = models.PositiveBigIntegerField() + meta_key = models.CharField(max_length=255, blank=True, null=True) + meta_value = models.TextField(blank=True, null=True) + + class Meta: + managed = False + db_table = 'wp1d_kbp_form_entrymeta' + + +class Wp1DKbpFormEvents(models.Model): + id = models.BigAutoField(primary_key=True) + event_type = models.CharField(max_length=128) + event_post = models.IntegerField() + event_time = models.DateTimeField() + event_count = models.PositiveIntegerField() + event_consolidated = models.IntegerField() + + class Meta: + managed = False + db_table = 'wp1d_kbp_form_events' + unique_together = (('event_type', 'event_post', 'event_time', 'event_consolidated'),) + + +class Wp1DKbpQueryIndex(models.Model): + id = models.BigAutoField(primary_key=True) + object_id = models.PositiveIntegerField(blank=True, null=True) + hash = models.CharField(max_length=50, blank=True, null=True) + facet_value = models.CharField(max_length=191, blank=True, null=True) + facet_name = models.CharField(max_length=191, blank=True, null=True) + facet_id = models.PositiveIntegerField(blank=True, null=True) + facet_parent = models.PositiveIntegerField(blank=True, null=True) + facet_order = models.PositiveIntegerField(blank=True, null=True) + + class Meta: + managed = False + db_table = 'wp1d_kbp_query_index' + + +class Wp1DLinks(models.Model): + link_id = models.BigAutoField(primary_key=True) + link_url = models.CharField(max_length=255) + link_name = models.CharField(max_length=255) + link_image = models.CharField(max_length=255) + link_target = models.CharField(max_length=25) + link_description = models.CharField(max_length=255) + link_visible = models.CharField(max_length=20) + link_owner = models.PositiveBigIntegerField() + link_rating = models.IntegerField() + link_updated = models.DateTimeField() + link_rel = models.CharField(max_length=255) + link_notes = models.TextField() + link_rss = models.CharField(max_length=255) + + class Meta: + managed = False + db_table = 'wp1d_links' + + +class Wp1DOptions(models.Model): + option_id = models.BigAutoField(primary_key=True) + option_name = models.CharField(unique=True, max_length=191) + option_value = models.TextField() + autoload = models.CharField(max_length=20) + + class Meta: + managed = False + db_table = 'wp1d_options' + + +class Wp1DPostmeta(models.Model): + meta_id = models.BigAutoField(primary_key=True) + post_id = models.PositiveBigIntegerField() + meta_key = models.CharField(max_length=255, blank=True, null=True) + meta_value = models.TextField(blank=True, null=True) + + class Meta: + managed = False + db_table = 'wp1d_postmeta' + + +class Wp1DPosts(models.Model): + id = models.BigAutoField(db_column='ID', primary_key=True) # Field name made lowercase. + post_author = models.PositiveBigIntegerField() + post_date = models.DateTimeField() + post_date_gmt = models.DateTimeField() + post_content = models.TextField() + post_title = models.TextField() + post_excerpt = models.TextField() + post_status = models.CharField(max_length=20) + comment_status = models.CharField(max_length=20) + ping_status = models.CharField(max_length=20) + post_password = models.CharField(max_length=255) + post_name = models.CharField(max_length=200) + to_ping = models.TextField() + pinged = models.TextField() + post_modified = models.DateTimeField() + post_modified_gmt = models.DateTimeField() + post_content_filtered = models.TextField() + post_parent = models.PositiveBigIntegerField() + guid = models.CharField(max_length=255) + menu_order = models.IntegerField() + post_type = models.CharField(max_length=20) + post_mime_type = models.CharField(max_length=100) + comment_count = models.BigIntegerField() + + class Meta: + managed = False + db_table = 'wp1d_posts' + + +class Wp1DSnippets(models.Model): + id = models.BigAutoField(primary_key=True) + name = models.TextField() + description = models.TextField() + code = models.TextField() + tags = models.TextField() + scope = models.CharField(max_length=15) + priority = models.SmallIntegerField() + active = models.IntegerField() + modified = models.DateTimeField() + revision = models.BigIntegerField() + cloud_id = models.CharField(max_length=255, blank=True, null=True) + + class Meta: + managed = False + db_table = 'wp1d_snippets' + + +class Wp1DSocialUsers(models.Model): + social_users_id = models.AutoField(primary_key=True) + id = models.IntegerField(db_column='ID') # Field name made lowercase. + type = models.CharField(max_length=20) + identifier = models.CharField(max_length=100) + register_date = models.DateTimeField(blank=True, null=True) + login_date = models.DateTimeField(blank=True, null=True) + link_date = models.DateTimeField(blank=True, null=True) + + class Meta: + managed = False + db_table = 'wp1d_social_users' + + +class Wp1DTermRelationships(models.Model): + pk = models.CompositePrimaryKey('object_id', 'term_taxonomy_id') + object_id = models.PositiveBigIntegerField() + term_taxonomy_id = models.PositiveBigIntegerField() + term_order = models.IntegerField() + + class Meta: + managed = False + db_table = 'wp1d_term_relationships' + + +class Wp1DTermTaxonomy(models.Model): + term_taxonomy_id = models.BigAutoField(primary_key=True) + term_id = models.PositiveBigIntegerField() + taxonomy = models.CharField(max_length=32) + description = models.TextField() + parent = models.PositiveBigIntegerField() + count = models.BigIntegerField() + + class Meta: + managed = False + db_table = 'wp1d_term_taxonomy' + unique_together = (('term_id', 'taxonomy'),) + + +class Wp1DTermmeta(models.Model): + meta_id = models.BigAutoField(primary_key=True) + term_id = models.PositiveBigIntegerField() + meta_key = models.CharField(max_length=255, blank=True, null=True) + meta_value = models.TextField(blank=True, null=True) + + class Meta: + managed = False + db_table = 'wp1d_termmeta' + + +class Wp1DTerms(models.Model): + term_id = models.BigAutoField(primary_key=True) + name = models.CharField(max_length=200) + slug = models.CharField(max_length=200) + term_group = models.BigIntegerField() + + class Meta: + managed = False + db_table = 'wp1d_terms' + + +class Wp1DUrAbandonedData(models.Model): + id = models.BigAutoField(primary_key=True) + form_id = models.IntegerField(blank=True, null=True) + referer = models.CharField(max_length=255, blank=True, null=True) + user_id = models.BigIntegerField(blank=True, null=True) + fields = models.TextField(blank=True, null=True) + status = models.CharField(max_length=20, blank=True, null=True) + created_at = models.DateTimeField(blank=True, null=True) + + class Meta: + managed = False + db_table = 'wp1d_ur_abandoned_data' + + +class Wp1DUrAbandonedMeta(models.Model): + meta_id = models.BigAutoField(primary_key=True) + abandon_id = models.CharField(max_length=255) + meta_key = models.CharField(max_length=255, blank=True, null=True) + meta_value = models.TextField(blank=True, null=True) + + class Meta: + managed = False + db_table = 'wp1d_ur_abandoned_meta' + + +class Wp1DUrUserPostVisits(models.Model): + id = models.BigAutoField(primary_key=True) + session_id = models.CharField(max_length=255) + page_url = models.CharField(max_length=255) + referer_url = models.CharField(max_length=255) + duration = models.IntegerField(blank=True, null=True) + user_id = models.BigIntegerField(blank=True, null=True) + form_id = models.IntegerField(blank=True, null=True) + form_abandoned = models.IntegerField(blank=True, null=True) + form_submitted = models.IntegerField(blank=True, null=True) + created_at = models.DateTimeField(blank=True, null=True) + + class Meta: + managed = False + db_table = 'wp1d_ur_user_post_visits' + + +class Wp1DUserRegistrationSessions(models.Model): + session_id = models.BigAutoField(primary_key=True) + session_key = models.CharField(max_length=32) + session_value = models.TextField() + session_expiry = models.PositiveBigIntegerField() + + class Meta: + managed = False + db_table = 'wp1d_user_registration_sessions' + + +class Wp1DUsermeta(models.Model): + umeta_id = models.BigAutoField(primary_key=True) + user_id = models.PositiveBigIntegerField() + meta_key = models.CharField(max_length=255, blank=True, null=True) + meta_value = models.TextField(blank=True, null=True) + + class Meta: + managed = False + db_table = 'wp1d_usermeta' + + +class Wp1DUsers(models.Model): + id = models.BigAutoField(db_column='ID', primary_key=True) # Field name made lowercase. + user_login = models.CharField(max_length=60) + user_pass = models.CharField(max_length=255) + user_nicename = models.CharField(max_length=50) + user_email = models.CharField(max_length=100) + user_url = models.CharField(max_length=100) + user_registered = models.DateTimeField() + user_activation_key = models.CharField(max_length=255) + user_status = models.IntegerField() + display_name = models.CharField(max_length=250) + + class Meta: + managed = False + db_table = 'wp1d_users' + + +class Wp1DWcAdminNoteActions(models.Model): + action_id = models.BigAutoField(primary_key=True) + note_id = models.PositiveBigIntegerField() + name = models.CharField(max_length=255) + label = models.CharField(max_length=255) + query = models.TextField() + status = models.CharField(max_length=255) + actioned_text = models.CharField(max_length=255) + nonce_action = models.CharField(max_length=255, blank=True, null=True) + nonce_name = models.CharField(max_length=255, blank=True, null=True) + + class Meta: + managed = False + db_table = 'wp1d_wc_admin_note_actions' + + +class Wp1DWcAdminNotes(models.Model): + note_id = models.BigAutoField(primary_key=True) + name = models.CharField(max_length=255) + type = models.CharField(max_length=20) + locale = models.CharField(max_length=20) + title = models.TextField() + content = models.TextField() + content_data = models.TextField(blank=True, null=True) + status = models.CharField(max_length=200) + source = models.CharField(max_length=200) + date_created = models.DateTimeField() + date_reminder = models.DateTimeField(blank=True, null=True) + is_snoozable = models.IntegerField() + layout = models.CharField(max_length=20) + image = models.CharField(max_length=200, blank=True, null=True) + is_deleted = models.IntegerField() + is_read = models.IntegerField() + icon = models.CharField(max_length=200) + + class Meta: + managed = False + db_table = 'wp1d_wc_admin_notes' + + +class Wp1DWcCategoryLookup(models.Model): + pk = models.CompositePrimaryKey('category_tree_id', 'category_id') + category_tree_id = models.PositiveBigIntegerField() + category_id = models.PositiveBigIntegerField() + + class Meta: + managed = False + db_table = 'wp1d_wc_category_lookup' + + +class Wp1DWcCustomerLookup(models.Model): + customer_id = models.BigAutoField(primary_key=True) + user_id = models.PositiveBigIntegerField(unique=True, blank=True, null=True) + username = models.CharField(max_length=60) + first_name = models.CharField(max_length=255) + last_name = models.CharField(max_length=255) + email = models.CharField(max_length=100, blank=True, null=True) + date_last_active = models.DateTimeField(blank=True, null=True) + date_registered = models.DateTimeField(blank=True, null=True) + country = models.CharField(max_length=2) + postcode = models.CharField(max_length=20) + city = models.CharField(max_length=100) + state = models.CharField(max_length=100) + + class Meta: + managed = False + db_table = 'wp1d_wc_customer_lookup' + + +class Wp1DWcDownloadLog(models.Model): + download_log_id = models.BigAutoField(primary_key=True) + timestamp = models.DateTimeField() + permission_id = models.PositiveBigIntegerField() + user_id = models.PositiveBigIntegerField(blank=True, null=True) + user_ip_address = models.CharField(max_length=100, blank=True, null=True) + + class Meta: + managed = False + db_table = 'wp1d_wc_download_log' + + +class Wp1DWcOrderAddresses(models.Model): + id = models.BigAutoField(primary_key=True) + order_id = models.PositiveBigIntegerField() + address_type = models.CharField(max_length=20, blank=True, null=True) + first_name = models.TextField(blank=True, null=True) + last_name = models.TextField(blank=True, null=True) + company = models.TextField(blank=True, null=True) + address_1 = models.TextField(blank=True, null=True) + address_2 = models.TextField(blank=True, null=True) + city = models.TextField(blank=True, null=True) + state = models.TextField(blank=True, null=True) + postcode = models.TextField(blank=True, null=True) + country = models.TextField(blank=True, null=True) + email = models.CharField(max_length=320, blank=True, null=True) + phone = models.CharField(max_length=100, blank=True, null=True) + + class Meta: + managed = False + db_table = 'wp1d_wc_order_addresses' + unique_together = (('address_type', 'order_id'),) + + +class Wp1DWcOrderCouponLookup(models.Model): + pk = models.CompositePrimaryKey('order_id', 'coupon_id') + order_id = models.PositiveBigIntegerField() + coupon_id = models.BigIntegerField() + date_created = models.DateTimeField() + discount_amount = models.FloatField() + + class Meta: + managed = False + db_table = 'wp1d_wc_order_coupon_lookup' + + +class Wp1DWcOrderOperationalData(models.Model): + id = models.BigAutoField(primary_key=True) + order_id = models.PositiveBigIntegerField(unique=True, blank=True, null=True) + created_via = models.CharField(max_length=100, blank=True, null=True) + woocommerce_version = models.CharField(max_length=20, blank=True, null=True) + prices_include_tax = models.IntegerField(blank=True, null=True) + coupon_usages_are_counted = models.IntegerField(blank=True, null=True) + download_permission_granted = models.IntegerField(blank=True, null=True) + cart_hash = models.CharField(max_length=100, blank=True, null=True) + new_order_email_sent = models.IntegerField(blank=True, null=True) + order_key = models.CharField(max_length=100, blank=True, null=True) + order_stock_reduced = models.IntegerField(blank=True, null=True) + date_paid_gmt = models.DateTimeField(blank=True, null=True) + date_completed_gmt = models.DateTimeField(blank=True, null=True) + shipping_tax_amount = models.DecimalField(max_digits=26, decimal_places=8, blank=True, null=True) + shipping_total_amount = models.DecimalField(max_digits=26, decimal_places=8, blank=True, null=True) + discount_tax_amount = models.DecimalField(max_digits=26, decimal_places=8, blank=True, null=True) + discount_total_amount = models.DecimalField(max_digits=26, decimal_places=8, blank=True, null=True) + recorded_sales = models.IntegerField(blank=True, null=True) + + class Meta: + managed = False + db_table = 'wp1d_wc_order_operational_data' + + +class Wp1DWcOrderProductLookup(models.Model): + order_item_id = models.PositiveBigIntegerField(primary_key=True) + order_id = models.PositiveBigIntegerField() + product_id = models.PositiveBigIntegerField() + variation_id = models.PositiveBigIntegerField() + customer_id = models.PositiveBigIntegerField(blank=True, null=True) + date_created = models.DateTimeField() + product_qty = models.IntegerField() + product_net_revenue = models.FloatField() + product_gross_revenue = models.FloatField() + coupon_amount = models.FloatField() + tax_amount = models.FloatField() + shipping_amount = models.FloatField() + shipping_tax_amount = models.FloatField() + + class Meta: + managed = False + db_table = 'wp1d_wc_order_product_lookup' + + +class Wp1DWcOrderStats(models.Model): + order_id = models.PositiveBigIntegerField(primary_key=True) + parent_id = models.PositiveBigIntegerField() + date_created = models.DateTimeField() + date_created_gmt = models.DateTimeField() + date_paid = models.DateTimeField(blank=True, null=True) + date_completed = models.DateTimeField(blank=True, null=True) + num_items_sold = models.IntegerField() + total_sales = models.FloatField() + tax_total = models.FloatField() + shipping_total = models.FloatField() + net_total = models.FloatField() + returning_customer = models.IntegerField(blank=True, null=True) + status = models.CharField(max_length=200) + customer_id = models.PositiveBigIntegerField() + + class Meta: + managed = False + db_table = 'wp1d_wc_order_stats' + + +class Wp1DWcOrderTaxLookup(models.Model): + pk = models.CompositePrimaryKey('order_id', 'tax_rate_id') + order_id = models.PositiveBigIntegerField() + tax_rate_id = models.PositiveBigIntegerField() + date_created = models.DateTimeField() + shipping_tax = models.FloatField() + order_tax = models.FloatField() + total_tax = models.FloatField() + + class Meta: + managed = False + db_table = 'wp1d_wc_order_tax_lookup' + + +class Wp1DWcOrders(models.Model): + id = models.PositiveBigIntegerField(primary_key=True) + status = models.CharField(max_length=20, blank=True, null=True) + currency = models.CharField(max_length=10, blank=True, null=True) + type = models.CharField(max_length=20, blank=True, null=True) + tax_amount = models.DecimalField(max_digits=26, decimal_places=8, blank=True, null=True) + total_amount = models.DecimalField(max_digits=26, decimal_places=8, blank=True, null=True) + customer_id = models.PositiveBigIntegerField(blank=True, null=True) + billing_email = models.CharField(max_length=320, blank=True, null=True) + date_created_gmt = models.DateTimeField(blank=True, null=True) + date_updated_gmt = models.DateTimeField(blank=True, null=True) + parent_order_id = models.PositiveBigIntegerField(blank=True, null=True) + payment_method = models.CharField(max_length=100, blank=True, null=True) + payment_method_title = models.TextField(blank=True, null=True) + transaction_id = models.CharField(max_length=100, blank=True, null=True) + ip_address = models.CharField(max_length=100, blank=True, null=True) + user_agent = models.TextField(blank=True, null=True) + customer_note = models.TextField(blank=True, null=True) + + class Meta: + managed = False + db_table = 'wp1d_wc_orders' + + +class Wp1DWcOrdersMeta(models.Model): + id = models.BigAutoField(primary_key=True) + order_id = models.PositiveBigIntegerField(blank=True, null=True) + meta_key = models.CharField(max_length=255, blank=True, null=True) + meta_value = models.TextField(blank=True, null=True) + + class Meta: + managed = False + db_table = 'wp1d_wc_orders_meta' + + +class Wp1DWcProductAttributesLookup(models.Model): + pk = models.CompositePrimaryKey('product_or_parent_id', 'term_id', 'product_id', 'taxonomy') + product_id = models.BigIntegerField() + product_or_parent_id = models.BigIntegerField() + taxonomy = models.CharField(max_length=32) + term_id = models.BigIntegerField() + is_variation_attribute = models.IntegerField() + in_stock = models.IntegerField() + + class Meta: + managed = False + db_table = 'wp1d_wc_product_attributes_lookup' + + +class Wp1DWcProductDownloadDirectories(models.Model): + url_id = models.BigAutoField(primary_key=True) + url = models.CharField(max_length=256) + enabled = models.IntegerField() + + class Meta: + managed = False + db_table = 'wp1d_wc_product_download_directories' + + +class Wp1DWcProductMetaLookup(models.Model): + product_id = models.BigIntegerField(primary_key=True) + sku = models.CharField(max_length=100, blank=True, null=True) + global_unique_id = models.CharField(max_length=100, blank=True, null=True) + virtual = models.IntegerField(blank=True, null=True) + downloadable = models.IntegerField(blank=True, null=True) + min_price = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True) + max_price = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True) + onsale = models.IntegerField(blank=True, null=True) + stock_quantity = models.FloatField(blank=True, null=True) + stock_status = models.CharField(max_length=100, blank=True, null=True) + rating_count = models.BigIntegerField(blank=True, null=True) + average_rating = models.DecimalField(max_digits=3, decimal_places=2, blank=True, null=True) + total_sales = models.BigIntegerField(blank=True, null=True) + tax_status = models.CharField(max_length=100, blank=True, null=True) + tax_class = models.CharField(max_length=100, blank=True, null=True) + + class Meta: + managed = False + db_table = 'wp1d_wc_product_meta_lookup' + + +class Wp1DWcRateLimits(models.Model): + rate_limit_id = models.BigAutoField(primary_key=True) + rate_limit_key = models.CharField(unique=True, max_length=200) + rate_limit_expiry = models.PositiveBigIntegerField() + rate_limit_remaining = models.SmallIntegerField() + + class Meta: + managed = False + db_table = 'wp1d_wc_rate_limits' + + +class Wp1DWcReservedStock(models.Model): + pk = models.CompositePrimaryKey('order_id', 'product_id') + order_id = models.BigIntegerField() + product_id = models.BigIntegerField() + stock_quantity = models.FloatField() + timestamp = models.DateTimeField() + expires = models.DateTimeField() + + class Meta: + managed = False + db_table = 'wp1d_wc_reserved_stock' + + +class Wp1DWcTaxRateClasses(models.Model): + tax_rate_class_id = models.BigAutoField(primary_key=True) + name = models.CharField(max_length=200) + slug = models.CharField(unique=True, max_length=200) + + class Meta: + managed = False + db_table = 'wp1d_wc_tax_rate_classes' + + +class Wp1DWcWebhooks(models.Model): + webhook_id = models.BigAutoField(primary_key=True) + status = models.CharField(max_length=200) + name = models.TextField() + user_id = models.PositiveBigIntegerField() + delivery_url = models.TextField() + secret = models.TextField() + topic = models.CharField(max_length=200) + date_created = models.DateTimeField() + date_created_gmt = models.DateTimeField() + date_modified = models.DateTimeField() + date_modified_gmt = models.DateTimeField() + api_version = models.SmallIntegerField() + failure_count = models.SmallIntegerField() + pending_delivery = models.IntegerField() + + class Meta: + managed = False + db_table = 'wp1d_wc_webhooks' + + +class Wp1DWoocommerceApiKeys(models.Model): + key_id = models.BigAutoField(primary_key=True) + user_id = models.PositiveBigIntegerField() + description = models.CharField(max_length=200, blank=True, null=True) + permissions = models.CharField(max_length=10) + consumer_key = models.CharField(max_length=64) + consumer_secret = models.CharField(max_length=43) + nonces = models.TextField(blank=True, null=True) + truncated_key = models.CharField(max_length=7) + last_access = models.DateTimeField(blank=True, null=True) + + class Meta: + managed = False + db_table = 'wp1d_woocommerce_api_keys' + + +class Wp1DWoocommerceAttributeTaxonomies(models.Model): + attribute_id = models.BigAutoField(primary_key=True) + attribute_name = models.CharField(max_length=200) + attribute_label = models.CharField(max_length=200, blank=True, null=True) + attribute_type = models.CharField(max_length=20) + attribute_orderby = models.CharField(max_length=20) + attribute_public = models.IntegerField() + + class Meta: + managed = False + db_table = 'wp1d_woocommerce_attribute_taxonomies' + + +class Wp1DWoocommerceDownloadableProductPermissions(models.Model): + permission_id = models.BigAutoField(primary_key=True) + download_id = models.CharField(max_length=36) + product_id = models.PositiveBigIntegerField() + order_id = models.PositiveBigIntegerField() + order_key = models.CharField(max_length=200) + user_email = models.CharField(max_length=200) + user_id = models.PositiveBigIntegerField(blank=True, null=True) + downloads_remaining = models.CharField(max_length=9, blank=True, null=True) + access_granted = models.DateTimeField() + access_expires = models.DateTimeField(blank=True, null=True) + download_count = models.PositiveBigIntegerField() + + class Meta: + managed = False + db_table = 'wp1d_woocommerce_downloadable_product_permissions' + + +class Wp1DWoocommerceLog(models.Model): + log_id = models.BigAutoField(primary_key=True) + timestamp = models.DateTimeField() + level = models.SmallIntegerField() + source = models.CharField(max_length=200) + message = models.TextField() + context = models.TextField(blank=True, null=True) + + class Meta: + managed = False + db_table = 'wp1d_woocommerce_log' + + +class Wp1DWoocommerceOrderItemmeta(models.Model): + meta_id = models.BigAutoField(primary_key=True) + order_item_id = models.PositiveBigIntegerField() + meta_key = models.CharField(max_length=255, blank=True, null=True) + meta_value = models.TextField(blank=True, null=True) + + class Meta: + managed = False + db_table = 'wp1d_woocommerce_order_itemmeta' + + +class Wp1DWoocommerceOrderItems(models.Model): + order_item_id = models.BigAutoField(primary_key=True) + order_item_name = models.TextField() + order_item_type = models.CharField(max_length=200) + order_id = models.PositiveBigIntegerField() + + class Meta: + managed = False + db_table = 'wp1d_woocommerce_order_items' + + +class Wp1DWoocommercePaymentTokenmeta(models.Model): + meta_id = models.BigAutoField(primary_key=True) + payment_token_id = models.PositiveBigIntegerField() + meta_key = models.CharField(max_length=255, blank=True, null=True) + meta_value = models.TextField(blank=True, null=True) + + class Meta: + managed = False + db_table = 'wp1d_woocommerce_payment_tokenmeta' + + +class Wp1DWoocommercePaymentTokens(models.Model): + token_id = models.BigAutoField(primary_key=True) + gateway_id = models.CharField(max_length=200) + token = models.TextField() + user_id = models.PositiveBigIntegerField() + type = models.CharField(max_length=200) + is_default = models.IntegerField() + + class Meta: + managed = False + db_table = 'wp1d_woocommerce_payment_tokens' + + +class Wp1DWoocommerceSessions(models.Model): + session_id = models.BigAutoField(primary_key=True) + session_key = models.CharField(unique=True, max_length=32) + session_value = models.TextField() + session_expiry = models.PositiveBigIntegerField() + + class Meta: + managed = False + db_table = 'wp1d_woocommerce_sessions' + + +class Wp1DWoocommerceShippingZoneLocations(models.Model): + location_id = models.BigAutoField(primary_key=True) + zone_id = models.PositiveBigIntegerField() + location_code = models.CharField(max_length=200) + location_type = models.CharField(max_length=40) + + class Meta: + managed = False + db_table = 'wp1d_woocommerce_shipping_zone_locations' + + +class Wp1DWoocommerceShippingZoneMethods(models.Model): + zone_id = models.PositiveBigIntegerField() + instance_id = models.BigAutoField(primary_key=True) + method_id = models.CharField(max_length=200) + method_order = models.PositiveBigIntegerField() + is_enabled = models.IntegerField() + + class Meta: + managed = False + db_table = 'wp1d_woocommerce_shipping_zone_methods' + + +class Wp1DWoocommerceShippingZones(models.Model): + zone_id = models.BigAutoField(primary_key=True) + zone_name = models.CharField(max_length=200) + zone_order = models.PositiveBigIntegerField() + + class Meta: + managed = False + db_table = 'wp1d_woocommerce_shipping_zones' + + +class Wp1DWoocommerceTaxRateLocations(models.Model): + location_id = models.BigAutoField(primary_key=True) + location_code = models.CharField(max_length=200) + tax_rate_id = models.PositiveBigIntegerField() + location_type = models.CharField(max_length=40) + + class Meta: + managed = False + db_table = 'wp1d_woocommerce_tax_rate_locations' + + +class Wp1DWoocommerceTaxRates(models.Model): + tax_rate_id = models.BigAutoField(primary_key=True) + tax_rate_country = models.CharField(max_length=2) + tax_rate_state = models.CharField(max_length=200) + tax_rate = models.CharField(max_length=8) + tax_rate_name = models.CharField(max_length=200) + tax_rate_priority = models.PositiveBigIntegerField() + tax_rate_compound = models.IntegerField() + tax_rate_shipping = models.IntegerField() + tax_rate_order = models.PositiveBigIntegerField() + tax_rate_class = models.CharField(max_length=200) + + class Meta: + managed = False + db_table = 'wp1d_woocommerce_tax_rates' + + +class Wp1DWpcbFolders(models.Model): + name = models.CharField(max_length=150) + savedtocloud = models.SmallIntegerField(db_column='savedToCloud') # Field name made lowercase. + remoteid = models.IntegerField(db_column='remoteId') # Field name made lowercase. + folder_order = models.IntegerField() + + class Meta: + managed = False + db_table = 'wp1d_wpcb_folders' + + +class Wp1DWpcbSnippets(models.Model): + title = models.CharField(max_length=100) + description = models.TextField() + enabled = models.IntegerField() + priority = models.IntegerField() + runtype = models.CharField(db_column='runType', max_length=100) # Field name made lowercase. + code = models.TextField() + original_code = models.TextField() + codetype = models.CharField(db_column='codeType', max_length=100) # Field name made lowercase. + conditions = models.TextField() + location = models.CharField(max_length=20) + tagoptions = models.CharField(db_column='tagOptions', max_length=100) # Field name made lowercase. + hook = models.CharField(max_length=1000) + rendertype = models.CharField(db_column='renderType', max_length=20, blank=True, null=True) # Field name made lowercase. + minify = models.IntegerField() + snippet_order = models.IntegerField() + addtoquickactions = models.SmallIntegerField(db_column='addToQuickActions') # Field name made lowercase. + savedtocloud = models.SmallIntegerField(db_column='savedToCloud') # Field name made lowercase. + remoteid = models.IntegerField(db_column='remoteId') # Field name made lowercase. + externalurl = models.SmallIntegerField(db_column='externalUrl') # Field name made lowercase. + secret = models.CharField(max_length=50) + folderid = models.IntegerField(db_column='folderId') # Field name made lowercase. + error = models.IntegerField() + errormessage = models.TextField(db_column='errorMessage') # Field name made lowercase. + errortrace = models.TextField(db_column='errorTrace') # Field name made lowercase. + errorline = models.IntegerField(db_column='errorLine') # Field name made lowercase. + devmode = models.SmallIntegerField(db_column='devMode') # Field name made lowercase. + lastmodified = models.CharField(db_column='lastModified', max_length=100) # Field name made lowercase. + + class Meta: + managed = False + db_table = 'wp1d_wpcb_snippets' + + +class Wp1DWpsmtpLogs(models.Model): + mail_id = models.AutoField(primary_key=True) + timestamp = models.DateTimeField() + to = models.CharField(max_length=200) + subject = models.CharField(max_length=200) + message = models.TextField(blank=True, null=True) + headers = models.TextField(blank=True, null=True) + error = models.TextField(blank=True, null=True) + + class Meta: + managed = False + db_table = 'wp1d_wpsmtp_logs' + + +class Wp1DWpvividOptions(models.Model): + option_id = models.BigAutoField(primary_key=True) + option_name = models.CharField(unique=True, max_length=191) + option_value = models.TextField() + + class Meta: + managed = False + db_table = 'wp1d_wpvivid_options' + + +class Wp1DWpvividScanResult(models.Model): + id = models.BigAutoField(primary_key=True) + path = models.TextField() + from_post = models.IntegerField() + + class Meta: + managed = False + db_table = 'wp1d_wpvivid_scan_result' + + +class Wp1DWpvividUnusedUploadsFiles(models.Model): + id = models.BigAutoField(primary_key=True) + path = models.TextField() + folder = models.TextField() + + class Meta: + managed = False + db_table = 'wp1d_wpvivid_unused_uploads_files' + + +class Wp1DYoastIndexable(models.Model): + permalink = models.TextField(blank=True, null=True) + permalink_hash = models.CharField(max_length=40, blank=True, null=True) + object_id = models.BigIntegerField(blank=True, null=True) + object_type = models.CharField(max_length=32) + object_sub_type = models.CharField(max_length=32, blank=True, null=True) + author_id = models.BigIntegerField(blank=True, null=True) + post_parent = models.BigIntegerField(blank=True, null=True) + title = models.TextField(blank=True, null=True) + description = models.TextField(blank=True, null=True) + breadcrumb_title = models.TextField(blank=True, null=True) + post_status = models.CharField(max_length=20, blank=True, null=True) + is_public = models.IntegerField(blank=True, null=True) + is_protected = models.IntegerField(blank=True, null=True) + has_public_posts = models.IntegerField(blank=True, null=True) + number_of_pages = models.PositiveIntegerField(blank=True, null=True) + canonical = models.TextField(blank=True, null=True) + primary_focus_keyword = models.CharField(max_length=191, blank=True, null=True) + primary_focus_keyword_score = models.IntegerField(blank=True, null=True) + readability_score = models.IntegerField(blank=True, null=True) + is_cornerstone = models.IntegerField(blank=True, null=True) + is_robots_noindex = models.IntegerField(blank=True, null=True) + is_robots_nofollow = models.IntegerField(blank=True, null=True) + is_robots_noarchive = models.IntegerField(blank=True, null=True) + is_robots_noimageindex = models.IntegerField(blank=True, null=True) + is_robots_nosnippet = models.IntegerField(blank=True, null=True) + twitter_title = models.TextField(blank=True, null=True) + twitter_image = models.TextField(blank=True, null=True) + twitter_description = models.TextField(blank=True, null=True) + twitter_image_id = models.CharField(max_length=191, blank=True, null=True) + twitter_image_source = models.TextField(blank=True, null=True) + open_graph_title = models.TextField(blank=True, null=True) + open_graph_description = models.TextField(blank=True, null=True) + open_graph_image = models.TextField(blank=True, null=True) + open_graph_image_id = models.CharField(max_length=191, blank=True, null=True) + open_graph_image_source = models.TextField(blank=True, null=True) + open_graph_image_meta = models.TextField(blank=True, null=True) + link_count = models.IntegerField(blank=True, null=True) + incoming_link_count = models.IntegerField(blank=True, null=True) + prominent_words_version = models.PositiveIntegerField(blank=True, null=True) + created_at = models.DateTimeField(blank=True, null=True) + updated_at = models.DateTimeField() + blog_id = models.BigIntegerField() + language = models.CharField(max_length=32, blank=True, null=True) + region = models.CharField(max_length=32, blank=True, null=True) + schema_page_type = models.CharField(max_length=64, blank=True, null=True) + schema_article_type = models.CharField(max_length=64, blank=True, null=True) + has_ancestors = models.IntegerField(blank=True, null=True) + estimated_reading_time_minutes = models.IntegerField(blank=True, null=True) + version = models.IntegerField(blank=True, null=True) + object_last_modified = models.DateTimeField(blank=True, null=True) + object_published_at = models.DateTimeField(blank=True, null=True) + inclusive_language_score = models.IntegerField(blank=True, null=True) + + class Meta: + managed = False + db_table = 'wp1d_yoast_indexable' + + +class Wp1DYoastIndexableHierarchy(models.Model): + pk = models.CompositePrimaryKey('indexable_id', 'ancestor_id') + indexable_id = models.PositiveIntegerField() + ancestor_id = models.PositiveIntegerField() + depth = models.PositiveIntegerField(blank=True, null=True) + blog_id = models.BigIntegerField() + + class Meta: + managed = False + db_table = 'wp1d_yoast_indexable_hierarchy' + + +class Wp1DYoastMigrations(models.Model): + version = models.CharField(unique=True, max_length=191, blank=True, null=True) + + class Meta: + managed = False + db_table = 'wp1d_yoast_migrations' + + +class Wp1DYoastPrimaryTerm(models.Model): + post_id = models.BigIntegerField(blank=True, null=True) + term_id = models.BigIntegerField(blank=True, null=True) + taxonomy = models.CharField(max_length=32) + created_at = models.DateTimeField(blank=True, null=True) + updated_at = models.DateTimeField() + blog_id = models.BigIntegerField() + + class Meta: + managed = False + db_table = 'wp1d_yoast_primary_term' + + +class Wp1DYoastSeoLinks(models.Model): + id = models.BigAutoField(primary_key=True) + url = models.CharField(max_length=255, blank=True, null=True) + post_id = models.PositiveBigIntegerField(blank=True, null=True) + target_post_id = models.PositiveBigIntegerField(blank=True, null=True) + type = models.CharField(max_length=8, blank=True, null=True) + indexable_id = models.PositiveIntegerField(blank=True, null=True) + target_indexable_id = models.PositiveIntegerField(blank=True, null=True) + height = models.PositiveIntegerField(blank=True, null=True) + width = models.PositiveIntegerField(blank=True, null=True) + size = models.PositiveIntegerField(blank=True, null=True) + language = models.CharField(max_length=32, blank=True, null=True) + region = models.CharField(max_length=32, blank=True, null=True) + + class Meta: + managed = False + db_table = 'wp1d_yoast_seo_links' diff --git a/wordpress_api/serializers.py b/wordpress_api/serializers.py new file mode 100644 index 0000000000000000000000000000000000000000..a1b5f605f27abfab738a4d2d6b80cbbe2dd40dcc --- /dev/null +++ b/wordpress_api/serializers.py @@ -0,0 +1,34 @@ +from rest_framework import serializers +from .models import Wp1DUsers, Wp1DUsermeta + +class Wp1DUsermetaSerializer(serializers.ModelSerializer): + class Meta: + model = Wp1DUsermeta + fields = ['meta_key', 'meta_value'] + +class Wp1DUsersSerializer(serializers.ModelSerializer): + # To include specific metadata directly or handle it differently + # For simplicity, we'll fetch metadata separately in the view for now, + # but DRF has ways to nest serializers or use SerializerMethodField. + + class Meta: + model = Wp1DUsers + fields = [ + 'id', 'user_login', 'user_nicename', 'user_email', + 'user_url', 'user_registered', 'display_name' + ] + +class WpUserDetailSerializer(serializers.ModelSerializer): + metadata = serializers.SerializerMethodField() + + class Meta: + model = Wp1DUsers + fields = [ + 'id', 'user_login', 'user_nicename', 'user_email', + 'user_url', 'user_registered', 'display_name', 'metadata' + ] + + def get_metadata(self, obj): + # obj is a Wp1DUsers instance + meta_queryset = WpUsermeta.objects.filter(user=obj) + return {meta.meta_key: meta.meta_value for meta in meta_queryset} \ No newline at end of file diff --git a/wordpress_api/tests.py b/wordpress_api/tests.py new file mode 100644 index 0000000000000000000000000000000000000000..de8bdc00eb2fed53494a534d48e400faa830dbd9 --- /dev/null +++ b/wordpress_api/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/wordpress_api/urls.py b/wordpress_api/urls.py new file mode 100644 index 0000000000000000000000000000000000000000..205ee6d1b60d758b786ec41ac611462928745f73 --- /dev/null +++ b/wordpress_api/urls.py @@ -0,0 +1,14 @@ +# wordpress_api/urls.py +from django.urls import path +# from .views import get_all_users, get_user_details # For JsonResponse method +from .views import UserListAPIView, UserDetailAPIView # For DRF method + +urlpatterns = [ + # For JsonResponse method: + # path('users/', get_all_users, name='wp_user_list'), + # path('users//', get_user_details, name='wp_user_detail'), + + # For DRF method: + path('users/', UserListAPIView.as_view(), name='wp_user_list_drf'), + path('users//', UserDetailAPIView.as_view(), name='wp_user_detail_drf'), +] diff --git a/wordpress_api/views.py b/wordpress_api/views.py new file mode 100644 index 0000000000000000000000000000000000000000..9eb696b9437f1cd66234a0b7d26a89d29dc05968 --- /dev/null +++ b/wordpress_api/views.py @@ -0,0 +1,32 @@ +from .models import Wp1DUsers # Update import +from .serializers import Wp1DUsersSerializer, WpUserDetailSerializer +from rest_framework.views import APIView +from rest_framework.response import Response +from rest_framework import status + +class UserListAPIView(APIView): + """ + API endpoint to list all WordPress users (using DRF). + """ + def get(self, request, format=None): + users = Wp1DUsers.objects.all() + serializer = Wp1DUsersSerializer(users, many=True) + return Response(serializer.data) + +class UserDetailAPIView(APIView): + """ + API endpoint to retrieve a single WordPress user's details (using DRF). + """ + def get_object(self, user_id): + try: + return Wp1DUsers.objects.get(id=user_id) + except Wp1DUsers.DoesNotExist: + return None + + def get(self, request, user_id, format=None): + user = self.get_object(user_id) + if user is None: + return Response({'error': 'User not found'}, status=status.HTTP_404_NOT_FOUND) + + serializer = WpUserDetailSerializer(user) + return Response(serializer.data)