Re: how to initialize input form fields using URL parameters

2023-01-23 Thread Michael Maina
Hello, You need to start from the urls.py file and define a path that looks close this your_path/ or your_path/ Then change your view to handle the new parameter def form_view(request, variable_data): Within your view you can now manipulate this parameter through a variable/function/class

how to initialize input form fields using URL parameters

2023-01-22 Thread Andrew Brown
I am trying to pass initial values to my form set via URL Query ex) Localhost:8000?/First_name_id_0=Samuel [image: forms.py.png] I was told to use the initial parameter and not the instance in my view first "An inline formset is related to one instance of the parent model. You identify *which*

Re: File Upload with additional Parameters

2020-10-11 Thread Dvs Khamele
Hi do you hire contract based python/django freelancer? We can help you in this and related tasks at fair prices. Reply or send email to divy...@pythonmate.com Best Regards, Divyesh Khamele, Pythonmate On Fri, 9 Oct 2020, 11:20 pm Noel Simela, wrote: > Hi guys, > > Any suggestions on the best a

File Upload with additional Parameters

2020-10-09 Thread Noel Simela
Hi guys, Any suggestions on the best approach to achieve the below with Django's upload handlers. I was reviewing documentation at https://docs.djangoproject.com/en/3.1/topics/http/file-uploads/ On upload I want to be able to read the contents of the document as per below. Read: –File Name, Auth

Re: TypeError: object() takes No Parameters

2020-09-17 Thread coolguy
gt; aggregates the data into a list of dictionaries. I read to use the >>> SingleTableMixin that all I needed was an iterable containing a data >>> structure that has a key(a list of dicts) and then to instantiate a table >>> in tables.py and pass to a my views Class. I

Re: TypeError: object() takes No Parameters

2020-09-17 Thread Patrick Carra
get_response [Thu Sep 17 23:07:26.871073 2020] [wsgi:error] [pid 39120] [remote 142.136.2.27:45290] response = wrapped_callback(request, *callback_args, **callback_kwargs) [Thu Sep 17 23:07:26.871079 2020] [wsgi:error] [pid 39120] [remote 142.136.2.27:45290] TypeError: object() takes no param

Re: TypeError: object() takes No Parameters

2020-09-17 Thread Patrick Carra
ueries my database and >> aggregates the data into a list of dictionaries. I read to use the >> SingleTableMixin that all I needed was an iterable containing a data >> structure that has a key(a list of dicts) and then to instantiate a table >> in tables.py a

Re: TypeError: object() takes No Parameters

2020-09-17 Thread coolguy
pass to a my views Class. I am getting an error when I do > this TypeError: Object() takes no parameters. I have included a link to > the django tables 2 doc and my code below: > > #views.py > from django_tables2.views import SingleTableMixin > from django_tables2.ex

TypeError: object() takes No Parameters

2020-09-17 Thread Patrick Carra
list of dicts) and then to instantiate a table in tables.py and pass to a my views Class. I am getting an error when I do this TypeError: Object() takes no parameters. I have included a link to the django tables 2 doc and my code below: #views.py from django_tables2.views import

Path parameters and security scanners best practice

2020-06-15 Thread Dan Davis
I have an odd question. When I have a path parameter that is validated to be alphanumeric, and a security scanner sends a non-alphanumeric value, Django properly validates and then returns 404. However, this gives the security scanner the mistaken impression that there is some some sort of s

Re: Issue with passing parameters in urls

2020-04-01 Thread aniket kamthe
hey Antje, Let me check and get back. I think I have got the problem, I will get back if I have further issues. On Wed, Apr 1, 2020 at 2:32 PM Antje Kazimiers wrote: > Hi Aniket, > > Your thread object in your template is actually a message since your > passing messages to context in your view.

Re: Issue with passing parameters in urls

2020-04-01 Thread Antje Kazimiers
Hi Aniket, Your thread object in your template is actually a message since your passing messages to context in your view. but when you initialize messages you don't set a name attribute. So I would double check your Message model if it has a name attribute. btw your error message didn't display

Issue with passing parameters in urls

2020-03-30 Thread aniket kamthe
Hey All, I have been watching your youtube tutorials and have been stuck on an issue for a while now. Can you help me out pls - I am trying to pass a parameter via a button in an HTML file and using that in the next link to access a specific set of entries from the database - HTML File code

