Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Extract nested value from a Django jsonfield
Is there a way to 'extract' a nested piece of data from a JSONField field as a temporary value? In my use case, I'm storing overflow metadata from Twitter's API in a data field for later use. I'd like to be able to access the nested field followers_count within TwitterPost.data. I've read the docs about how to filter based on nested values but not how to extract it as a temporary field when generating a queryset. Similarly, I've read the annotate docs for ways to create a custom temporary field but the examples all use aggregation functions on simple fields, so not JSONFields. Thanks in advance for any suggestions. -
How to get the objects created by the authorized user (Django)
**forms.py** class KomForm(forms.ModelForm): class Meta: model = Kom fields = ('company', 'title',) **models.py** class Company(models.Model): author = models.ForeignKey('auth.User') title = models.CharField(max_length=200) created_date = models.DateTimeField(default=timezone.now) published_date = models.DateTimeField(blank=True, null=True) def publish(self): self.published_date = timezone.now() self.save() def __str__(self): return self.title class Kom(models.Model): author = models.ForeignKey('auth.User') title = models.CharField(max_length=200) company = models.ForeignKey(Company, on_delete=models.CASCADE) def publish(self): self.published_date = timezone.now() self.save() def __str__(self): return self.title views.py def kommpred_new(request): if request.method == "POST": user = request.user if request.user.is_authenticated() else None form = KommpredForm(request.POST) if form.is_valid(): kp = form.save(commit=False) kp.author = request.user kp.company=forms.ModelChoiceField(queryset=Company.objects.filter(author_id = self.user.id)) kp.published_date = timezone.now() kp.save() return redirect('kommpred_detail', pk=kp.pk) else: form = KommpredForm() return render (request, 'by/kommpred_new.html', {'form': form}) I'm trying to implement a user-choice when creating a new object through a form field ModelChoiceField only those of which he is. So far, the method of trial and error, I can not do it. I was advised this: class KomForm (forms.ModelForm): class Meta: model = Kom fields = ( 'company', 'title',) def __init __ (self, * args, ** kwargs): # Call the constructor form and maintain user super (KomForm, self) .__ init __ (* args, ** kwargs) if 'user' in kwargs and kwargs [ 'user'] is not None: user = kwargs.pop ( 'user') qs … -
Most efficient way to build list of highest prices from queryset?
In one page of my app, I'm trying to display the most expensive car for each company. My models look roughly like this: class Company(models.Model): id = models.IntegerField(primary_key=True) company = models.CharField(max_length=100) headcount = models.IntegerField(null=False) info = models.CharField(max_length=100) class Car(models.Model): id = models.IntegerField(primary_key=True) company_unique = models.ForeignKey(Agency) company = models.CharField(max_length=50) name = models.CharField(max_length=100) price = models.DecimalField(max_digits=9, decimal_places=2, default=0.00) So, I want to build a list consisting of every company's single most expensive Car object. I approached the problem like this: company_list = Company.objects.all() most_expensive = [] for company in company_list: most_expensive.append(Car.objects.filter(company_unique=company.id).order_by("-price")[0]) However, this seems to be a very inefficient method. I can see with Django Debug Toolbar that this code is making way too many mysql queries. Can someone suggest a better way to build this list that would hit MySQL maybe just once or twice? -
Djangoで作成したAPIでJSONデータをGETできない
Djangoで作成したAPIを用いてjsonデータをGETしテーブルビューに表示させたいのですが 以下のプログラム上のvalueに何も入っていません.どうすれば良いでしょうか? 参考にしたサイトは http://qiita.com/kaki_k/items/b76acaeab8a9d935c35c です. 返ってくるjsonデータ { "books": [ { "id": 1, "name": "Django入門", "publisher": "GeekLab Nagano", "page": 10, "impressions": [ { "id": 1, "comment": "途中で\r\n眠くなった。" }, { "id": 2, "comment": "ああ" }, { "id": 3, "comment": "いい" } ] }, { "id": 2, "name": "Raspberry Pi 入門", "publisher": "GeekLab Nagano", "page": 15, "impressions": [] } ]} プログラム -
Djangos query for PostGIS insert is confusing... ST_GeomFromEWKB
I have this django model I am doing a save on and I printed the queries. I am confused by where the value that it shows is being ran came from. I have this slice of code ce = CivilEntity() ce.name = "whatever" ce.mpoly = GEOSGeometry(d['mpoly']) ce.save() The query shows this in the insert: ST_GeomFromEWKB(\'\\x0103000020e6100000010000000500000052b81e85eb9363c05ad148c0378f3440faa44ffaa49563c087a9cbed0fd23440fc62c92f968663c07dd2277dd2e734407b14ae47e18463c0ea72fb830ca5344052b81e85eb9363c05ad148c0378f3440\'::bytea) No idea where all those numbers come from because if I do a print ce.mpoly I see this: SRID=4326;POLYGON ((39.2858333333333292 36.0377777777777766, 39.2216666666666711 35.7761111111111134, 38.6805555555555500 35.8616666666666646, 38.7427777777777820 36.1230555555555526, 39.2858333333333292 36.0377777777777766)) The reason I care is I need to write my own raw query and I am not sure how to insert what is the GEOSGeometry into the database (I thought the django query would tell me more). I might be making this harder than it actually is. -
Saving objects and their related objects at the same time in Django
In Django, is there a way to create a object, create its related objects, then save them all at once? For example, in the code below: from django.db import models class Post(models.Model): title = models.CharField(max_length=255) body = models.CharField(max_length=255) class Tag(models.Model): post = models.ForeignKey(Post) title = models.CharField(max_length=255) post = Post('My Title', 'My Body') post.tag_set = [Tag(post, 'test tag'), Tag(post, 'second test tag')] post.save() I create a Post object. I then also want to create and associate my Tag objects. I want to avoid saving the Post then saving the Tags because if a post.save() succeeds, then a tag.save() fails, I'm left with a Post with no Tags. Is there a way in Django to save these all at once or at least enforce better data integrity? -
Python/ Django- add a custom column to tables generated by a view
I have a page on my Django website, which is displaying a number of tables based on information stored in the database. The view being used to create the page displaying the tables is defined with: def current_budget(request, budget_id): """ View the active provisional/deposit budget """ budget = Budget.objects.select_related('project', 'project__budget_overview').prefetch_related('project__projectroom_set', 'project__budget_versions', 'budget_items').get(id=budget_id) project = budget.project # project.projectroom_set.filter(budgetitem__isnull=True, cciitem__isnull=True).delete() if project.budget_overview.deposit_budget_saved: return HttpResponseRedirect(reverse('costing:combined_budget', args=[project.id])) #This is now done in the costing_home view # if not budget: # Budget.objects.create(project=project, current_marker=1) if not budget.budget_items.exists() and not project.budget_overview.deposit_budget_saved: init_budget(budget) # Create initial BudgetItem objects as standard budget_items = budget.budget_items.select_related('budget', 'budget__project', 'project_room', 'project_room__room', 'room')#.order_by('build_type', 'build_type_detail', 'project_room', 'order') # .exclude(build_type=None) budget_items2 = None #budget.budget_items.filter(build_type=None).order_by('build_type_detail', 'project_room', 'room') context = { 'project': project, 'budget': budget, 'offset1': -5, 'offset2': -4, } try: context['current_budget'] = project.budget_versions.get(current_marker=1) #For option name/date on top of pdfs except ObjectDoesNotExist: pass if request.GET.get('version') or project.budget_overview.deposit_budget_saved: #Make the fields all readonly context['readonly'] = True context['offset1'] = -7 if request.GET.get('report'): #Schedule of works report uses same data as current budget form """ Client view of budget. IMPORTANT: Hidden items are not displayed here """ items_grouped = groupby(budget_items.filter(hidden_cost=False), lambda x: x.build_type) grouped_items = [(x, list(y)) for x, y in items_grouped] context['grouped_items'] = grouped_items if request.GET.get('pdf'): template = get_template('costing/report_schedule_of_works.html') … -
How to run debug Django app in Visual Studio Code?
launch.json "name": "Django", "type": "python", "request": "launch", "stopOnEntry": true, "pythonPath": "${config.python.pythonPath}", "program": "${workspaceRoot}/manage.py", "cwd": "${workspaceRoot}", "args": [ "runserver", "--noreload" ], "debugOptions": [ "WaitOnAbnormalExit", "WaitOnNormalExit", "RedirectOutput", "DjangoDebugging" ] In the browser http://localhost:8000/login I have a login page allow user input username and password to login. I put a break points in the code of def login in views.py and run debug but the execution is not stopped on the line with break points. Now I want to allow user input user name and password then they click on button and it will jump to break points def login in views.py. How can I do that? -
Connection refused by Docker container
OK. I've struggled with this quite some time. I have a Django application and I'm trying to package it into containers. The problem is that when I publish to a certain port (8001) the host refuse my connection. $ docker-machine ip default 192.168.99.100 Then I try to curl or reach by browser 192.168.99.100:8001 and the connection is refused. C:\Users\meow>curl 192.168.99.100:8001 curl: (7) Failed to connect to 192.168.99.100 port 8001: Connection refused First remark: I'm using Docker Toolbox. Let's start from the docker-compose.yml file. version: '2' services: db: build: ./MongoDocker image: ockidocky_mongo web: build: ./DjangoDocker image: ockidocky #volumes: .:/srv ports: - 8001:8000 depends_on: - db Second remark: This file was giving me some trouble about permission building from scratch, so I built the images separately. docker build -t ockidocky . docker build -t ockidocky_mongo . here's the dockerfile for Mongo: # Based on this tutorial. https://devops.profitbricks.com/tutorials/creating-a-mongodb-docker-container-with-an-attached-storage-volume/ # Removed some sudo here and there because they are useless in Docker for Windows # Set the base image to use to Ubuntu FROM ubuntu:latest # Set the file mantainer MAINTAINER meow RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10 && \ echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | tee /etc/apt/sources.list.d/mongodb.list && \ apt-get update && … -
Django create row if superkey doesn't exist, else update it
I am trying to create a music webapp using django and django rest framework - the problem lies in implementing the listen record counter .Everytime a user plays a song, the counter for that song_id,user_id should increase. My model looks like this, class Listen_Record(models.Model): number=None listen_count = models.IntegerField(default=1,null=True) user = models.ForeignKey(User) songid = models.ForeignKey(Song) My view, class ListenRecordCreateAPIView(GenericAPIView,CreateModelMixin,UpdateModelMixin): queryset = Listen_Record.objects.all() serializer_class = ListenRecordListSerializer def put(self,request,*args,**kwargs): if Listen_Record.objects.filter(user=request.data['user'], songid=request.data['songid']).exists(): print("EXIST") tableid = Listen_Record.objects.values_list('id', flat=True).filter(user=request.data['user'], songid=request.data['songid']).get() cnt = None try: cnt = Listen_Record.objects.get(id=tableid) print(cnt) except AttributeError: print("OI") cnt.listen_count = 0 cnt.listen_count += 1 print(cnt.listen_count) cnt.save(['listen_count']) return self.update(cnt,*args,**kwargs) def post(self, request, *args, **kwargs): if Listen_Record.objects.filter(user=request.data['user'], songid=request.data['songid']).exists(): self.put(request, *args, **kwargs) else: return self.create(request,*args,**kwargs) Basically, the default method would be to POST, but if userid and songid, exists, it should PUT instead to increment the listen_count field. The error I'm getting now is "UNIQUE constraint failed: api_listen_record.id" Is there a more elegant way to implement this feature or how to fix the error? -
install cx_Oracle for Django on windows 7
This seems to be a common problem for Django with Oracle, I've been through a lot of the answers and thread but not having much luck. Here is the response from my terminal on Windows 7. (env1) C:\venvs\env1> python -m pip install cx_Oracle Collecting cx_Oracle Using cached cx_Oracle-5.2.1.tar.gz Complete output from command python setup.py egg_info: Traceback (most recent call last): File "<string>", line 1, in <module> File "C:\Users\AppData\Local\Temp\pip-build-go3kf4ua\cx-Oracle\setup.py", line 186, in <module> raise DistutilsSetupError(message) distutils.errors.DistutilsSetupError: cannot locate Oracle include files in C:\app\product\11.2.0\client_1 I have set my system variable Path to include %ORACLE_HOME%C:\app\product\11.2.0\client_1; I can paste this path into search and it takes me to my instant client. What am I doing wrong? -
Create a search bar with Django
I would like in my html template create a search bar which could display the QuerySet result to users. For example, a lastname search bar, user is writing a lastname string, and the result is displayed from the Database. I have this function for example from models.py : def Research(request) : #lastname_from_user = search_lastname = Lastnale.objects.filter(lastname ='X') #Where X = what the user filled out in the search bar context = { "search_lastname" : search_lastname, } return render(request, 'template.html', context) How I could ask a lastname string from the html template and replace X by this request in order to display the result ? Display the result is not a problem, but take a string from users and use it is more difficult for me. If you have an idea ? -
Django : Excluded fields are saved
I have a model : from django.db import models from tinymce.models import HTMLField class Team(models.Model): name = models.CharField(max_length=100, verbose_name='Team name') city = models.CharField(max_length=100, verbose_name='Team city') biography = HTMLField(verbose_name='Team biography') country = models.ForeignKey('Country') slug = models.SlugField(max_length=100) def __str__(self): return self.name class Country(models.Model): name = models.CharField(max_length=100, verbose_name='Country name') code = models.CharField(max_length=5, verbose_name='Country code') def __str__(self): return self.code And a form for this model: from django import forms from teams.models import Team class TeamForm(forms.ModelForm): class Meta: model = Team fields = ( 'biography', 'city', 'country' ) And this is my view: def add(request): if request.method == 'POST': form = TeamForm(request.POST) if form.is_valid(): send = True form.save() else: form = TeamForm() return render(request, 'teams/add.html', locals()) As you can see, all my model fields are required because I don't add argument 'null' to True in my model attributes. In my ModelForm, for testing, I just specify fields biography, city and country. But when I fill the form and send-it, data are saved in database, however is missing name and slug.... Why ? Thanks for youre help -
Errors using Django Awesome Avatar
Have been trying to solve an issue using Django awesome avatar for quite some time now. I have used the AvatarField() in my models to save the profile pic in the UserProfile model. avatar = AvatarField(upload_to=upload_profile, width=100, height=100,default = 'profiles/profile.jpg',) Have also used a ModelForm to render the field to a form that is shown on the templates avatar = avatar_forms.AvatarField() My issues, When I try accessing user profile in admin and save it throws and error 'ImageFieldFile' object has no attribute '__getitem__' Also, when I select a photo on the form in template, it does not show the crop tool that am supposed to use to resize the image. Anyone else who has experienced such an issue? Please help on this. Thanks in advance -
How to improve the performance of this django ORM query?
I'm using django and I'm running a postgresql database with 2.1 million records. I have a complex query which takes 20sec to run, and it takes that long because inside the query there's an aggregate count() function, which ends up counting 1.5million records. Having to wait 20 seconds is not acceptable for my application. The django ORM "query" is as follows: WebRequest.objects.values('FormUrl', 'Request__Platform','Request__Ip').annotate(total=Count('Request__Ip')).order_by('-total')[:10] I tried using table indexes, but this hardly reduced the delay. Now I'm considering saving the data in a table, and have the table regenerated every hour by pgadmin/cronjob/task scheduler, by e.g. drop table if exists <table> tbl; select into <tabel> tbl from query; I do feel like this is a sloppy fix and assume there must be a better way to reduce the time. Are there any better approaches or do you guys consider this to be an acceptable solution? -
Set django variable from input
How can I set django variable with value of date which i selected in input: <tr> <td>Выбрать дату:</td> <td> <input type="date" id="choose_event_date"></input> </td> </tr> -
JavaScript- Uncaught SyntaxError: Unexpected token ) - can't see the extra ')'
I am working on a web application that has been written in Python/ Django. In particular, I have been working on a bug where a 'date' value entered by the user on a form was not being retained (i.e. if you refreshed the page, the date field would return to the value it held prior to the user changing it). I have added a JS function to the HTML file for this page to listen out for changes to this value on the form, and to save the new value any time a change is detected. The function that I have added works- if I enter a new value, and refresh the page, the value that I entered is displayed in the field by default, rather than the original value that it held. However, when I refresh the page in my browser, the console is showing an error message which says: (index):3876 Uncaught SyntaxError: Unexpected token ) The only change I've made to my application is adding the following function to the .html file: $(document).on('change', '#id_date_received', function messageDepositPaid()){ console.log("document.on('change') called on id_date_received in concept.html ") if (window.confirm("Would you like to send an email confirming we have received a deposit?")) { … -
Display QuerySet result as Array
I'm asking a question about my HTML template. I displayed results from some QuerySet with Django and I would like to modify the display user aspect. I don't know if I can make this kind of things with Django or if JavaScript lets to make that. I have an HTML template : <h2 align="center"> Affichage de toutes les fiches individuelles </align> </h2> <br></br> {% block content %} <h4> Récapitulatif des 10 dernières fiches individuelles créées: </h4> <ul> {% for item in identity %} <li>{{ item }}</li> {% endfor %} </ul> <h4> Récapitulatif des 10 dernières fiches individuelles créées habitant en France: </h4> <ul> {% for item in identity_France %} <li>{{ item }}</li> {% endfor %} </ul> {% endblock %} From this view : def Consultation(request) : identity = Identity.objects.all().order_by("-id")[:10] #Les 10 dernières fiches créées identity_France = Identity.objects.filter(country='64').order_by("-id")[:10] #Les 10 dernières fiches où la personne habite en France context = { "identity" : identity, "identity_France" : identity_France, } return render(request, 'resume.html', context) Is it possible to display the result as an array ? With column, tags for each column etc ... ? Something like that : Thank you ! EDIT : I found that JQuery makes that : JQuery Array -
OperationalError: no such column: when trying to defin ForeignKey Django
I am simply trying to define a foreign key but every time, I try to access my table i get an error message as follow: OperationalError: no such column: api_patients.medStaff_id Here is how i define my 2 tables: MED_STAFF_ROLES = (('gp', 'General Practitien'), ('nurse', 'Nurse'), ('gs', 'General Sergeon')) class medStaff(models.Model): id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False) first_name = models.CharField(max_length = 255) last_name = models.CharField(max_length = 255) dob = models.DateField() gender = models.CharField(max_length = 1) role = MultiSelectField(choices=MED_STAFF_ROLES) def __unicode__(self): return str(self.id) class patients(models.Model): id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False) first_name = models.CharField(max_length = 255) last_name = models.CharField(max_length = 255) dob = models.DateField() gender = models.CharField(max_length = 1) medStaff = models.OneToOneField(medStaff, default=None, blank=True, null=True) def __unicode__(self): return str(self.id) -
Sending email with extra name and phone no fields alongside subject, from
Views.py def email(request): if request.method == 'GET': form = ContactForm() else: form = ContactForm(request.POST) if form.is_valid(): subject = form.cleaned_data['subject'] from_email = form.cleaned_data['from_email'] message = form.cleaned_data['message'] name = form.cleaned_data['name'] phone = form.cleaned_data['phone'] try: email = EmailMessage(subject,message,from_email+'<sender@gmail.com>',['pratirup8@gmail.com'],headers = {'Reply-To': from_email }) email.send() except BadHeaderError: return HttpResponse('Invalid header found.') return redirect('success') return render(request, "email.html", {'form': form}) def success(request): return HttpResponse('Success! Thank you for your message.') Now my question is how to include phone number and name field in the email message section -
Cancel makemigrations Django
I'm developping a website in django but yesterday i did bad thing with my models. I ran the "makemigrations" command but when I tried to do a "migrate" command, it did not work. So, I would like to cancel all my "makemigrations" that are not "migrate". Is that possible ?? Thanks! -
Collapse list group in django using dynamic id
I am trying to use a dynamic id for bootstrap collapse. The collapse is working, but it doesn't work as expected. There are more than items inside each headings, but only one item is shown when I click on the heading. Here is my index.html <div class="row"> <div class="col-md-offset-1 col-md-10"> <div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true"> <div class="panel panel-default"> {% for subject in subjects %} <div class="panel-heading" role="tab"> <h4 class="panel-title"> <a role="button" data-toggle="collapse" data-parent="#accordion" href="#c{{forloop.counter}}" aria-expanded="false" aria-controls="c{{ forloop.counter}}"> {{ subject }}</a></h4> </div> {% for practical in practicals %} {% if practical.subject == subject %} <div id="c{{forloop.counter}}" class="panel-collapse collapse in" role="tabpanel""> <div class="list-group"> <a href="{% url 'practicals:detail' practical.id %}">{{ practical }}</a> </div> </div> {% endif %} {% endfor %} {% endfor %} </div> </div> </div> </div> I have included the link to the js My model.py is: class Subject(models.Model): subName = models.CharField(max_length=100) def __str__(self): return self.subName class Practical(models.Model): title = models.CharField(max_length=500) subject = models.ForeignKey(Subject, on_delete=models.CASCADE) def __str__(self): return self.title I have tried using subject_id instead of forloop.counter, but still same problem. Can anybody help me? -
Django render return html into text
I am making my first django application with DjangoGirls (https://tutorial.djangogirls.org) This is urls.py from django.conf.urls import url from . import views urlpatterns = [ url(r'^$', views.login_page, name='login_page'), ] my views.py like this def login_page(request): return render(request, 'mileage/login_page.html', {}) this is my html code <!DOCTYPE html> <html> <head> <meta name="viewport" content="user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, width=device-width" > <meta charset="UTF-8"> <title>Test</title> <link rel="stylesheet" href="{% static 'css/style.css' %}"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"> </script> </head> <body bgcolor="#4599e8"> <div class="title"><span><h1>Test</h1></span></div> <div class="home_password"> <div class="password"><input type="password" name="password" placeholder="Password"></div> <div class="button"><button>OK</button></div> </div> </body> </html> And start server, but my localhost:8080/ shows only html text not page. Using Chrome Developer Console, I checked element. <html> <head></head> <body> <pre style="word-wrap: break-word; white-space: pre-wrap;"> " my html code here. " </pre> </body> </html> I don't know how to solve it. -
Customizing Group Admin Form in Django
I'm very new to Django and this forum so apologies in advance for potentially unprofessional post. What I'm trying to do is customize the default Group Admin Form so that it has an additional place where one can add Users to the Group. Below is a piece of code that adds the Users box to the Form and is able to add/remove users to/from existing groups, but whenever I try to create a new group I get an error message saying: Group: xxxxx needs to have a value for field "group" before this many-to-many relationship can be used. And here's the code itself: forms.py: from django import forms from django.contrib.auth.models import User, Group from django.contrib.admin.widgets import FilteredSelectMultiple class GroupAdminForm(forms.ModelForm): class Meta: model = Group exclude = [] users = forms.ModelMultipleChoiceField( queryset=User.objects.all(), required=False, widget=FilteredSelectMultiple('users', False) ) def __init__(self, *args, **kwargs): super(GroupAdminForm, self).__init__(*args, **kwargs) if self.instance.pk: self.fields['users'].initial = self.instance.user_set.all() def save(self, commit=True): instance = super(GroupAdminForm, self).save(commit=False) instance.user_set = self.cleaned_data['users'] instance.save() return instance admin.py: from django.contrib import admin from django.contrib.auth.models import Group from .forms import GroupAdminForm admin.site.unregister(Group) class GroupAdmin(admin.ModelAdmin): form = GroupAdminForm filter_horizontal = ['permissions'] admin.site.register(Group, GroupAdmin) Any help will be greatly appreciated. Also, please let me know if you need any more … -
Pass context from one serializer to another?
With Django REST Framework, I have 2 serializers: PageSerializer and CommentSerializer. CommentSerializer depends on some extra "context" value, but it doesn't get it directly, instead it needs to get it from PageSerializer, since they have a nested relationship. So I need to have something like this: class CommentSerializer(serializers.ModelSerializer): ... my_field = serializers.SerializerMethodField() def get_my_field(self, comment): my_value = self.context['my_value'] ... class PageSerializer(serializers.ModelSerializer): ... comments = CommentSerializer( many=True, context={'my_value': my_value} # my_value doesn't exist until __init__ is called, so I can't pass it ) ... my_value = 1 page_serializer = PageSerializer(page, context={'my_value': my_value}) But, of course, this code can't work. What kind of workaround can I do here?