Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
How to display manual action to "History" in admin django?
I followed this tutorial : https://docs.djangoproject.com/en/2.2/ref/contrib/admin/actions/ And i cant't see log about this action in to History.(But changed,.. default actions of django admin can show blog on there) How can i add log to History like 'User_1 Make published' ? Thank you so much. -
NoReverseMatch UpdateView
I am writing and Update View for a model that I have created. The model is a Product Backlog Item. The UpdateView is unable to find a reverse match for my view. UpdatePBI View pk_url_kwarg = 'pbipk' kwargs={'pk_url_kwarg': 'pbipk'} model = PBI fields = ['priority', 'summary', 'story_points', 'effort_hours'] login_url = '/accounts/login' redirect_field_name = '/home' template_name = 'backtrack/PBIdetail.html' def dispatch(self, request, *args, **kwargs): print(kwargs) return super().dispatch(request, *args, **kwargs) def get_success_url(self): return "{}?all=0".format(reverse('pb', kwargs={'pk': self.kwargs['pk']})) def get_object(self, queryset=None): obj = get_object_or_404(self.model,pk=self.kwargs['pbipk']) return obj def form_valid(self, form): PBIList = getPBIfromProj(self.kwargs['pk'], '0') remove = [] priorityData = form.cleaned_data['priority'] if int(priorityData) < self.object.priority: # Remove all PBI with priority higher than post data priority # and lesser or equal than current PBI priority for PBIObj in PBIList: if PBIObj.priority < int(priorityData) or PBIObj.priority >= self.object.priority: remove.append(PBIObj.priority) PBIList = [ PBIObj for PBIObj in PBIList if PBIObj.priority not in remove] # Increase each objects priority by one for PBIObj in PBIList: PBIObj.priority += 1 PBIObj.save() else: # Remove all PBI with priority higher than post PBI priority # and lesser than and equal to Post data priority for PBIObj in PBIList: if PBIObj.priority <= self.object.priority or PBIObj.priority > int(priorityData): remove.append(PBIObj.priority) PBIList = [ PBIObj for PBIObj … -
How To Crop Django Media Image Automatically And Post
How To Crop Django Media Image Automatically And Post i don't want to crop with humans if someone upload any image our back-end crop it specific-size and post it Any Help: Appreciated!! -
How to display something in a django template according to which user is logged in?
I am displaying a table in a django template, and I have 2 identical templates but with 2 different tables. I have 2 different user groups. I want to display a different template according to which auth group the user belongs to. For example: if user is in group A: render template1.html else if user is in group B: render template2.html All I know right now is that I used the @login_required decorator, so the view is not gonna be shown if the user is not logged in. But this includes all users, and is not specific to groups. def home(request): ecv_count = Dossier.objects.filter(status_admin='ECV').count() v_count = Dossier.objects.filter(status_admin='V').count() r_count = Dossier.objects.filter(status_admin='R').count() c_count = Dossier.objects.filter(status_admin='C').count() context = { 'dossiers': Dossier.objects.all(), 'ecv_count': ecv_count, 'v_count': v_count, 'r_count': r_count, 'c_count': c_count } return render(request, 'dashboard/home.html', context) I want to have the view check the user group, and render a different template with a different context. -
Django Json Field - Find objects hat do not have key
I have a Model with a JSON Field. data = JSONField(default=dict) Is there an efficient way - or queryset filter - to find all instances of this Model that do not have a speicfic key in the json field. Django documentation includes has_key function for JSON field. Essentially i'm looking for a way to do not_has_key My current method: queryset = MyObj.objects.all() for obj in queryset: if 'my_key' not in obj.data: do_work() else: pass #key_already_exists Many thanks -
django nested query or join two tables
I list the debts of my customers from the "debts" table with the following code. However, I would like to see the name and surname of the customer with the same ID number from the "Customer" table. I get the person I specified with the following code but; I cannot print to "Debts.objects.values (" customer ")". Is there an easy way to do this? Thanks for your help. class CustomerDetailDebtListAPIView(ListAPIView): serializer_class = DebtCreateSerializer def get(self, request): # get customer , customerKey obj_customer = Customer.objects.get(customer=85) field_object_customer = Customer._meta.get_field('customer') # field_value_customer = getattr(obj_customer, field_object_customer.attname) print(obj_customer) result = Debt.objects.values('customer') \ .annotate(totalDebt=Sum('totalDebt'), receivedAmount=Sum('receivedAmount')) \ .order_by('customer') return Response(result) -
Django form post contains multiple(2) csrfmiddlewaretoken in the request
I am trying to make a Django post request using a form but when I inspect the request, two csrfmiddlewaretoken are available on the request. Could someone explain to me why this might happen and how to prevent the duplication?? -
python django how to store images for streaming them as background image of bokeh plot
Im working on a live viewer. It also has to stream images as a background picture of plot/chart. These images are stored atm in a folder as jpg. Now my colleagues want to store them in a mongodb. I think this is not the correct way for storing and streaming images (1 per sec). If reciving from db : take picture convert to binary save to db read from db convert back to jpg stream to frontend The 2 converting steps are uneeded when doing it this way: take picture save to folder read from folder stream to frontend Any reason why the first way should be acceptable and why the second way is not better then the first? -
How to make a <select> through Django ModelChoiceField
I have a that is rendered manually. I want to remake it through Django ModelChoiceField.How to do it? views.py contractors = cache.get('contractors') if not contractors: contractors = Contractors.objects.values_list('name', flat='True') cache.set('contractors', contractors, 3600) Html-code <select name="contractorName" class="form-control" id="id_contractorName"> option value="" selected="">---</option> {% for contractor in contractors %} <option value="{{ contractor }}">{{ contractor }}</option> {% endfor %} </select> models.py class Contractors(models.Model): id = models.IntegerField(blank=True, null=False, primary_key=True) name = models.CharField(max_length=255, blank=True, null=True) class Meta: managed = False db_table = '"processing"."contractor"' forms.py class SearchForm(forms.Form): date1st = forms.DateField(required=False) date2st = forms.DateField(required=False) numberPayment = forms.CharField(required=False) numberPhone = PhoneNumberField(region='RU', required=False) #contractorName = forms.ModelChoiceField(queryset=Contractors.objects.values_list('name', flat='True'), required=False) status = forms.ChoiceField(choices=(('', '----'),("success", "success"), ("decline", "decline"), ("refund", "refund")), required=False) -
Name server for a virtual server (Ubuntu)
I have a Django project and Apache 2 web-server on Ubuntu server but it is a virtual server. I bought a domain and I want to point it to my virtual server. I tried adding their main name servers but it didn't work so what should I do now and how can find my virtual servers's name server -
Not able to fetch data from database GET /favicon.ico HTTP/1.1
I m building a website for grocery store(Pyshop) i have created ten items using sq-lite but when i m trying to retrieve names of products i m not able to do it. This is the Pyshop >>urls.py. In this i have added address of product path('products/', include('products.urls')), In settings.py i have also added 'products.apps.ProductsConfig' in installed apps. In this we have created 2 models. one is Product and second is offer.In Product we are storing name,price, stock and an url for image.In offer I have code,description and discount. i tried reading about favicon.ico error but i m not able to understand why this error occurs and how to resolve the problem. Product>>urls.py In urls.py of product i have added views addresss. from django.urls import path from . import views urlpatterns = [ path('', views.index), path('new', views.new) ] Products>>views.py In views i have created two function index and offer.As models.py is in the current directory thats why we r using.models.In index i m trying to get all the items in products and then display price and name. from django.shortcuts import render from .models import Product from django.http import HttpResponse def index(request): products = Product.objects.all() return render(request, 'index.html', {'Products': products}) def new(request): … -
How to create query in Django model for PST time zone if default time is UTC
I am using the Django model to store my order details and I enabled the timezone with UTC time so the order date stored in database is UTC time. then I am using a model query to output the last 30 days order quantity by datewise and it is working great and they give me order quantity datewise by UTC time. I need to how can I get the last 30 days order quantity by PST time using model query. Order.objects.filter( purchase_date__lte=datetime.today(), purchase_date__gt=datetime.today() - timedelta(days=30) ) .values("purchase_date__date") .annotate( amount_s=Sum("amount"), quantity_s=Sum("quantity") ).order_by("purchase_date__date") Above query give me the datewise order quantity in UTC time. what can I do get order quantity in PST time. -
Jquery to select a table row on click doesn't work
I'm trying to toggle the class "highlight" of a html table row on click using JQuery. The table is created using Django template language. The table works and shows up in my development server and the Jquery works on tables not created with Django template language. I don't get any errors when running the code, but it just doesn't do anything when i click on a table row. I'm not sure what The problem could be. HTML <style media="screen"> .highlight { background-color: yellow; color: white; } </style> <div class="table-responsive"> <table class="table table table-borderless" id="food_table"> <thead> <tr> <th>#</th> <th>Description</th> <th>Price</th> </tr> </thead> <tbody> {% for order in orders %} <tr> <td>{{ order.pk }}</td> <td>{{ order.Price }}</td> <td>{{ order.Description }}</td> </tr> {% endfor %} </tbody> </table> </div> JQuery $("#food_table tbody").on('click','tr',function() { $(this).toggleClass("highlight"); }); Dummy Data [ { "pk": 9, "Description": "Pizza", "Price": "88.00" }, { "pk": 10, "Description": "Steak", "Price": "130.50" }, { "pk": 11, "Description": "Coca Cola", "Price": "25.95" }, { "pk": 12, "Description": "Water", "Price": "15.00" } ] -
How to filter RawQuerySet in Django?
I have a request that is most likely not to be done via Djangor ORM, so I am making a raw SQL query. I have a search by time period and a few more parameters. How can I make a request to RawQuerySet to filter it? Like this: paymentsss = Transaction.objects.all().select_related('currency', 'payment_source__payment_type', 'deal__service', 'deal__service__contractor').filter( payment_date__range=[date1, date2],).order_by('-id') I tried to use filter() and extra(), but it doesn't work. My query: SELECT "processing"."transaction"."id", "processing"."transaction"."currency_id", "processing"."transaction"."deal_id", "processing"."transaction"."payment_source_id", "processing"."transaction"."payment_date", "processing"."transaction"."amount", "processing"."transaction"."status", "processing"."transaction"."context", "processing"."currency"."id", "processing"."currency"."iso_name", "processing"."currency"."minor_unit", "processing"."deal"."id", "processing"."deal"."service_id", "processing"."deal"."currency_id", "processing"."service"."id", "processing"."service"."contractor_id", "processing"."service"."name", "processing"."service"."description", "processing"."contractor"."id", "processing"."contractor"."name", "ps"."id", "ps"."payment_type_id", "ps"."source_details", "processing"."payment_type"."id", "processing"."payment_type"."name", "psc"."source_details" FROM "processing"."transaction" LEFT OUTER JOIN "processing"."currency" ON ("processing"."transaction"."currency_id" = "processing"."currency"."id") LEFT OUTER JOIN "processing"."deal" ON ("processing"."transaction"."deal_id" = "processing"."deal"."id") LEFT OUTER JOIN "processing"."service" ON ("processing"."deal"."service_id" = "processing"."service"."id") LEFT OUTER JOIN "processing"."contractor" ON ("processing"."service"."contractor_id" = "processing"."contractor"."id") LEFT OUTER JOIN "processing"."payer_payment_source" AS "ps" ON ("processing"."transaction"."payment_source_id" = "ps"."id") LEFT OUTER JOIN "processing"."payment_type" ON ("ps"."payment_type_id" = "processing"."payment_type"."id") LEFT OUTER JOIN "processing"."payer_payment_source" AS "psc" ON ("ps"."payer_id" = "psc"."payer_id") AND "psc"."payment_type_id" = 'bank_card_details' -
Showing fields of related m2o objects in django-admin
I have model Job which is shown using modelAdmin. And also I have stop model: class Stop(models.Model): ... job = models.ForeignKey(to=Job, ...) stop_number = ... ... Job can have from 2 to 3 stops. I've tried to show first and second stop names using: @admin.register(Job) class JobAdmin(admin.ModelAdmin): def stop_1(self, obj): stop = self.stop_set.objects.get(stop_number=1) return stop.name def stop_2(self, obj): stop = self.stop_set.objects.get(stop_number=2) return stop.name list_display = ('stop_1', 'stop_2', ...) But it does many SQL queries on each list view rendering and makes it way too slow. Is there a way to query needed info in single or just few queries? -
When receiver has been garbage collected in signal?
I try to use Signal in Django, when I read document about method connect signal, it have weak parameter as following: weak – Django stores signal handlers as weak references by default. Thus, if your receiver is a local function, it may be garbage collected. To prevent this, pass weak=False when you call the signal’s connect() method. I don't know when local function has been garbage collected? -
extra_actions = viewset.get_extra_actions() AttributeError: 'function' object has no attribute 'get_extra_actions'
Error Occurs while using router if i avoid router it didnt raise Error urls.py ''' from rest_framework.routers import SimpleRouter from django.urls import path,include from . import views router = SimpleRouter() router.register('view-client', views.Client_view.as_view(), base_name='view') urlpatterns = [ path('', include(router.urls),), path('<int:pk>/create-client', views.Client_view.as_view()), path('<int:pk>/delete-client', views.Client_view .as_view()), path('auth/login/', views.LoginView.as_view()), path('auth/logout/', views.LogoutView.as_view()), ] ''' View.py ''' class Client_view(generics.ListCreateAPIView, generics.RetrieveUpdateDestroyAPIView): authentication_classes = [SessionAuthentication, BasicAuthentication, TokenAuthentication] permission_classes = [IsAuthenticated] queryset = Client.objects.all() serializer_class = ClientSerializer ''' -
how i can appear all my search result using Paginator in django?
i have added Paginator to search result in django okay ? and i put show 2 item in page and i have 8 item in page but when i do a search in website it's show 2 item okay and show to me 4 pages i can move to it but when i press on page 2 or 3 or 4 it's doesn't show anything why ? view.py : def search(request): if request.method == 'GET': query= request.GET.get('q') submitbutton= request.GET.get('submit') if query is not None: home_database= Homepage.objects.filter(Q(name__icontains=query) | Q(app_contect__icontains=query) | Q(page_url__icontains=query) | Q(app_image__icontains=query)) pcprograms_database= PCprogram.objects.filter(Q(name__icontains=query) | Q(app_contect__icontains=query) | Q(page_url__icontains=query) | Q(app_image__icontains=query)) androidapk_database= AndroidApks.objects.filter(Q(name__icontains=query) | Q(app_contect__icontains=query) | Q(page_url__icontains=query) | Q(app_image__icontains=query)) androidgames_database= AndroidGames.objects.filter(Q(name__icontains=query) | Q(app_contect__icontains=query) | Q(page_url__icontains=query) | Q(app_image__icontains=query)) antiruvs_database= Antivirus.objects.filter(Q(name__icontains=query) | Q(app_contect__icontains=query) | Q(page_url__icontains=query) | Q(app_image__icontains=query)) systems_database= OpratingSystems.objects.filter(Q(name__icontains=query) | Q(app_contect__icontains=query) | Q(page_url__icontains=query) | Q(app_image__icontains=query)) pcgames_database= PCgames.objects.filter(Q(name__icontains=query) | Q(app_contect__icontains=query) | Q(page_url__icontains=query) | Q(app_image__icontains=query)) results= list(chain(home_database,pcprograms_database,androidapk_database,androidgames_database,antiruvs_database,systems_database,pcgames_database)) paginator = Paginator(results, 2) # Show 25 rows per page page = request.GET.get('?q={{ request.GET.q }}&submit=Search') results = paginator.get_page(page) context={'results': results, 'submitbutton': submitbutton} return render(request, 'html_file/enterface.html', context) else: return render(request, 'html_file/enterface.html') else: return render(request, 'html_file/enterface.html') html file : {% if submitbutton == 'Search' and request.GET.q != '' %} {% if results %} <h1> <small> Results for <b><i>{{ request.GET.q }}</i></b></small> … -
New Relic for Heroku Django App - No data Sent to the New Relic
After Installing New Relic add-on and python client on Heroku (Django app), no data sent out to new relic even after making a lot of transactions and waiting more than one hour. Can any one support by listing down the exact steps to be followed in order to setup new relic apm successfully on Heroku for dajngo app, starting from adding the add-on till checking the transaction on New Relic. Below is the result of new relic diagnostic tool: ./nrdiag Check Results Info Base/Env/CollectEnvVars [Gathered Environment variables of current shell.] Success Base/Config/Collect Success Base/Config/Validate Failure Base/Log/Copy Success Base/Config/LicenseKey Info Base/Env/HostInfo [9dc9844b-15bd-4801-8cea-b59be8adee41] Info Base/Config/RegionDetect [1 unique New Relic region(s) detected from config.] Success Base/Collector/ConnectUS Success Python/Config/Agent Info Python/Env/Version [3.7.0] Info Python/Env/Dependencies [Collected pip freeze. See pipFreeze.txt for more i...] Success Python/Requirements/Webframework Error Base/Env/InitSystem Failure Python/Requirements/PythonVersion 61 results not shown: 61 None See nrdiag-output.json for full results. Issues Found Failure - Base/Log/Copy Log File not found, please check working directory See https://docs.newrelic.com/docs/new-relic-diagnostics#run-diagnostics for more information. Error - Base/Env/InitSystem Unable to read symbolic link for /sbin/init: lstat /sbin/init: no such file or directory Failure - Python/Requirements/PythonVersion Python version is not compatible. See https://docs.newrelic.com/docs/agents/python-agent/getting-started/compatibility-requirements-python-agent#basic for more information. -
How can i get comment pk in reply form.is_valid() in same DetailView page
models.py ''' class Comment(models.Model): post = models.ForeignKey(Post, on_delete=models.CASCADE, related_name='comments') author = models.ForeignKey(User, on_delete=models.CASCADE) text = models.TextField(max_length=120) created_date = models.DateTimeField(auto_now_add=True) approved_comment = models.BooleanField(default=False) class CommentReply(models.Model): post = models.ForeignKey(Post, on_delete=models.CASCADE, related_name='post_replay') author = models.ForeignKey(User, on_delete=models.CASCADE) comment = models.ForeignKey(Comment, on_delete=models.CASCADE) Reply = models.TextField(max_length=120) created_date = models.DateTimeField(auto_now_add=True) approved_reply = models.BooleanField(default=False) ''' #Views.py ''' elif request.method == 'POST' and 'replypost' in request.POST: print('reply form') form = ReplyForm(self.request.POST) if form.is_valid(): form.instance.author = self.request.user form.instance.post = Post.objects.get(pk=self.kwargs['pk']) form.instance.comment = Comment.objects.get(pk=self.kwargs['pk?']) form.save() return super(PostDetailView, self).form_valid(form) ''' In detailview page reply form validation fail to get instance of comment Note:In the template Under the Article having comment and reply form in the same page.Take reference of the image replay 29 takes same comment pk into the reply form validation in views.py -
Create object only if other object is successfully created
I am fairly new to Django and unfamiliar with the best practices for this situation (in any framework/language, not just python/django). The situation is that when a user first registers on my site, I want to create an "organization" for them if it doesn't exists, and then subsequently create a user for them, which references the organization. I never want to insert one without the other, but I need to create the organization first so that the organization UUID can be saved for each user. Right now, organizations will still be created even if there is an issue with the creation of the user. This is obviously a problem because then I have an organization with no users attached. I don't exactly know how to check that the user will be properly created before creating the organization, but something along these lines seems to be what I need to do. Using commit=false on the organization object creation wouldn't seem to work because I need to get the UUID. So I am not sure the best way to proceed. I am overwriting the save method in the serializer of the popular authentication package django-allauth models.py class Organization(models.Model): alphanumeric_plus_underscore = RegexValidator(r'^[\w]+$', 'Only … -
How To Fix name 'post' is not defined in django in comment
How To Fix name 'post' is not defined in django in comment when i comment in my django website then if i disapprove comment i get this error: NameError at /comment/1/remove/ name 'post' is not defined i want to reject comment but i get error please help me i'm wating for you! Here is my app Urls.py from django.urls import path,re_path from blog import views urlpatterns = [ path('',views.PostListView.as_view(),name='post_list'), path('about/',views.AboutView.as_view(),name='about'), path('register/',views.user_register,name='user_register'), path('post/<int:pk>',views.PostDetailView.as_view(),name='post_detail'), path('post/new/',views.CreatePostView.as_view(),name='post_new'), path('post/<int:pk>/edit/',views.PostUpdateView.as_view(),name='post_edit'), path('post/<int:pk>/remove/',views.PostDeleteView.as_view(),name='post_remove'), path('drafts/',views.PostDraftListView.as_view(),name='post_draft_list'), re_path('^post/(?P<pk>\d+)/comment/$',views.add_comment_to_post,name='add_comment_to_post'), path('comment/<int:pk>/approve/',views.comment_approve,name='comment_approve'), path('comment/<int:pk>/remove/',views.comment_remove,name='comment_remove'), path('post/<int:pk>/publish/',views.post_publish,name='post_publish'), ] Here is my views.py from django.shortcuts import render , get_object_or_404,redirect from django.utils import timezone from blog.models import * from blog.forms import * from django.contrib.auth.decorators import login_required from django.urls import reverse_lazy from django.contrib.auth.models import User from django.contrib.auth.mixins import LoginRequiredMixin from django.views.generic import (TemplateView,ListView, DetailView,CreateView, UpdateView,DeleteView) # Create your views here.\ #...................... ########################## ########################## @login_required def post_publish(request,pk): post = get_object_or_404(Post,pk=pk) post.publish() return redirect('post_detail',pk=pk) @login_required def add_comment_to_post(request,pk): post = get_object_or_404(Post,pk=pk) if request.method == 'POST': form = CommentForm(request.POST) if form.is_valid(): comment = form.save(commit=False) comment.post = post comment.save() return redirect('post_detail',pk=post.pk) else: form = CommentForm() return render(request,'blog/comment_form.html',{'form':form}) @login_required def comment_approve(request,pk): comment = get_object_or_404(Comment,pk=pk) comment.approve() return redirect('post_detail',pk=comment.post.pk) @login_required def comment_remove(request,pk): comment = get_object_or_404(Comment,pk=pk) post_pk = comment.post.pk comment.delete() return redirect('post_detail',pk=post.pk) Here is my Models.py class Comment(models.Model): post … -
Is there any method or procedure to prevent jQuery to apply all the same classes except current class?
I have situation to apply some jQuery to current class which should not apply to remaining classes of having same name. I want to apply jQuery code to apply to first "img_click" div but not to next "img_click" Please find example code below: <div> <div class="img_click"> <img src="image1.jpg" /> </div> <div class="info"> <h2>Image Heading</h2> <div>Posted on..</div> </div> </div> <div> <div class="img_click"> <img src="image2.jpg" /> </div> <div class="info"> <h2>Image Heading</h2> <div>Posted on..</div> </div> </div> -
Should i be using my views.py do load data instead of Jquery/Ajax?
I am working on a Django based webapp where i pull some JSON data from an external api into a html bootstrap modal. From there I do some calculations on the data and select certain entries, change their html class etc. Currently i am using an Ajax get request to retrieve the data and then straight javascript to show it in the modal and do the class changes and calculations. I am thinking that it might be better to do this from my Django views.py file instead What i have done so far Ajax Get Call $.ajax({ cache: false, method: 'GET', url: url, success: function(data){ console.log(data) console.log("success") showTable(data) $('#total').text(doSum(".price>span")) }, error: function(error_data){ console.log("error") } }) Showing the Data in a table in the modal function showTable(data) { $("#food_table tbody").html('<tr class="contentRow">' +data.map(v=>'<td>'+v.pk+'</td><td>' +v.Description+'</td><td class="price">R<span>' +v.Price+'</span></td></tr>' ).join('')); } My Bootstrap Modal and Table <div id="firstModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="firstModalLabel" aria-hidden="true"> <div class="modal-dialog modal-lg" role="document"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title" id="firstModalLabel">Table 1</h5> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">&times;</span> </button> </div> <div class="modal-body"> <div class="container"> <div class="table-responsive"> <table class="table table table-borderless" id="food_table"> <thead> <tr> <th>#</th> <th>Description</th> <th>Price</th> </tr> </thead> <tbody></tbody> </table> </div> </div> </div> <div class="modal-footer"> <div class="container"> <div><h3 class="h3total">You Owe: … -
How to create individual views for individual category in django
i m working on resturent management system in django and I have categories like pizza, chowmin, dumplings, etc. And i want individual list of food items related with its category, whenever i clicked on the for example in pizza then it must show only the list of pizzas that are stored in database like, pizza : chicken pizza cheese pizza,etc in a new page with separated view for each category please help me with this thank u