Re: unable to read POST parameters sent by payment gateway

2020-03-13 Thread sercan t.
end. 9 Mart 2020 Pazartesi 23:23:24 UTC+3 tarihinde Sreekanth yazdı: > > I am unable to read POST parameters sent by payment gateway after payment > was processed. Payment gateway redirects to returnUrl (I pass this to > payment gateway before payment was processed) with some paramet

Re: unable to read POST parameters sent by payment gateway

2020-03-11 Thread Naveen Arora
There is something wrong with URL, you are pushing, try using some other url, append slash, etc. That may help you :) Cheers On Tuesday, 10 March 2020 01:53:24 UTC+5:30, Sreekanth wrote: > > I am unable to read POST parameters sent by payment gateway after payment > was processed

unable to read POST parameters sent by payment gateway

2020-03-09 Thread Sreekanth
I am unable to read POST parameters sent by payment gateway after payment was processed. Payment gateway redirects to returnUrl (I pass this to payment gateway before payment was processed) with some parameters by POST request. In url.py path('cashfreeresponse/',views.cashfre

Django translate_url not working with optional parameters

2019-09-26 Thread NKSM
versed, args=match.args, kwargs=match. kwargs) except NoReverseMatch: pass else: url = urlunsplit((parsed.scheme, parsed.netloc, url, parsed. query, parsed.fragment)) return url Django can not tranlate url get an error NoReverseMatch because kwargs

Django translate_url not working with optional parameters

2019-09-26 Thread NKSM
versed, args=match.args, kwargs=match. kwargs) except NoReverseMatch: pass else: url = urlunsplit((parsed.scheme, parsed.netloc, url, parsed. query, parsed.fragment)) return url Django can not tranlate url get an error NoReverseMatch because kwargs

Re: Django parameters

2019-08-13 Thread Derek
You're better off adopting an existing CMS built on top of Django, and checking how close its feature set matches your needs. If there is a gap, then contact the developers to see how that gap could be closed. Some examples:. https://www.django-cms.org/en/features/list/ or https://wagtail.i

Re: Django parameters

2019-08-12 Thread Jani Tiainen
Hi. Yes and no. Django isn't cms but web application development library written in python. So yes you can do all those things. How much work and effort it requires depends on many factors. ma 12. elok. 2019 klo 14.13 tomas mracnik kirjoitti: > Hi, we are considering a new cms system in our

Django parameters

2019-08-12 Thread tomas mracnik
Hi, we are considering a new cms system in our company. Does Django allows features like customize widget , emmbeding and single sign-on Active directory or office 365 ? Thank you for your answers. -- You received this message because you are subscribed to the Google Groups "Django users" grou

django-storages parameters

2019-05-04 Thread Britto .
Hello All, How could we find out what are the parameters are available for a variable in django-storages? For example AWS_S3_OBJECT_PARAMETERS what are the available parameters? Where could we find it? Cannot see it in django-storages documentation other than a sample. AWS_S3_OBJECT_PARAMETERS

Re: Separating remote vs local settings.py parameters - - “EMAIL”?

2019-03-16 Thread Phillip Moracha
If you take a look at this gist provided by a Udemy instructor and at this specific location <https://gist.github.com/bradtraversy/cfa565b879ff1458dba08f423cb01d71#local-settings-setup>, here he wisely recommends separating important local development configuration parameters, such as SECRE

Re: Separating remote vs local settings.py parameters - - “EMAIL”?

2019-03-16 Thread Ahmed Ishtiaque
ango supports email settings. I > don’t really understand what these EMAIL parameters would be used for. For > example, EMAIL_BACKEND says: > > Default: 'django.core.mail.backends.smtp.EmailBackend >> <https://docs.djangoproject.com/en/2.1/topics/email/#django.core.mail.back

Re: Separating remote vs local settings.py parameters - - “EMAIL”?

2019-03-16 Thread drone4four
understand what these EMAIL parameters would be used for. For example, EMAIL_BACKEND says: Default: 'django.core.mail.backends.smtp.EmailBackend > <https://docs.djangoproject.com/en/2.1/topics/email/#django.core.mail.backends.smtp.EmailBackend> > ' > The backend to use for sen

