Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
How can I edit the urls.py of allauth?
I want to edit the urls.py of allauth by removing the links to the change email and password reset pages. Is there a way I can edit the urls.py in order for these pages to not display and return a 404 when the user tries to access them? -
Using django-postman with tabination
Currently, I'm working on some Django project which requires messaging between users. I've read some posts and I've decided to use django-postman. Now, I want to have two tabs on my homepage. The first one should contain a form to send a message to a particular user and I know how to create it. The second one should be an inbox (like on Gmail), where the user should find all of the incoming messages. My question is - what's the best way to implement django-postman on the second tab? I've found a snippet called django-tabination, but I'm not sure if I need this tool and I find it a little bit too complicated. Maybe I should follow this tutorial (with some changes - for example, uses Django includes instead of extra divs). Thanks for your help! -
Javascript not adding class to html element
I have stumbled upon a somewhat weird problem. I don't seem to be able to edit the class on my html elements. I have been looking into similar cases here on SO but found nothing that solves my problem. The only thing that makes this case somewhat different is that I am using the Django framework to reflect the backend. My code down here adds the class "form-control-danger" to all input fields that in some way have received erroneous inputs. Observe the code within the tags on the bottom. <form class="form" method="post" action="/register/"> {% csrf_token %} {% for field in register_form %} {% if field.name != "agree_to_terms" %} <div class="input-group"> <span class="input-group-addon"> {% if field.name == "first_name" %} <i class="now-ui-icons users_circle-08"></i> {% elif field.name == "last_name" %} <i class="now-ui-icons text_caps-small"></i> {% elif field.name == "email" %} <i class="now-ui-icons ui-1_email-85"></i> {% elif field.name == "password1" %} <i class="now-ui-icons ui-1_lock-circle-open"></i> {% elif field.name == "password2" %} <i class="now-ui-icons ui-1_lock-circle-open"></i> {% endif %} </span> {{ field }} </div> {% else %} <div class="form-check"> <label class="form-check-label"> {{ field }} <span class="form-check-sign"></span> I agree to the <a href="#">terms and conditions</a>. </label> </div> {% endif %} {% endfor %} {% if error_fields_by_id %} <script> {% for … -
Django - operate on database within transaction.atomic block after raising error
I would like to perform an action on my database within a transaction.atomic() block, even in the event that an error is raised. Here is some sample code to demonstrate my issue: Sample code # Outer try block try: # Enclose in atomic transaction for database rollbacks with transaction.atomic(): # If this line fails, all database updates within the outer try: block should be rolled back u = UU.create(email='test@test.com') # Inner try block try: cc = CC.objects.get(id=1) perform_action(cc) # If this exception triggers, the 'cc' object should be deleted, but all other database updates within the outer try: block should be rolled back except: cc.delete() raise # If this line fails, all database updates within the outer try: block should be rolled back u = UU.create(email='test@test.com') # If any exception triggers, this error should be printed except: print("Error occured.") If an error occurs in my inner try: block, I want the cc object to be deleted, but all other database transactions within the outer try: block to be rolled back. However, as the code stands now, the cc.delete() transaction will be rolled back if any error occurs within the inner try: block. Any suggestions? -
Django 1.8.5 migrations not working
I'm working on a Django 1.8.5 app with a MySQL database, with two other developers. We've made changes to models.py, and now I'm trying to run migrations. When I run python manage.py makemigrations it returns "No changes detected." When I run python manage.py migrate it returns: Operations to perform: Synchronize unmigrated apps: webstack_django_sorting, staticfiles, debug_toolbar, messages, linaro_django_pagination, humanize, django_tables2 Apply all migrations: admin, schools, contenttypes, auth, sessions Synchronizing apps without migrations: Creating tables... Running deferred SQL... Installing custom SQL... Running migrations: No migrations to apply. I've tried deleting migration files/resetting migrations, as suggested in other posts, and nothing changed when I ran the makemigrations or migrate commands after deleting/resetting. I've also tried python manage.py makemigrations app_name but get the same results. The two other developers on my team have run the migrate commands successfully. When they run python manage.py makemigrations they're then prompted to rename old fields to match new fields in both models in our app. I'm not prompted with this; as I mentioned above, I'm told no changes are detected. I'm working from the same code they are; pulled it from GitHub this morning, and we made sure what I'm working with is the most recent version. It … -
How do you convert a Django model with ManytoMany field to an elasticsearch_dsl DocType class?
I'm using elasticsearch_dsl to help with interfacing with elasticsearch and this is the model I currently have and I'm trying to recreate as a DocType: class HouseIndex(DocType): house_type = String() #people sold = Boolean() built_datetime = Date() #alerts # associated_locations hash = String() class House(models.Model): house_type = models.ForeignKey(HouseType, db_index=True, on_delete=models.CASCADE) people = models.ManyToManyField(to='Person', db_index=True, through='PersonToHouseMap') sold = models.BooleanField(default=False) built_datetime = models.DateTimeField() alerts = models.ManyToManyField(Alert) associated_locations = models.ManyToManyField(to='Location') hash = models.CharField(max_length=64, unique=True, null=True) objects = DistinctAlertManager() But I'm not sure what to do when it's a ManyToMany field. Such as with people, alerts, and associated locations. -
Django - Why PATCH returns in response correct data which I would like to save but it doesn't save this data in database?
Any ideas why PATCH returns in response correct data which I would like to save but it doesn't save this data in database? def patch(self, request, object_id): try: object = Object.objects.get(id=object_id) except Object.DoesNotExist: return Response(status=status.HTTP_404_NOT_FOUND) serializer = ObjectSerializer(object, data=request.data, partial=True) if serializer.is_valid(): serializer.save() return Response(serializer.data) return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST) -
django-admin.py makemessages -l fa doesn't crate .po files
i want to add fa(persian) language to my app, i created the locale folder inside my app and a folder named 'fa' inside that. when i use the following command it runs without any errors,but doesn't create .po file(i use cmd inside my app's folder) django-admin makemessages it only writes this processing locale fa i also used this command but it didn't help django-admin.py makemessages -l fa i use windows 7 -
How can a type be incompatible with itself?
In my django application (Django 1.6.0, python 2.7.5 running on Red Hat), my database driver is seeing an error from ctypes: TypeError: incompatible types, LP_c_int instance instead of LP_c_int instance The code looks like this: is_null = value is None param.value.is_null = pointer(c_int(is_null)) <-- error occurs on this line I'm not really familiar with ctypes (I inherited this code) but on the surface, this error message makes no sense. The code has been running for years but I'm now seeing this error all over the place. Am I doing something obviously wrong? -
Django admin: Making a required field read-only
I have a number of models with a ForeignKey relationship to a Person model. For example: class PersonData(BaseModel): person = models.ForeignKey(Person) data = models.TextField() I want to lock down the admin such that once a PersonData object is created, an admin user can change the data, but can't change the Person. At first it seemed pretty straightforward -- I put this in the PersonDataAdmin class: def get_readonly_fields(self, request, obj=None): if obj: return self.readonly_fields + ('person',) return self.readonly_fields On the display side, that worked as expected -- I see the value for person, but it's grayed out so I can't change it -- but then when I try to change the data and submit the form, I get an error message, "Please correct the error below." No other message appears, but with a bit of digging, I discovered that the form is missing a value for the required person field. I've investigated a solution that would involve creating a custom form that would disable this field selectively (something like this or this), but (a) I wasn't successful in getting it to work, and (b) it seemed like a ton of code for what seems like a much simpler situation. Any ideas … -
Template is displaying object name instead of value
My template used to show the data correctly before I changed my model to add the following OrgLevel prior to my custom User table. class OrgLevel(models.Model): coid = models.CharField(db_column='Coid', max_length=5, primary_key = True, unique = True) # Field name made lowercase. slevel = models.CharField(db_column='SLevel', max_length=6) # Field name made lowercase. blevel = models.CharField(db_column='BLevel', max_length=6) # Field name made lowercase. rlevel = models.CharField(db_column='RLevel', max_length=6) # Field name made lowercase. dlevel = models.CharField(db_column='DLevel', max_length=6) # Field name made lowercase. class Meta: managed = False db_table = 'OrgLevel' My Custom User model is defined as the following: class User(AbstractBaseUser, PermissionsMixin): email = models.EmailField(unique=True) username = models.CharField(max_length=7, unique=True) formattedusername = models.CharField(max_length=11, unique=True, primary_key = True) first_name = models.CharField(max_length=40) last_name = models.CharField(max_length=140) date_joined = models.DateTimeField(default=timezone.now) is_active = models.BooleanField(default=True) is_staff = models.BooleanField(default=False) is_cfo = models.BooleanField(default=False) facility = models.CharField(max_length=140) officename = models.CharField(max_length=100) jobdescription = models.CharField(max_length=140) positioncode = models.CharField(max_length = 100) positiondescription = models.CharField(max_length=140) coid = models.OneToOneField(OrgLevel, null=True, blank = True) streetaddress = models.CharField(max_length=140) title = models.CharField(max_length=100) USERNAME_FIELD = 'username' class Meta: app_label = 'accounts' db_table = "user" def save(self, *args, **kwargs): self.formattedusername = '{domain}\{username}'.format( domain='HCA', username=self.username) super(User, self).save(*args, **kwargs); def get_short_name(self): return self.username In my view I have the owner defined as: def profile(request): owner = User.objects.get … -
How do you link the primary key of two apps together
Well basically i have two apps that share the same Name field and I wanted to know how to generate the primary key based on checking if the Name model in one of the app matches that of other and allocates the primary key of the first app to that of the second I tried that with the get_pk fuction as shown below but it didnt work Thanks Model class InfoPedia(models.Model): #User model due to association user =models.ForeignKey(settings.AUTH_USER_MODEL,on_delete=models.CASCADE) Name =models.ForeignKey(MainPage,on_delete=models.CASCADE) #Information unique to this app Location =models.CharField(max_length= 50,null=True,blank=True) Information =models.TextField(null=True,blank=True) TrackListing=models.TextField(null=True,blank=True, help_text="Seperate by Coma") Published=models.BooleanField(default=True) Timestamp=models.DateTimeField(auto_now=True) Updated=models.DateTimeField(auto_now=True) def _get_pk(self, meta=None): Tempn=MainPage.objects.get(Name=self.Name) if Tempn.Name==self.Name: self.pk=Tempn.pk return self.pk # # def get_absolute_url(self): # return reverse("InfoPedia:details", kwargs={"pk":self.pk}) # def __str__(self): # return self.Name # You use this to make each item a hyperlink based on the detail view and put it the detailview template def get_absolute_url(self): # return f"/Blog/{self.slug}" return reverse('InfoPedia:DetailView', kwargs={"pk":self.pk}) class Meta: ordering=["-Updated","-Timestamp"] #orranges in order of updated def get_tracklist(self): return self.TrackListing.split(",") def Information_create_pre_save( instance, sender, **kwargs): instance.Information=retriever(instance.Name) # instance.TrackListing=WikiPage.categories -
Upload tempfile in Django
I've created a tempfile and I am trying to upload it into a model with a FileField. I keep getting this error message: AttributeError: '_io.BufferedRandom' object has no attribute '_committed' Here is what my code looks like: my_item = {} my_filename = 'name' temp_file = tempfile.TemporaryFile() json_text = json.dumps(an_item) json_byte = str.encode(json_text) temp_file.write(json_byte) temp_file.name = my_filename file_instance = MyFileModel(file=temp_file) file_instance.save() temp_file.close() -
Unable to connect to django 1.11 web app on Apache server
I am no expert on Django. I am able to run the app on my local machine well. I want to deploy this app on our internal server. Versions I am using: Python: 2.7, Django 1.11, Apache: 2.4 Ports Open: 9991 When I access the port from any machine, it gives me no error. For e.g. xxx.xx.xxx.xxx:9991 shows Apache page. But when I add the URL to the app xxx.xx.xxx.xxx:9991/WebApp1Url it gives error. Below is my configuration of httpd.conf Listen 9991 <VirtualHost *:9991> Alias /static "C:/xxx/DjangoSite/WebApps/WebApp1/static" <Directory "C:/xxx/DjangoSite/WebApps/WebApp1/static"> Require all granted </Directory> <Directory "C:/xxx/DjangoSite/WebApps/WebApps"> <Files wsgi.py> Require all granted </Files> </Directory> </VirtualHost> Below is my wsgi.py: import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO_SETTINGS_MODULE", "WebApps.settings") application = get_wsgi_application() from WebApp1.wsgi import WebApp1 application = WebApp1(application) settings.py contains: WSGI_APPLICATION = 'WebApps.wsgi.application' I can assure that the paths to static and wsgi.py are correct. I can't figure out what is not right. Can someone please provide pointers as to which step is missing? Any help is appreciated. Pardon any typos above. Thank you in advance. -
How to change hierarchy of HTML form
I have a form for a workout calendar that looks like this: Just by looking at it, you can probably guess how it's supposed to work. Each ROW is a unit, with for example a Lift name, with No of sets, No of reps (one per set) and Weight (one per set). When I submit this form, I'd like the server to receive something like this: { "date": ['Nov. 22, 2017, midnight'], "lifts":[ {"name":"benchpress", "no_of_sets":2, "reps":[3,3], "weight":[70,70]}, {"name":"deadlift", "no_of_sets":3, "reps":[3,4,4], "weight":[80,75,75]}, {}, {} ], "cardio_activities":[ {"name":"running", "duration":25, "distance":2.5} ] } Unfortunately, right now, it's producing this: <QueryDict: {'csrfmiddlewaretoken': ['u8HH7g7bWRVlX5UW3cdaCW19dLeEyq9OH1USdPgmaa5d4yRhyiEHBfpLQkd5jy5R'], 'date': ['Nov. 22, 2017, midnight'], 'lift_string': ['benchpress', 'deadlift', '', ''], 'sets': ['2', '3', '', ''], 'reps': ['3', '3', '3', '4', '4'], 'weight': ['70', '70', '80', '75', '75'], 'cardio_string': ['running'], 'minutes': ['25'], 'distance': ['2'] } > It's not impossible to work with this dictionary, but it is very counter intuitive and non-practical. Is there any way to shape how the QueryDict will be structured? Here's the django template I'm using: <form action="{% url 'workoutcal:add_workout' date.year date.month date.day %}" method="post"> {% csrf_token %} <div class="row"> <div class="col-xs-2"> <p id="date">{{ date.year }}-{{ date.month }}-{{ date.day }}</p> <input type="hidden" name="date" value="{{ date }}"> </div> </div> … -
Django rest manytomany create object instances
I have two models as following (basically a Reader will have many Books in his wishlist): class Reader(models.Model): user = models.OneToOneField(User) ... # A library has many readers which_library = models.ForeignKey('Library', related_name='readers', on_delete=models.CASCADE) class Book(models.Model): book_id = models.AutoField(primary_key=True) title = models.CharField(max_length=30) ... # A library has many books which_library = models.ForeignKey('Library', related_name='books', on_delete=models.CASCADE) # Record the date whenever a new book is added, it will be helpful for showing new arrivals when_added = models.DateTimeField(auto_now_add=True, blank=True, null= True) reader = models.ManyToManyField('Reader', related_name='wishlist') my serializer: class ReaderSerializer(serializers.ModelSerializer): username = serializers.CharField(source='user.username') email = serializers.CharField(source='user.email') password = serializers.CharField(source='user.password') class Meta: model = Reader #fields = '__all__' depth = 1 fields = ('id', 'username', 'email', 'password', 'phone', 'address', 'dob', 'which_library') def update(self, instance, validated_data): instance.user.email = validated_data.get('user.email', instance.user.email) instance.user.password = validated_data.get('user.password', instance.user.password) instance.phone = validated_data.get('phone', instance.phone) instance.address = validated_data.get('address', instance.address) instance.dob = validated_data.get('dob', instance.dob) instance.which_library = validated_data.get('which_library', instance.which_library) instance.save() return instance def create(self, validated_data): user_data = validated_data.pop('user') user = User.objects.create(**user_data) user.set_password(user_data['password']) user.save() reader = Reader.objects.create(user=user, **validated_data) return reader I can create a Reader by making a POST call with following data: { "username": "sample5", "email": "sample5@gmail.com", "password": "5647", "phone": "836365", "address": "sample5 address", "which_library": "1" } I want to implement a logic/view so that a … -
In Django Signals, What is difference between these two codes?
First CODE: @receiver(post_save, sender=User) def create_user_profile(sender, instance, created, **kwargs): if created: Profile.objects.create(user=instance) @receiver(post_save, sender=User) def save_user_profile(sender, instance, **kwargs): instance.profile.save() Second CODE: @receiver(post_save, sender=User) def create_or_save_user_profile(sender, instance, created, **kwargs): if created: Profile.objects.create(user=instance) else: instance.profile.save() Is there any difference in actually what they work? -
implementing PayPal IPN in Django Application
I'm writing an application in Django 2.0 It is a multi membership application. I have to implement PayPal payment method and activate the membership based on payment received. For this, I have created a button in PayPal with generates code as upgrade.html <form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post" target="_top"> <input type="hidden" name="cmd" value="_s-xclick"> <input type="hidden" name="hosted_button_id" value="<button-id>"> <input type="image" src="https://www.sandbox.paypal.com/en_US/i/btn/btn_buynowCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!"> <img alt="" border="0" src="https://www.sandbox.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1"> </form> and views.py is class Pricing(TemplateView): template_name = 'membership/pricing.html' class Upgrade(TemplateView): template_name = 'membership/upgrade.html' class PaymentSuccess(TemplateView): template_name = 'membership/payment-success.html' class PaymentFailed(TemplateView): template_name = 'membership/payment-failed.html' def paypal_ipn(request): # IPN response goes here and urls.py urlpatterns = [ path('pricing/', Pricing.as_view(), name='pricing'), path('upgrade/', Upgrade.as_view(), name='upgrade'), path('payment-success/', PaymentSuccess.as_view(), name='payment-success'), path('payment-failed/', PaymentFailed.as_view(), name='payment-failed'), path('paypal-ipn/', paypal_ipn, name='paypal-ipn'), ] All is working fine as Payment is being made and user is redirected to the payment-success page. But How do I receive the payment confirmation so that I could process the membership and record the transaction data in the database? I have enabled instant payment notification from the settings in paypal sandbox accoun on url https://example.com/paypal-ipn/ I do not want to use django-paypal plugin due to some limitations. -
How to structure an object whos time field depends upon another objects time field
Basically there's an Appointment model, along with an Available_Hours model. The Appointment model is used by the customers. The Available_Hours is used by the employees to set their hours for a given day, so each of these objects is for a given day. The Appointment object time field needs to be dependent on the Available_Hours object. So that when the customer creates an appointment there will be a dropdown select field that displays all of the available hours employees have. Sorry if this is a stupid question, I am new to working with databases. Any help is extremely appreciated! -
Starting rqworker using supervisor causes spawn error
Trying to start rqworker as stated in its README using this command: python manage.py rqworker default For some reason it gives ERROR (spawn error) and status shows FATAL Exited too quickly (process log may have details). Logs has no any information for error (exit status 1; not expected). My supervisor configuration: [program:rqworker] user=ubuntu directory=/var/www/project/ command=/var/www/project/venv/bin/python manage.py rqworker default > /var/log/project/rq.log stopsignal=TERM autorestart=true autostart=true numprocs=1 Running command directly from ubuntu user works as expected. -
Python-Django error when importing data from settings.py
I am trying to import DB settings from settings.py but I am getting an error: Traceback (most recent call last): File "Read_Data.py", line 12, in read_bbg dbHost = settings.DATABASES['default']['HOST'] KeyError: 'default' import psycopg2 import csv from django.conf import settings import sys def read_bbg(file): """ read from csv and insert into db table """ settings.configure(DEBUG=True) dbHost = settings.DATABASES['default']['HOST'] dbUsername = settings.DATABASES['default']['USER'] dbPassword = settings.DATABASES['default']['PASSWORD'] dbName = settings.DATABASES['default']['NAME'] conn_string = """host='{0}' dbname='{1}' user='{2}' password='{3}' sslmode='require' """.format(dbHost,dbName,dbUsername,dbPassword) print(conn_string) conn=None """ ##rest of the code## """ the settings.py is located in ./cf_proj directory and the read_bbg function is in ./coveredfunds/Read_Data.py Could anyone help me with this error? -
Can't generate download links using Django
I'm trying to make a website for downloading youtube videos using django. The procedure i'm following is, user gives the video link from youtube, my view function downloads the video into my server and deliver the directory link of that downloaded video file as download link. I am able to generate the video link but the link doesn't work. My view for the project is: def index(request): X = find() latest_downloads = Download.objects.order_by('dw_date')[:5] output = ','.join([q.download_text for q in latest_downloads]) downloaded_file_name = "None" file_download_link = "None" if request.method == "POST": link = request.POST['link'] generated = "youtube-dl "+ link os.system(generated) downloaded = True if downloaded: downloaded_file_name = X.find_name('*.mkv', '/home/kazirahiv/yao') file_download_link= X.find_link('*.mkv', '/home/kazirahiv/yao') else: downloaded = False template = loader.get_template('grab/index.html') contex = {'latest_downloads': latest_downloads, 'downloaded':downloaded, 'file_download_link':file_download_link} return HttpResponse(template.render(contex, request)) And the template is: <form name="MyForm" method="POST" action="">{% csrf_token %} <fieldset> <legend>Download Youtube Videos:</legend> Paste below:<br> <input type="text" name="link"><br> <input type="submit" value="Submit"> </fieldset> </form> {%if downloaded %} <p> Download Complete </p> <a href="file://{{file_download_link}}" download>Download link</a> {% else %} <p> No task given ! </p> {% endif %} {% if latest_downloads %} <ul> {% for download in latest_downloads %} <li><a href="/grab/{{downlod.id}}/">{{ download.download_link }}</a></li> {% endfor %} </ul> {% else %} <p> No recent downloads … -
Make attribute in admin.py "clickable" to edit?
So I have something like this in admin.py from .models import Venue class VenueAdmin(admin.ModelAdmin): list_display = ["country", "zip", "city", "name", "street"] admin.site.register(Venue, VenueAdmin) When I'm in the django admin I only have the "land"-value clickable to edit the venue. Is it possible to make also or only "name" clickable? Thanks in advance and please keep in mind I'm a newbie in case the answer is too obvious. -
Django Form ---How to delete the initial text from a Form When the Cursor is in the field
I have a django contact form and i want the initial text that is found into the form to dissapear when the cursor is in the field. My form is now: from django import forms class ContactForm(forms.Form): numele_dumneavoastra = forms.CharField(required=True, label="", initial="Numele Dumneavoastra") numarul_de_telefon = forms.CharField(required=True, label="", initial="Numarul de Telefon ") # perioada_cand_va_putem_contacta = forms.CharField(required=True) mesajul_dumneavoastra = forms.CharField(required=True, widget=forms.Textarea, label="", initial="Mesajul Dumneavoastra") emailul_dumneavoastra = forms.EmailField(required=True, label="", initial="Email") The text looks like this image When the user inserts his name e.g. "John Doe" i want the initial text " Numele Dumneavoastra" to dissapear from sight. Thank you! -
JQuery: div class-specific hover not working with bootstrap css
Context: Developing a "google-calendar-like" hardware booking tool at work using DJango. View reservations (their time slot and reserving user). Click empty space to create another reservation (bootstrap modal form) Click on your own reservation to edit (bootstrap modal form) "Calendar" is updated dynamically by querying server (AJAX - GET). Reservation data is updated in a similar fashion (AJAX - POST). example The "calendar" is a custom setup made entirely of divs (I was having trouble with positioning of reservations inside td). <main class="container"> <div class="calendar"> <div class="calendar_col"> <div class="calendar_header"></div> {% for time in time_range %} <div class="calendar_header">{{ time }}:00 - {{ time|add:1 }}:00</div> {% endfor %} </div> {% for weekday in weekdays %} <div style="height: {{ time_range|length|add:1|mul:1.25 }}em" class="calendar_col" id="{{ weekday|lower }}"> <div class="calendar_header">{{ weekday }}</div> {% for time in time_range %} <div id='{{ weekday|lower }}_{{ time }}h' class="calendar_seperator" style="position: absolute; top: {{ forloop.counter|mul:1.25 }}em">&nbsp;</div> {% endfor %} </div> {% endfor %} </div> </main> Some reservations can span multiple days (such as Monday to Thursday in example image). To make it easier to identify such, I want to highlight all the concerned blocks when hovering with mouse. When creating the blocks I give the the "reservation" class and "weekday_reservationpk" for …