Re: Hi django

2021-06-24 Thread DJANGO DEVELOPER
muhammad haris salamat just make a form in your template, then have a name='any name here' and then make a view in which you have to get the name in the following way. query = request.POST.get('any name here') and then do this: value = ModelName.objects.filter(Q(model_field = query) On Thu, Jun 2

Re: Hi django

2021-06-24 Thread muhammad haris salamat
Hi all can u help me plz how I can use filter with Contain query in Django I wanna fetch all data from my database with the help of filter query On Thu, 24 Jun 2021, 9:17 pm Richard Dushime, wrote: > THANK U I HAVE DONE TO FIX IT ITS NOW WORKING > > On Thu, Jun 24, 2021 at 6:04 PM Julio Cojom >

Re: Hi django

2021-06-24 Thread Richard Dushime
THANK U I HAVE DONE TO FIX IT ITS NOW WORKING On Thu, Jun 24, 2021 at 6:04 PM Julio Cojom wrote: > Django framework uses urls to math the html files. This work with the same > syntax of static files, you would use {% url 'app:viewname' %} to render > any page with Django. > > You should check th

Re: Hi django

2021-06-24 Thread Julio Cojom
Django framework uses urls to math the html files. This work with the same syntax of static files, you would use {% url 'app:viewname' %} to render any page with Django. You should check the docs of urls to understand how it works and get this done. Regards El jue., 24 de junio de 2021 9:00 a. m

Re: hi [django-users]How to define the response?

2013-06-26 Thread Sandro Dutra
Did you test this code? I think this code has errors... If your objective is parse html/xml/json I think you've to check if the application doesn't provide an API, and use the correct python library to parse. If you need to parse by force, I think you can use BeautifulSoup. 2013/6/26 lx > hi :

Re: hi [django-users] How to do something after "return HttpResponse(html)"?

2013-06-26 Thread Michael Anckaert
On 25/06/13 12:35, lx wrote: > hi all: > I want to do someing after "return HttpResponse(html)". > for example > "" > from django.http import HttpResponse > import datetime > def current_datetime(request): > now = datetime.datetime.now() > html = "It is now %s.

Re: hi [django-users] How to do something after "return HttpResponse(html)"?

2013-06-25 Thread lx
Thank you. But I want to fix it like this, because the time of "do something" is not long. ### from django.http import HttpResponseimport datetimedef current_datetime(request): now = datetime.datetime.now() if now == 2013:

Re: hi [django-users] How to do something after "return HttpResponse(html)"?

2013-06-25 Thread Hector Armando Vela Santos
You can use Celery for that, I've done something similar, just with a CSV instead of a XML, check this http://docs.celeryproject.org/en/latest/django/first-steps-with-django.html once installed and configured, its as simple as: from celery import task if (the xml format is ERROR) == True:

Re: hi [django-users] How to do something after "return HttpResponse(html)"?

2013-06-25 Thread Sandro Dutra
If the "do_something" will take a long time to finish, you've 2 options: Find a better (optimized) way to "do_something" or inform your client the application is doing something and he will have to wait a little. So, I can't see any advantage to say to your client there's something was ok if the a

Re: hi [django-users] How to do something after "return HttpResponse(html)"?

2013-06-25 Thread lx
Thank you. The real demand is: 1. receive the xml file from client. 2. if (the xml format is ERROR) == True: return HttpResponse(ERROR FORMAT") else: return HttpResponse(RIGHT FORMAT") #I must give a response first, And do other thing. Because the spend time of do_something() may be

Re: hi [django-users] How to do something after "return HttpResponse(html)"?

2013-06-25 Thread Sandro Dutra
The question is: What you're trying to do? 1. You can do any other process before the return line, the return will be the same... for example: from django.http import HttpResponse from datetime import datetime def current_datetime(request): now = datetime.now() html = "It is n

Re: hi [django-users] How to do something after "return HttpResponse(html)"?

2013-06-25 Thread Timster
You cannot do something after the "return" line. This is Python functionality. When you return, the function exits and does not process anything else. What exactly are you trying to do? There is probably another way to accomplish it. -- You received this message because you are subscribed to