Re: Separating remote vs local settings.py parameters - - “EMAIL”?

2019-03-15 Thread Ahmed Ishtiaque
ecommends separating important local development > configuration parameters, such as SECRET _KEY. Of course everyone knows how > stupid and foolish it would be to share the SECRET_KEY publicly on GitHub > and then to use it in your production environment. > > > So here is the list of para

Separating remote vs local settings.py parameters - - “EMAIL”?

2019-03-15 Thread drone4four
If you take a look at this gist provided by a Udemy instructor and at this specific location <https://gist.github.com/bradtraversy/cfa565b879ff1458dba08f423cb01d71#local-settings-setup>, here he wisely recommends separating important local development configuration parameters, s

Re: How to send parameters to templates and adjust the page url by path?

2018-12-13 Thread Saeed Pooladzadeh
Thank you Ira در چهارشنبه 12 دسامبر 2018، ساعت 19:21:26 (UTC-8)، lingo...@gmail.com نوشته: > > Hello, > > How to send parameters to templates and adjust the page url by path? > > regards, > > Saeed > -- You received this message because you are subscribed to the G

Re: How to send parameters to templates and adjust the page url by path?

2018-12-12 Thread Ira Abbott
hi, This is not much to go on: The 'parameters' are called 'context' You can read: https://docs.djangoproject.com/en/2.1/ref/templates/api/ to learn about templates and context. adding context in a view is done by adding context to a view as follows: def get_cont

How to send parameters to templates and adjust the page url by path?

2018-12-12 Thread lingo . saeed
Hello, How to send parameters to templates and adjust the page url by path? regards, Saeed -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to dj

Url parameters don't work

2018-04-30 Thread Саша Губський
Hi, have GET request : https://mydomain/auth/complete/instagram/?code=mycode And i want to get parameter 'code' path('auth/complete/instagram/', views.instagram, name='auth') def instagram(request): code = request.GET.get('code') if code: return HttpResponse(code) return HttpRespon

Re: Passing parameters to SOAP Zeep client

2017-11-28 Thread giuseppe ricci
he wsdl file is: > > > This is the Django users mailing list, so we probably won't be of much > help. You should investigate the support forums for Zeep. > > I piloted a small program using it a year or so ago, but I don't have much > experience with it as the project w

Re: Passing parameters to SOAP Zeep client

