Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Getting "Invalid filter: 'mul'" when trying to do multiplication on my Django template
I'm using Django/Python 3.7. I want to do multiplication and division on my page so I was following this page about filters -- https://pypi.org/project/django-mathfilters/ . However, when I try this on my page {{ fp_stat.total_score|mul:fp_stat.num_articles }} I get the error Invalid filter: 'mul' What gives? I have verified that I can print out each number individually. -
How to test views using mocked serializers and models in Django Rest Framework
I'm trying to test my Django views by mocking the serializers and model methods used in the view. However, my test client keeps attempting to connect to the database even after I have patched the models and serializer save methods (I do not want to connect to database in these unit tests.) models.py class Person(models.Model): first_name = models.CharField(max_length=100) last_name = models.CharField(max_length=100) class Meta: managed = False db_table = 'Person' serializers.py class PersonSerializer(serializers.ModelSerializer): class Meta: model = Person fields = ('first_name', 'last_name') views.py class PersonCreate(generics.CreateAPIView): serializer_class = PersonSerializer def perform_create(self, serializer): id = self.get_next_available_id() serializer.save(id=id) tests.py def test_create_person(self, client, mocker): PersonFactory.build() data = { 'first_name': 'test' 'last_name': 'user' } mocker.patch.object(PersonSerializer, 'save', auto_spec=True) url = reverse('create-person') response = client.post(url, data) # requires access to database assert response.status_code = status.HTTP_201_CREATED A test that I wrote which calls the method directly and also provides code coverage, BUT does not use the client. def test_create_person(self, client, mocker): PersonFactory.build() serializer = mocker.patch.object(PersonSerializer, 'save') view = PersonCreate() PersonCreate.perform_create(view, serializer) serializer.save.assert_called_once() How can I use the Django test client to unit tests my views while mocking the model/serializer dependencies? -
Integrity error, Not null constant restrained when creating a new game instance
I'm trying to make a web app that allows you to track Spikeball games in a blog like style. I've tried setting the author of each game to be the current user then delegating with super to save the form when it's submitted but I'm still getting: IntegrityError at /game/new/ NOT NULL constraint failed: spike_stats_game.creator_id Here's my models: from django.db import models from django.utils import timezone from django.contrib.auth.models import User class Game(models.Model): game = models.CharField(max_length=100, blank=True,null=True) score = models.CharField(max_length=10, blank=True,null=True) winner = models.CharField(max_length=20, default=None, blank=True,null=True) date_played = models.DateField(default=timezone.now) creator = models.ForeignKey(User, on_delete=models.CASCADE) player1 = models.CharField(max_length=20, blank=True,null=True) player2 = models.CharField(max_length=20, blank=True,null=True) player3 = models.CharField(max_length=20, blank=True,null=True) player4 = models.CharField(max_length=20, blank=True,null=True) def __str__(self): return self.game Here's my Views: from django.shortcuts import render from django.views.generic import ( ListView, DetailView, CreateView ) from .models import Game def home(request): context = { 'games': Game.objects.all() } return render(request, 'spike_stats/home.html', context) class GameListView(ListView): model = Game template_name = 'spike_stats/home.html' # <app>/<model>_<viewtype>.html context_object_name = 'games' ordering = ['-date_played'] # minus sign orders from newest to oldest class GameDetailView(DetailView): model = Game class GameCreateView(CreateView): model = Game fields = ['game', 'score', 'winner', 'player1', 'player2', 'player3', 'player4'] def form_valid(self, form): form.instance.author = self.request.user return super().form_valid(form) def about(request): return render(request, 'spike_stats/about.html', {'game': … -
int() argument must be a string when trying to do a form in django
i have a problem. I am trying to do a edit form with django. But when i go to the url to edit for example: /adminview/edit/1/ i got the message: TypeError at /adminview/edit/1/ int() argument must be a string, a bytes-like object or a number, not 'builtin_function_or_method' Request Method: GET Request URL: http://127.0.0.1:8000/adminview/edit/1/ Django Version: 2.1.5 Exception Type: TypeError this is my urls.py: app_name = 'adminview' urlpatterns = [ url(r'^$', index_admin, name="adminview"), url(r'^clasification', clasification, name="clasification"), url(r'^edit/(?P<id_category>\d+)/$', edit_clasificacion, name="edit_clasificacion"), ] and this is a part from my views.py where i have the function that i am trying to built: def edit_clasificacion(request, id_category): clasificacion = Clasificacion.objects.get(id=id) if request.method == 'GET': form = ClasificacionForm(instance=clasificacion) else: form = ClasificacionForm(request.POST, instance=clasificacion) if form.is_valid(): form.save() return redirect('article:index') return render(request, 'adminview/clasification.html', {'form':form}) any help? thanks a lot! -
How do I call celery tasks from Django Channels?
I am building a chat application where I handle websocket requests via Django channels. Now, every time i receive a new send_message request. I have to store it in db and send a notification via firebase to the user. How do I do that? Should I call some celery task? Or should I handle it asynchronously via channels only? Also, how do i maintain a single instance of push_service through out the channels. To do that should I create the instance in settings file? Basically I am confused about where should I declare it. import pyfcm import FCMNotification push_service = FCMNotification(api_key=fcm_config['GCM_API_KEY']) Thanks in advance. -
How to connect Djongo ORM to mongo atlas?
I am trying to connect my django instance to a mongo db cluster using djongo. I have checked from various sources and the way it is getting closer to work is: Install dnspython Have the following DATABASES dict in settings.py DATABASES = { 'default': { 'ENGINE': 'djongo', 'NAME': 'test', 'HOST': 'mongodb+srv://mongo_usr:' + urllib.parse.quote('mypassword') + '@domain_assigned.mongodb.net/test?ssl=true&ssl_cert_reqs=CERT_NONE&retryWrites=true', 'ENFORCE_SCHEMA': False } } It truly finds the endpoint but I am getting a weird error: pymongo.errors.ServerSelectionTimeoutError: connection closed,connection closed,connection closed has anyone fixed this before? -
Django: Querysets to get choices from a model field
I have a simple appointment app that lets users sign up for unfilled timeslots. The user would select a date and query the database for timeslots that are available for that day. How would I make a query to get timeslots that are still available? models.py class Appointment(models.Model): TIMESLOT_LIST = ( (1, '10:00 – 11:00'), (2, '11:00 – 12:00'), (3, '12:00 – 13:00'), (4, '13:00 – 14:00'), (5, '14:00 – 15:00'), (6, '15:00 – 16:00'), (7, '16:00 – 17:00'), (8, '17:00 – 18:00'), (8, '18:00 – 19:00'), ) date = models.DateField(default=date.today) timeslot = models.IntegerField(choices=TIMESLOT_LIST, null=True) views.py def make_appointment(request): all_appointments = Appointment.objects.values_list('timeslot') appointments = Appointment.objects.filter(user=request.user) data_input = request.GET.get('date') available_appointments = Appointment.objects.filter(date = data_input).exclude(timeslot = appointments).values_list('timeslot').order_by('timeslot') return TemplateResponse(request, 'scheduling/appointment.html', {"appointments" : appointments, "all_appointments" : all_appointments, "data_input": data_input}) -
My new migration will brake my database on the heroku (postgres)
I am facing a challenge here. So I inhertied the models from previous developers and the tables were not properly built. I added some constraints and new tables in order to normalize those tables. Before pushing the application to the heroku I tested it on my local machine and it actually broke my database. Now the heroku website is already in production, so there are user information. How should i approach this, do I need to destroy the existing database and create a new one and run the migrations -
How can I output a multiply expression in a Django template?
I'm using Django and Python 3.7. On my view, how can I output an expression? I would like to do <td>{{ fp_stat.avg_score * dow_index }}</td> but I get this error Could not parse the remainder: ' * dow_index' from 'fp_stat.avg_score * dow_index' I would prefer not to create an additional attribute in my model, but if that's the only way then I guess I'll have to do that. -
How to upload multiple files from the Django admin?
I want to upload multiple files in the Django admin, without having to place multiple FileField fields. The user can be able to manage the files in a simple way; upload, delete or change each uploaded file but upload several at once. the solution I see viable is to use several filefield but the problem is, i dont know how many files the user will upload def case_upload_location(instance, filename): case_name = instance.name.lower().replace(" ", "-") file_name = filename.lower().replace(" ", "-") return "casos/{}/{}".format(case_name, file_name) class Case(models.Model): # datos del caso name = models.CharField('Nombre', max_length=250) observations = models.TextField('Observaciones', null = True, blank = True) number_folder = models.CharField('Numero de Carpeta', max_length=250) file1 = models.FileField('archivo 1', upload_to=case_upload_location, null = True, blank = True) file2 = models.FileField('archivo 2', upload_to=case_upload_location, null = True, blank = True) file3 = models.FileField('archivo 3', upload_to=case_upload_location, null = True, blank = True) file4 = models.FileField('archivo 4', upload_to=case_upload_location, null = True, blank = True) Final Target Multiple files to upload(user need to delete or change one by one but upload all at once). -
Can't update gunicorn python path while deploying django application
I'm following tutorial from digitalocean.com for deploying python django application with nginx and gunicorn, however gunicorn points to my old application python path, not the actual path. Tutorial link that i followed to deploy application: https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-16-04. After running command "sudo journalctl -u gunicorn" i get error: ''' Apr 05 19:35:15 szymon-MS-7B86 gunicorn[9375]: Traceback (most recent call last): Apr 05 19:35:15 szymon-MS-7B86 gunicorn[9375]: File "/home/szymon/Desktop/digital_ocean/myprojectenv/local/lib/python2.7/site-packages/gunicorn/arbiter.py", l Apr 05 19:35:15 szymon-MS-7B86 gunicorn[9375]: worker.init_process() Apr 05 19:35:15 szymon-MS-7B86 gunicorn[9375]: File "/home/szymon/Desktop/digital_ocean/myprojectenv/local/lib/python2.7/site-packages/gunicorn/workers/base.p Apr 05 19:35:15 szymon-MS-7B86 gunicorn[9375]: self.load_wsgi() Apr 05 19:35:15 szymon-MS-7B86 gunicorn[9375]: File "/home/szymon/Desktop/digital_ocean/myprojectenv/local/lib/python2.7/site-packages/gunicorn/workers/base.p Apr 05 19:35:15 szymon-MS-7B86 gunicorn[9375]: self.wsgi = self.app.wsgi() Apr 05 19:35:15 szymon-MS-7B86 gunicorn[9375]: File "/home/szymon/Desktop/digital_ocean/myprojectenv/local/lib/python2.7/site-packages/gunicorn/app/base.py", Apr 05 19:35:15 szymon-MS-7B86 gunicorn[9375]: self.callable = self.load() Apr 05 19:35:15 szymon-MS-7B86 gunicorn[9375]: File "/home/szymon/Desktop/digital_ocean/myprojectenv/local/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py Apr 05 19:35:15 szymon-MS-7B86 gunicorn[9375]: return self.load_wsgiapp() Apr 05 19:35:15 szymon-MS-7B86 gunicorn[9375]: File "/home/szymon/Desktop/digital_ocean/myprojectenv/local/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py Apr 05 19:35:15 szymon-MS-7B86 gunicorn[9375]: return util.import_app(self.app_uri) Apr 05 19:35:15 szymon-MS-7B86 gunicorn[9375]: File "/home/szymon/Desktop/digital_ocean/myprojectenv/local/lib/python2.7/site-packages/gunicorn/util.py", line Apr 05 19:35:15 szymon-MS-7B86 gunicorn[9375]: __import__(module) Apr 05 19:35:15 szymon-MS-7B86 gunicorn[9375]: ImportError: No module named myproject.wsgi ''' My actual path to application is: /home/szymon/digital_ocean/myprojectenv I tried this command " PYTHONPATH=pwd/.. gunicorn --bind 0.0.0.0:8000 myproject.wsgi:application " but it didn't solve the problem. Restarting gunicorn or even reinstalling didn't solve it as … -
Django & DataTables - Returning to Template after POST
I'm using DataTables with Django. I'm able to render the template initially, the table is allowing edits, sending them to my urls.py and makes it to the views where I can print it. However, I've been trying to render the new information back to the template and my attempts are failing. How do I process the request and send the new data to the template? I looked at this example. But my dict query does not have a designated pk. Also, when I tried using PUT(used PUT in both Editor script and views) and it did not work. This is what I get with print(POST) in the views: <QueryDict: {'action': ['edit'], 'data[221][sr_id][ex_ID][ex_name]': [''], 'data[221][results_id][title]': ['10']}> I tried print(POST[0]) to see if I could split the values and it says raise MultiValueDictKeyError(key) django.utils.datastructures.MultiValueDictKeyError: 0 . I tried print(POST[key]) and it says: key is not defined My id key in this example is 221 and the value that was updated is 10. How can I access this values? And after saving and updating how can I go back to the template? I tried: def save_json(request): print(request.POST[0]) # function to save data will go here return render('e:all_json') Are my problems because I'm not … -
In Django, what's the right way to pre-select a form option tag?
I'm using Django and Python 3.7. I want to create a SELECT menu on my template so I tried this ... <select id="website_id" name="website_id"> <option value="">Select a website</option> {% for website in websites %} <option value="{{ website.id }}" {{ 'selected' if website_id == website.id else '' }}>{{ website.path }}</option> {% endfor %} </select> but I get this error Could not parse the remainder: ' if website_id == website.id else ''' from ''selected' if website_id == website.id else ''' Its choking on my "if" expression. What's the preferred way to set the "selected" attribute of an option tag? -
order_by in django, postgresql is not working
I have list of the countries. I am trying to order them alphabetically. But my query is ordering by id. I tried 'country = Country.ojbects.all().order_by('name') my views.py def countries(request): user = User.objects.all() country = Country.objects.filter('name').order_by('name') context = { 'posts': country, 'user': user } return render(request, 'users/countries.html', context) My models.py class Country(models.Model): name = models.CharField(max_length=100, blank=True, null=True) def __str__(self): return self.name my html: {% for post in posts %} <table class="table table-hover text-left col-sm-6" style="table-layout: fixed; word-wrap: break-word;"> <tbody> <tr> <td>{{ post.id }}</td> <td><a class="text-uppercase" href="{% url 'users:cities' post.pk %}">{{ post.country }}</a> </td> </tr> </tbody> </table> I want alphabetical order of the country names in my dropdown. -
How to save responses from registered users and process/filter them in Django
TLDR; Django newbie here, following this blog, I tried to create a Django app where the students can answer the questions using normal text instead of multiple choice question. This project currently lets the teachers create 'Quiz'es, in which the owner is the teacher creating it, gives the quiz a name and chooses which subject it is (e.g. Maths, History). The quiz is a multiple choice type, with a few correct answers. Every correct answer awards 100 points, and the teacher defines which responses are the correct ones. class Quiz(models.Model): owner = models.ForeignKey(User, on_delete=models.CASCADE, related_name='quizzes') name = models.CharField(max_length=255) subject = models.ForeignKey(Subject, on_delete=models.CASCADE, related_name='quizzes') def __str__(self): return self.name Every student has some chosen interests, based on which quizzes can appear in his feed. class Student(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE, primary_key=True) quizzes = models.ManyToManyField(Quiz, through='TakenQuiz') interests = models.ManyToManyField(Subject, related_name='interested_students') def get_unanswered_questions(self, quiz): answered_questions = self.quiz_answers \ .filter(answer__question__quiz=quiz) \ .values_list('answer__question__pk', flat=True) questions = quiz.questions.exclude(pk__in=answered_questions).order_by('text') return questions def __str__(self): return self.user.username Every time a student answers a quiz, the answers are saved in a model called StudentAnswer. class TakenQuiz(models.Model): student = models.ForeignKey(Student, on_delete=models.CASCADE, related_name='taken_quizzes') quiz = models.ForeignKey(Quiz, on_delete=models.CASCADE, related_name='taken_quizzes') score = models.FloatField() date = models.DateTimeField(auto_now_add=True) class StudentAnswer(models.Model): student = models.ForeignKey(Student, on_delete=models.CASCADE, related_name='quiz_answers') answer = … -
Managing to use data from one Django application in another but the urls are different
In this previous question I asked about using data from one Django application in another. I wanted to use blog data from my blog application in my pages application. The goal being that my site homepage would show the 3 most recent entries. The answer provided was acceptable at the time. However, I've since wanted to now set the blog items that appear on my homepage to act as links to the blog item itself but the blog items on my homepage have a different url path. Is there any way around this? Here is my code: Blog from .views import ( BlogListView, BlogUpdateView, BlogDetailView, BlogDeleteView, BlogCreateView, ) urlpatterns = [ path('<int:pk>/edit/', BlogUpdateView.as_view(), name='Blog_edit'), path('<int:pk>/', BlogDetailView.as_view(), name='Blog_detail'), path('<int:pk>/delete/', BlogDeleteView.as_view(), name='Blog_delete'), path('new/', BlogCreateView.as_view(), name='Blog_new'), path('', BlogListView.as_view(), name='Blog_list'), ] models.py class Blog(models.Model): title = models.CharField(max_length=255) body = models.TextField() date = models.DateTimeField(auto_now_add=True) author = models.ForeignKey( get_user_model(), on_delete=models.CASCADE, ) thumb = models.ImageField(blank=True, null=True) def __str__(self): return self.title def get_absolute_url(self): return reverse('Blog_detail', args=[str(self.id)]) views.py class NewsListView(ListView): model = News template_name = 'news_list.html' class NewsDetailView(DetailView): model = News template_name = 'news_detail.html' login_url = 'login' class NewsUpdateView(LoginRequiredMixin, UpdateView): model = News fields = ('title', 'body', 'thumb') template_name = 'news_edit.html' login_url = 'login' def test_func(self): obj = self.get_object() … -
Authenticate django view with drf authentication class
I am using Django Rest Framework for developing an api. The drf uses jwt authentication using django-rest-framework-simplejwt. For notifications I am using django-notifications. But the issue is django-notificaitons is not able identify that the user is authenticated. Upon further analysis I found that, its cause the django-notifications uses normal Django views. So the question is how can i authenticate Django views using Drf Authentication classes? -
How to pass values from ajax script to rest of the Javascript code?
I am working with a django 2.0 template, a third party jQuery script for tagging photos, and my "glue" JavaScript code. I am a complete newbie to JavaScript and JQuery. I can make a successful ajax call to the django template to get the data I want. However, I cannot seem to find a way to make that data available to the rest of my code, and in particular the third party tagging script. My code: (function($) { $(document).ready(function(){ console.log("Made it! Image width="+$( "#img1" ).width()+", height="+$( "#img1" ).height()); // Ajax request to get the list of auto complete names from the server // This function works correctly - all console messages in the function work var autoCompleteNames = function() { var tmp = null; $.ajax({ url: '/biometric_identification/ajax/get_people_list/', type: 'get', dataType: 'json', success: function (data) { console.log('in success data='+data); tmp = data; console.log('tmp 1='+tmp); console.log('tmp[0]='+tmp[0]) } }); return tmp; }(); // this statement returns null for autoCompleteNames console.log('autoCompleteNames 3='+autoCompleteNames); // Stuff for the third party tagging script $("#img1").tag({ showTag: 'always', canDelete: true, canTag: true, defaultTags: [ {'id':1,'label':'Unchanged','width':283,'height':283,'top':1020,'left':1539}, {'id':2,'label':'Scaled','width':72,'height':72,'top':208,'left':151}, ], autoComplete: autoCompleteNames, }); }); })(jQuery); As you can see in the comments in the code, the ajax part works, but when I … -
jQuery not loading: Failed to load resource: The request timed out
I'm developing an Django Webapp and I've recently been having issues with jQuery. Within my Webapp on Safari web browser, the main web page stalls and never loads jQuery source code resource from the CDN. Keep receiving this error "Failed to load resource: The request timed out." I have tried my app on other computers within my home network, but it does not work there either. Tested it at my work and everything is flawless. I also maintain a website that is utilizing jQuery and it's having the same issue. Some solutions I've attempted: Clearing the browser histories and cookies. I also used some CLI tools like ping and traceroute to determine if the problem is somehow network related or the resource being blocked. Is it possible jQuery is being blocked? <body> <!-- Content is here ... --> {% load static %} <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script> <script src="https://cdn.rtlcss.com/bootstrap/v4.2.1/js/bootstrap.min.js" integrity="sha384-a9xOd0rz8w0J8zqj1qJic7GPFfyMfoiuDjC9rqXlVOcGO/dmRqzMn34gZYDTel8k" crossorigin="anonymous"></script> <script src="{% static 'js/app.js' %}"></script> </body>``` I would like to resolve this issue ASAP. Thanks! -
What is workable VS Code configuration to debug Django custom commands?
I am using Visual Studio Code IDE to develop, debug my Django project. I have few management custom commands and don't know how to debug that code from VS Code. I have tried different configurations but none works. Configuration I have tried is { "name": "Python: Module", "type": "python", "request": "launch", "program": "${workspaceFolder}/manage.py", "args": [ "send_daily", ], "console": "integratedTerminal" }, This configuration not stopping at breakpoints I have setup. I expect the debugger starts and execution stops at the break points setup in the custom command code. -
How to pass files that were uploaded via bootstrap modal form to django form/formset?
I'm building a page for placing a new order which can consist of several items. New item is added via bootstrap modal form, and one of the fields is an input for uploading a file (it's an ImageField in django model). My problem is that I don't know how and where to store these uploaded files so that I can save them all at once when the main Order form is submitted. There are two models I'm working with: Order and Item, and they are bound with a one-to-many relation (like, Item.order_id is a FK for Order.id). So a user opens a page for a new order, fills all the Order fields, then adds several Items (with pictures), clicks Submit and then the Order and Items are saved to DB. There also should be a good-looking and compact list of added items which is refreshed after every new item is added, so I have a bootstrap table which is simply updated with js script. At first, I decided to store all the submitted values in this table (in hidden fields), but couldn't figure out how to store an uploaded file, and to be honest it doesn't look like a good … -
Django: problem comparing strings in temaplte
I´m doing a simple {% if %} comparison but can´t get the strings to match. {% if request.user.username == empresa.vendedor|stringformat:"s" %} I checked classes and: request.user.username is <class 'str'>. empresa.vendedor|stringformat:"s" is <class 'str'>. I print a case and: request.user.username is Mariano. empresa.vendedor|stringformat:"s" is Mariano. In the model empresa.vendedor is a foreign key of vendedores.nombre Also tryied {% if empresa.vendedor|stringformat:"s" in request.user.username %} {% if request.user.username in empresa.vendedor|stringformat:"s" %} What I´m missing here? Thanks in advance. -
Django circular import dependency between Model and Custom querysets
I'm using some complex Raw Querysets, and I separated the Model and the Model Custom Queryset in 2 separated files. In Model I need to import the custom queryset: objects = OwnerModelQuerySet.as_manager() For each method of the custom queryset class I use: Owner.objects.raw( so I need to import the model. So I have a circular dependency issues. Is there any way in the custom queryset to access/get the model without directlly using the name ? -
How to add IP address of authentificated users in django admin
Could you please help me with Django-Admin part in order to save and see the last used IP address for the authenticated user(session). In my understanding I have to customize the user model but how to do this in the best easiest way ? Also at what time/state/moment should I define IP for for the User model ? I expect to have additional field in the User model which contains the last used client IP -
mobile number registeration in django
I'm working on a project that Users need to sing up with just a phone number(by sending a sms code to the their phone number and verifying it) so i searched a lot but i couldn't came along the best way to do so. what i know so far is i should extend the django user model and there are 3 option to do that. 1.Creating my own user model by subclassing Django’s AbstractBaseUser, 2. Extend the existing User Model with my own fields by subclassing Django’s AbstractUser, 3. Add fields to the existing User class using the OneToOneField method. Any of these methods has their own complication and I`m not sure which one should i use. I just need the users verified phone numbers as my model`s primary field, a password and also an arbitrary username and image field for their profile. so in your opinion how should i make my user and what is the best way to do that? any explanation from your own experience or link or tutorial would be helpful. thanks in advance