2017-11-28 Thread James Schneider
est) The problem it seems the manner of passing the parameters. With this other manner: call=client.service.creaCarrello(', {11223344, {'causale':'prova', 'codiceEnte':'CCIAA_MI', \ 'importo':2, 'importoImposta':1, 'importoTota

Passing parameters to SOAP Zeep client

2017-11-28 Thread giuseppe ricci
l=client.service.creaCarrello(var) var=(utenteApplicativo, carrelloDto) print('variabile del client: ', var) call1=client.service.creaCarrello(var) print(call1) but I receive the error: ValidationError at /soapclient/ Missing element utenteApplicativo (creaCarrello.Ges

Re: urls with https and s3:// as parameters

2017-01-19 Thread Vijay Khemlani
Shouldn't the paths be passed as GET or POST arguments instead of part of the URL path? Why would you need the regex then? On 1/19/17, Ramon Ramirez-Linan wrote: > Hi > > I am building a django app which urls take 2 parameters a source and > destination. > The source is eit

urls with https and s3:// as parameters

2017-01-19 Thread Ramon Ramirez-Linan
Hi I am building a django app which urls take 2 parameters a source and destination. The source is either a url for a file http://something.com/file.jpg or an s3 arn s3://bucketname/key.jpg I am having difficulties creating a regex expression that matches that to route it to my view The

Re: Password hashing parameters selection methodology description

2016-12-23 Thread Tim Graham
>From the "new stable branch" tasks [0]: Increase the default PBKDF2 iterations in django.contrib.auth.hashers.PBKDF2PasswordHasher by about 20% (pick a round number). Run the tests, and update the 3 failing hasher tests with the new values. Make sure this gets noted in the release notes (see t

Password hashing parameters selection methodology description

2016-12-23 Thread Martin Koistinen
Django has a very nice implementation for hashing passwords using PBKDF2 and a number of iterations to increase the work-load. Thanks! I know this is very customizable and I know how to do this. This post is not about "how". What I would like to know is the methodology and "inputs" into decidin

Re: how to add additional parameters to the queryset in forms.py

2016-11-12 Thread ludovic coues
You already have a parameter named year so you should use self.year = year instead of self.year = kwargs.pop('year'). Same for month and day. 2016-11-12 22:39 GMT+01:00 احسان خراسانی : > HI > i want to add additional parameters to the queryset in forms > > class R

how to add additional parameters to the queryset in forms.py

2016-11-12 Thread احسان خراسانی
HI i want to add additional parameters to the queryset in forms class Reserve(forms.ModelForm): food_name = forms.ModelChoiceField(queryset=Food.objects.all()) def __init__(self, year=None, month=None, day=None, *args, **kwargs): super(Reserve, self).__init__(*args, **kwargs

Re: How to send parameters in url tag?

2016-09-20 Thread Ares Ou
Hi, You have to use a form of keyword arguments to provide parameters in {% url %} tag. For example, {% url post_view post_id=post_id %} the former post_id is the argument name in your view function, the latter post_id is the variable name in your template context. If you have more than

Re: How to send parameters in url tag?

2016-09-20 Thread Alessandro Madruga Correia
> > {%url url_name url_params%} > > where url_params as 'pk=object.id' or 'page=page.number' > Here have an example https://docs.djangoproject.com/en/1.10/topics/http/urls/#reverse-resolution-of-urls -- ,= ,-_-. =. [] Alessandro Madruga Correia ((_/)o o(\_)) [http://counter.li.org]

How to send parameters in url tag?

2016-09-20 Thread Za Ars
Hou to send parameters in url as string? {%url url_name url_params%} where url_params as 'pk=object.id' or 'page=page.number' Please, help me, if you can -- You received this message because you are subscribed to the Google Groups "Django users" group. To u

Re: Parsing PHP-style GET parameters for lists and dicts in Django

2016-02-26 Thread James Schneider
er I mean is where, say a list of two elements [1,2] is > sent as > > http://example.com/?list[0]=1&list[1]=2 > > So instead of two parameters with the same name, this has two parameters > with different names ("list[0]" and "list[1]"). PHP automatically &g

Re: Parsing PHP-style GET parameters for lists and dicts in Django

2016-02-26 Thread Remco Gerlich
Hi James, I agree with the general dirtyness of PHP and I have used Django exclusively for years. The type of parameter I mean is where, say a list of two elements [1,2] is sent as http://example.com/?list[0]=1&list[1]=2 So instead of two parameters with the same name, this has two parame

Re: Parsing PHP-style GET parameters for lists and dicts in Django

2016-02-26 Thread James Schneider
On Feb 26, 2016 1:21 AM, "Remco Gerlich" wrote: > > I need to work with DataTables, a jQuery-plugin for sortable HTML tables. > > It sends Ajax GET requests with parameters like the following (but urlencoded, of course): > > columns[0][data]=0 > columns[0][name]

Parsing PHP-style GET parameters for lists and dicts in Django

2016-02-26 Thread Remco Gerlich
I need to work with DataTables, a jQuery-plugin for sortable HTML tables. It sends Ajax GET requests with parameters like the following (but urlencoded, of course): columns[0][data]=0 columns[0][name]= columns[0][searchable]=true columns[0][orderable]=true columns[0][search][value]= columns[0

Re: are parameters compulsary in an url pattern?

2015-10-07 Thread Tim Graham
If you can accomplish what you need without passing parameters, there is certainly no requirement to do so. Have you read: https://docs.djangoproject.com/en/stable/topics/http/urls/ ? On Wednesday, October 7, 2015 at 12:10:54 AM UTC-4, krmane wrote: > > Dear all, > I just wish to

are parameters compulsary in an url pattern?

2015-10-06 Thread kk
Dear all, I just wish to know if I must have all the parameters from my form as a part of the url pattern? I need to use only the request so was wondering if that is the case? I have seen tutorials and all of them come with url parameters I don't need a url like /articles/2013/03 etc.

Re: Passing parameters / attributes to javascript in a template

2015-08-05 Thread Déborah Leder
Thank you for your answers, everyone. Alex, indeed I didn't know about the forloop last trick. It worked like a charm ! And Daniel, for some reasons I prefer not to mess with the views for now, but when if I need to clean up my code, I keep your answer in mind. -- You received this message beca

Re: Passing parameters / attributes to javascript in a template

2015-08-04 Thread Daniel Roseman
On Tuesday, 4 August 2015 17:32:11 UTC+1, Alex Heyden wrote: > > I don't quite follow what you're doing with set_first_call_true and > set_first_call_false. Are you using that to control the for loop behavior? > > If you are, take a look at > https://docs.djangoproject.com/en/1.8/ref/templates/bu

Re: Passing parameters / attributes to javascript in a template

2015-08-04 Thread Alex Heyden
I don't quite follow what you're doing with set_first_call_true and set_first_call_false. Are you using that to control the for loop behavior? If you are, take a look at https://docs.djangoproject.com/en/1.8/ref/templates/builtins/#for. Django's template language has that built in. If you're push

Re: Passing parameters / attributes to javascript in a template

2015-08-04 Thread Déborah Leder
After some more tests, I have managed to understand where my problem is (but I don't know how to resolve it). Here is my final piece of code : my_markers = [ {{ mymodel.set_first_call_true }} {% for current_addr in mymodel.addresses.all %} {% if not mymodel.first_call %},{%

Re: Passing parameters / attributes to javascript in a template

2015-08-04 Thread Vijay Khemlani
Have you checked the HTML that is actually rendered by the Django template? On Tue, Aug 4, 2015 at 10:39 AM, Déborah Leder wrote: > Hello Larry, thank you for your response. > > I didn't run the debugger, but i know that my values are correctly passed > in the template (when it it outside of the

Re: Passing parameters / attributes to javascript in a template

2015-08-04 Thread Déborah Leder
Hello Larry, thank you for your response. I didn't run the debugger, but i know that my values are correctly passed in the template (when it it outside of the script tags), because at the end of my template, I have also written the code : {% for current_addr in mymodel.addresses.all %} {{ c

Re: Passing parameters / attributes to javascript in a template

2015-08-04 Thread Larry Martell
On Tue, Aug 4, 2015 at 9:14 AM, Déborah Leder wrote: > Hello > > I am currently developping a django geolocalisation application. Therefore, > I need both python and javascript. > I would like to give some parameters to a script in a template, that is to > say, in my template,

Passing parameters / attributes to javascript in a template

2015-08-04 Thread Déborah Leder
Hello I am currently developping a django geolocalisation application. Therefore, I need both python and javascript. I would like to give some parameters to a script in a template, that is to say, in my template, I want to use the script tag to define/modify some javascript variables. Here is

Re: Choices as a callable.. but no parameters?

2015-04-20 Thread Stephen J. Butler
On Mon, Apr 20, 2015 at 9:45 PM, Vijay Khemlani wrote: > Overwrite the constructor of the form (__init__), pass the user or whatever > parameters you may need and overwrite the choices of the field in the body > of the method. This is the same strategy I've used to filter Foreig

Re: Choices as a callable.. but no parameters?

2015-04-20 Thread Vijay Khemlani
Overwrite the constructor of the form (__init__), pass the user or whatever parameters you may need and overwrite the choices of the field in the body of the method. On Mon, Apr 20, 2015 at 10:56 PM, Steve Hiemstra wrote: > I am trying to build a form with dynamic choices. e.g., the choi

Choices as a callable.. but no parameters?

2015-04-20 Thread Steve Hiemstra
I am trying to build a form with dynamic choices. e.g., the choices should depend on the user. https://docs.djangoproject.com/en/1.8/ref/forms/fields/#choicefield Says choices may now be a callable, and sure enough it is called in ` django/forms/fields.py(818)` – but without any parameters

Re: Testing request parameters in Django (“+” behaves differently)

2015-04-20 Thread Eneko Illarramendi
13 PM, Eneko Illarramendi > > wrote: > > Previously posted in SO: > > > http://stackoverflow.com/questions/29703930/testing-request-parameters-in-django-behaves-differently > > > --- > > > > I have a Django View that uses a query par

Re: Testing request parameters in Django (“+” behaves differently)

2015-04-20 Thread Tom Evans
On Sat, Apr 18, 2015 at 12:13 PM, Eneko Illarramendi wrote: > Previously posted in SO: > http://stackoverflow.com/questions/29703930/testing-request-parameters-in-django-behaves-differently > --- > > I have a Django View that uses a query parameter to

Testing request parameters in Django (“+” behaves differently)

2015-04-18 Thread Eneko Illarramendi
*Previously posted in SO: http://stackoverflow.com/questions/29703930/testing-request-parameters-in-django-behaves-differently* --- I have a Django View that uses a query parameter to so some content filtering. Something like this: /page/?filter=one+and+two/page/?filter

Re: multiple parameters search

2015-03-23 Thread Vijay Khemlani
from django.db.models import Q User.object.get(Q(username=myusername) | Q(email=myEmail)) On Mon, Mar 23, 2015 at 9:30 PM, nobody wrote: > Hi, > > How can I search the database using multiple parameters similar like > "where username ="myUserName" or email = &q

multiple parameters search

2015-03-23 Thread nobody
Hi, How can I search the database using multiple parameters similar like "where username ="myUserName" or email = "MyEmail"? I tried to run User.object.get(username = myusername or email = myEmail), but that caused syntax error. Thank you. Kind regards, - -j --

Re: How to supply parameters to "python manage.py syncdb" from a script?

2015-03-23 Thread Dan Dong
Thanks Russell, that's clear now. Cheers, Dan 在 2015年3月20日星期五 UTC-5下午6:27:12,Russell Keith-Magee写道: > > > On Sat, Mar 21, 2015 at 5:25 AM, Dan Dong > > wrote: > >> Hi, >> Does anybody know how to supply the input parameters to "python >> manage

Re: How to supply parameters to "python manage.py syncdb" from a script?

2015-03-20 Thread Russell Keith-Magee
On Sat, Mar 21, 2015 at 5:25 AM, Dan Dong wrote: > Hi, > Does anybody know how to supply the input parameters to "python > manage.py syncdb" from a script? E.g, to set the the followings parameters: > > Would you like to create one now? (yes/no): yes > Userna

Supply parameters to "manage.py syncdb" from a script?

2015-03-20 Thread Dan Dong
Hi, All, Does anybody know how to supply input parameters to "python manage.py syncdb" from a script? E.g. in a bash/python script, to set the following parameters: Would you like to create one now? (yes/no): yes Username (leave blank to use 'root'): Email address: x

How to supply parameters to "python manage.py syncdb" from a script?

2015-03-20 Thread Dan Dong
Hi, Does anybody know how to supply the input parameters to "python manage.py syncdb" from a script? E.g, to set the the followings parameters: Would you like to create one now? (yes/no): yes Username (leave blank to use 'root'): Email address: x Password: xx

Re: Redirect to external url with parameters in django

2015-01-26 Thread Stephen J. Butler
r submit it (no-js) or post it using JavaScript yourself. On Tue, Jan 27, 2015 at 1:30 AM, Hossein Rashnoo wrote: > I want when a user do something in my view then i redirect him to another > website with some parameters as POST method Like when you submit a form. > I think its ma

Redirect to external url with parameters in django

2015-01-26 Thread Hossein Rashnoo
I want when a user do something in my view then i redirect him to another website with some parameters as POST method Like when you submit a form. I think its may be something like this: return HttpResponseRedirect("url","parameters") How can i do that? -- You r

Re: Unit-testing Custom Admin Action, requires request and querysets parameters.

2014-11-25 Thread Azam Alias
Hi Collin, I apologise for the late update. Didnt get any notifications from your reply. I have solved this issue as per your suggestion. Pasting the solution for others' reference. Thanks ! from django.test import TestCase from django.contrib.admin.sites import AdminSite from batch_apps.mod

Re: Unit-testing Custom Admin Action, requires request and querysets parameters.

2014-11-05 Thread Collin Anderson
Hello, Would it work to import AppAdmin, instantiate it, and then call the methods in a unit test? Collin -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to dj

Unit-testing Custom Admin Action, requires request and querysets parameters.

2014-11-02 Thread Azam Alias
Hi, I would like to unit-test the activate_apps( ) and deactivate_apps( ) functions below, as low-level as possible. How could I do this without going through Selenium (FT) route? In my admin.py: from django.contrib import admin from my_app_listing.models import App class AppAdmin(admin.Mode

Re: Correctly passing parameters to raw query

2014-09-24 Thread James Brewer
know if this is the error you're getting. We really do need more solution. > > If anyone else can shed some light on the issue I've raised, that would be > fantastic. If not, I will submit a bug report. > > [1]: > https://docs.djangoproject.com/en/dev/topics/db/sql/#pa

Re: Correctly passing parameters to raw query

2014-09-24 Thread James Brewer
;t even know if this is the error you're getting. We really do need more solution. If anyone else can shed some light on the issue I've raised, that would be fantastic. If not, I will submit a bug report. [1]: https://docs.djangoproject.com/en/dev/topics/db/sql/#passing-parameters-into-ra

Re: Correctly passing parameters to raw query

2014-09-24 Thread Collin Anderson
Interesting. I don't use raw queries, but I wonder if Django doesn't support lists as parameters to raw() -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from i

Correctly passing parameters to raw query

2014-09-24 Thread termopro
Hello, I am constructing raw query which looks like the following: "SELECT * FROM some_table WHERE id IN (1,3,5);" So inside my view i write: entities = Entity.objects.raw(""" SELECT * FROM some_table WHERE id IN (%s); """, [ids_list]) How should i correctly pass the argument ? Because i keep

django-nose: How to provide nose parameters from the command line?

2014-09-10 Thread Andres Riancho
List, I've been using django-nose for a long time but now I'm trying to specify command line parameters for "python manage.py test" that should be passed to "nose" and can't find out how. So, the question is: How do you pass nose parameters from the c

Re: Query parameters in the URL, with REST Framework

2014-09-09 Thread Elio Gerson Clímaco Herrera
Yes, Carlos I, have read documentation, but this don't show how put parameters in router.register like this. router.register(r'author/(?P\d+)/books', BooksList, base_name = 'Books') please, any help -- You received this message because you are subscribed to the Goo

Re: Query parameters in the URL, with REST Framework

2014-09-09 Thread carlos
Hi, maybe you need read documentation about filtering http://www.django-rest-framework.org/api-guide/filtering Cheers On Mon, Sep 8, 2014 at 1:41 PM, Elio Gerson Clímaco Herrera < elioclim...@gmail.com> wrote: > Hi, everybody. > > I, stared using *REST Framework*

Query parameters in the URL, with REST Framework

2014-09-08 Thread Elio Gerson Clímaco Herrera
Hi, everybody. I, stared using *REST Framework* few days ago, but I, can't find how create a customized url with parameter, in Django this kind of url is written like this. url(r'^author/(?P\d+)/books/$', BooksList.as_view(), name = 'books'), for this

Re: How to decompose URL into model and parameters

2014-08-14 Thread 9devmail
Yes, I figured it out. Thank you. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to

Re: How to decompose URL into model and parameters

2014-08-14 Thread Collin Anderson
It raises an Http404 if it doesn't exist. Is that what's going on? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To

Re: How to decompose URL into model and parameters

2014-08-14 Thread 9devmail
Line match = urlresolvers.resolve(urlsplit(url).path) stops executing the script and redirects me to given URL. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to

Re: How to decompose URL into model and parameters

2014-08-14 Thread Collin Anderson
from django.core import urlresolvers match = urlresolvers.resolve(urlsplit(url).path) view = match.func params = math.args https://docs.djangoproject.com/en/dev/ref/urlresolvers/#resolve -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsub

How to decompose URL into model and parameters

2014-08-14 Thread 9devmail
I want to parse an application URL just like Django does. url = 'http://www.example.com/path/to/myview/123' view, params = decompose(url) # now view="MyView", params=('123',) How can it be done? -- You received this message because you are subscribed to the Google Groups "Django users" group.

Re: GET parameters in admin "add" model page

2014-05-12 Thread Russell Keith-Magee
Hi, On Sun, May 11, 2014 at 11:42 PM, ?manu* wrote: > I noticed that django admin "add" page reads GET parameters and uses them > as initial values in the form. However I was not able to pass DateTime > values in this way. In particular if I try to pass a DateTime value I ge

GET parameters in admin "add" model page

2014-05-11 Thread ?manu*
I noticed that django admin "add" page reads GET parameters and uses them as initial values in the form. However I was not able to pass DateTime values in this way. In particular if I try to pass a DateTime value I get a "server error". See http://stackoverflow.com/quest

Re: Nested includes and captured parameters

2013-10-09 Thread Jason Mayfield
Nevermind. Discovered typo in a URLconf regex that was causing the problem. On Wednesday, October 9, 2013 2:41:45 PM UTC-4, Jason Mayfield wrote: > > The docs state that "An included URLconf receives any captured parameters > from parent URLconfs". And that does work as

Nested includes and captured parameters

2013-10-09 Thread Jason Mayfield
The docs state that "An included URLconf receives any captured parameters from parent URLconfs". And that does work as expected, when the child URLconf makes immediate use of the parameter -- that is, the child URLconf is a terminal node and doesn't include any further child U

Re: Query parameters for receiving post

2013-10-09 Thread Denis Chernoshchekov
Your right... I can't testing now. 2013/10/9 Hélio Miranda > gives error: > 'BaseList' object has no attribute 'values' > > The query has to be the same as I stated it works: > * > Player.objects.filter(country__in=Country.objects.filter(nationality__in=Nationality.objects.filter(name='Espanhol

Re: Query parameters for receiving post

2013-10-09 Thread Hélio Miranda
gives error: 'BaseList' object has no attribute 'values' The query has to be the same as I stated it works: * Player.objects.filter(country__in=Country.objects.filter(nationality__in=Nationality.objects.filter(name='Espanhola'))) * -- You received this message because you are subscribed to the G

Re: Query parameters for receiving post

2013-10-09 Thread Denis Chernoshchekov
try this solution http://plnkr.co/edit/cyM6AmZcyFVUU6soFKhB 2013/10/9 Denis Chernoshchekov > ok, i understand, i minute. > > > 2013/10/9 Denis Chernoshchekov > >> *fld_name = 'nationality_in' *must be with double '_'* **fld_name = >> 'nationality__in'* >> >> >> 2013/10/9 Denis Chernoshchekov

Re: Query parameters for receiving post

2013-10-09 Thread Denis Chernoshchekov
ok, i understand, i minute. 2013/10/9 Denis Chernoshchekov > *fld_name = 'nationality_in' *must be with double '_'* **fld_name = > 'nationality__in'* > > > 2013/10/9 Denis Chernoshchekov > >> Sorry, i don't understand you... You can control all your values for all >> fields, you can generate d

Re: Query parameters for receiving post

2013-10-09 Thread Denis Chernoshchekov
*fld_name = 'nationality_in' *must be with double '_'* **fld_name = 'nationality__in'* 2013/10/9 Denis Chernoshchekov > Sorry, i don't understand you... You can control all your values for all > fields, you can generate dict which you like. > > > 2013/10/9 Hélio Miranda > >> I put that work, I

Re: Query parameters for receiving post

2013-10-09 Thread Denis Chernoshchekov
Sorry, i don't understand you... You can control all your values for all fields, you can generate dict which you like. 2013/10/9 Hélio Miranda > I put that work, I wanted to know was how to put in the code, because you > can not do the same to position > > -- > You received this message because

Re: Query parameters for receiving post

2013-10-09 Thread Hélio Miranda
was trying something like this: *if fld_name == 'nationality':* *fld_name = 'nationality_in'* *value = Player.objects.filter(country__in=Country.objects.filter(nationality__in=Nationality.objects.filter(name=value))) * But it does not work -- You received

Re: Query parameters for receiving post

2013-10-09 Thread Hélio Miranda
I put that work, I wanted to know was how to put in the code, because you can not do the same to position -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django

Re: Query parameters for receiving post

2013-10-09 Thread Denis Chernoshchekov
Try this - *Player.objects.filter(country__in=** Nationality.objects.filter(name='Espanhola').distinct('country').values('country')) * 2013/10/9 Hélio Miranda > yes, that was it ... > Just one more thing, if I would like to create the nationality of the > player, so that the filter is: > * > Pl

  1   2   3   4   5   >