Re: Different between Object-save and form-save

2015-03-18 Thread Peter of the Norse
Not usually. In fact, I would say that the code given is wrong. It should be user_form.save(commit=false), otherwise there’s a redundant DB call.  https://docs.djangoproject.com/en/1.7/topics/forms/modelforms/#the-save-method > On Mar 1, 2015, at 12:30 PM, ADEWALE ADISA

Re: Changing table name in response to a QuerySet

2015-03-18 Thread James Schneider
Wow, that's quite the queryset! If I understand your snippet right, it looks as though you always run an initial large query against one of the tables, and if it doesn't find anything, run the similar query against the other table. If the filters, etc. are exactly the same, you could take the raw

Re: Changing table name in response to a QuerySet

2015-03-18 Thread Peter of the Norse
I’m already doing all of that. The problem is we often have logic that goes like: model = Product.get_subtable(‘foo’) queryset = model.objects. filter(…). select_related(…). exclude(…). extra(…) … and so on and so on. Seriously, the method that constructs the queryset is

Re: Django 1.6's lifespan for security updates?

2015-03-18 Thread James Bennett
On Wed, Mar 11, 2015 at 3:54 PM, Tim Graham wrote: > Having managed the last few security releases for Django, I'll say it's > one of my least favorite tasks and I'm quite looking forward to dropping > support for 1.4 (which supports Python 2.5) and 1.6 (Python 2.6). But,

Re: Django 1.6's lifespan for security updates?

2015-03-18 Thread Christian Hammond
Hey Tim, I can definitely relate. It's not fun maintaining security releases (or fixes of any sort) for older versions of the software. Been there (am there now). We're trying to encourage people to move to Python 2.7 so that we can upgrade, but this is the enterprise. It's not an easy task.

[JOB] in Newcastle NSW Australia

2015-03-18 Thread Peter Williams
Hi all Graduate Systems Engineer • Newcastle CBD • 35 hour week • $59147 to $68614 + Super • 12 month contract NSW Rural Doctors Network (RDN) is a non-government, not for profit organisation that develops and administers programs and services to attract, recruit and

[ANNOUNCE] Security releases issued (1.4.20, 1.6.11, 1.7.7 and 1.8c1)

2015-03-18 Thread Tim Graham
Today the Django team issued multiple releases -- Django 1.4.20, 1.6.11, 1.7.7, and 1.8c1 -- as part of our security process. These releases address a couple security issues, and we encourage all users to upgrade as soon as possible. More details can be found on our blog:

Variable

2015-03-18 Thread Pingo Pallino
Help me, I'm a newbie to django template I wanted to combine two into one but me error: {{patient | upper}} so there is the variable patient where and with what syntax I need to enter the variable patient? to call it. sorry if I was not clear to those who intend to help give more

Re: Django ReverseSingleRelatedObjectDescriptor.__set__ ValueError

2015-03-18 Thread Simon Charette
Hi Bradford, You must retrieve the ContentType model from the `apps` instead of importing it just like the other models you're using in your forwards function. ContentType = apps.get_model("contenttypes", "ContentType") The reason why you're getting such a strange exception is because you're

Django ReverseSingleRelatedObjectDescriptor.__set__ ValueError

2015-03-18 Thread Bradford Wade
I am creating a custom data migration to automatically create GenericRelation entries in the database, based on existing entries across two different models. *Example models.py:* ... class Place content_type = models.ForeignKey(ContentType) object_id =

Re: Testing Django: testing template at different time

2015-03-18 Thread Zaki Akhmad
On Fri, Mar 13, 2015 at 5:32 AM, Collin Anderson wrote: > Hi, > > You could try using freezegun to run the test as if it were a certain time > of day. > https://pypi.python.org/pypi/freezegun Hi Collin, thanks for the response. After spent some time, finally I managed to

Re: Import error - No module named http

2015-03-18 Thread Mario Gudelj
And you should probably use suds for soap based apis. On 19/03/2015 4:24 am, "Andrew Farrell" wrote: > Actually, please listen to Guilherme over me; He seems to have correctly > spotted the omission. > > On Wed, Mar 18, 2015 at 11:45 AM, Andrew Farrell

search a textbox to search a data from postgresql db in django application

2015-03-18 Thread Sabeen Sha
search a textbox to search a data from postgresql db in django application and display it -- 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: newbie question

2015-03-18 Thread Avraham Serour
short - use a view follow the tutorial, yes you will learn how to store and retrieve values from a database, and I understand that you don't need that yet but the tutorial is very brief, you won't waste your time with advanced topics you don't need On Wed, Mar 18, 2015 at 8:08 PM, VMD

newbie question

2015-03-18 Thread VMD
New to django and web frameworks in general. The tutorial is great for database type apps but I want to solve a different problem to start with and am kinda stuck. All I want to do is allow a user to input a value(s) and return the output of a python function using that value(s). Could someone

Re: Import error - No module named http

2015-03-18 Thread Andrew Farrell
Actually, please listen to Guilherme over me; He seems to have correctly spotted the omission. On Wed, Mar 18, 2015 at 11:45 AM, Andrew Farrell wrote: > So it seems like the problem is that you are doing `import http` on line > 24 of

Re: How to make request ie GET/POST to soap (windows web service ) in Django?

2015-03-18 Thread James Schneider
I would recommend that you use the suds-jurko fork. It should be a drop in replacement for the suds library available via pip, but is actively maintained. The original suds library looks to be abandoned and has some issues parsing current WSDL definition files that suds-jurko can handle. -James

Re: Import error - No module named http

2015-03-18 Thread Andrew Farrell
So it seems like the problem is that you are doing `import http` on line 24 of /home/akhil/Documents/NIVIN/NIVIN/svn/CrossFraudet/ branches/V2.1.0/crossfraudet/cdrimport/views/fraud_summary_view.py rather than `import httplib`. Python2 doesn't have a module in the standard library named `http`,

Extending ChangeList to start with empty table

2015-03-18 Thread Damjan Dimitrioski
Hi, is there a way to start the Admin's changelist view with empty table, that means I'd like to avoid any queries being used ? -- 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,

Re: Import error - No module named http

2015-03-18 Thread Guilherme Leal
Nivin and Shinto, You are forgetting to instantiate the HTTPConnection object: Exemple: *import httplib* *from xml.dom import minidom* *http = httplib.HTTPConnection("http://mydomain.com ")* *http.request("POST", "/path/to/my/webservice", body=xml, headers = {* *

Re: Django phonegap CORS

2015-03-18 Thread Filipe Ximenes
Awesome, sounds good! On Wed, Mar 18, 2015 at 4:57 AM, Florian Auer wrote: > Hello Filipe > > The idea with the inAppBrowser was great. > I allready was using this plugin but not that way > > Solution for me looks like the following: > 1. I'm still using

Re: Import error - No module named http

2015-03-18 Thread Nivin Paul
ImportError at /cdrimport/settings/fraudsummary/disconnect/ No module named http Request Method: GET Request URL: http://192.168.12.59:8080/cdrimport/settings/fraudsummary/disconnect/?id=3 Django Version: 1.6.4 Exception Type: ImportError Exception Value: No module named http

Re: Import error - No module named http

2015-03-18 Thread SHINTO PETER
iam to getting same error Traceback (most recent call last): File "test_soap.py", line 4, in http.request("POST", "/path/to/my/webservice", body=xml, headers = {

Re: How to make request ie GET/POST to soap (windows web service ) in Django?

2015-03-18 Thread Andrew Farrell
Based on a brief search but no personal experience, SUDS looks like the best python library for making requests to an existing SOAP server. On Wed, Mar 18, 2015 at 11:16 AM, SHINTO PETER wrote: > How to make request ie

Re: Import error - No module named http

2015-03-18 Thread Andrew Farrell
Hello Nivin, Could you please hit the "switch to copy-and-paste view" link at the top of the tradeback and copy that? The bottom of a traceback is often the most useful for debugging. Feel free to paste it or relevant code at github gist and send the link if you want to

Re: Import error - No module named http

2015-03-18 Thread Guilherme Leal
you didnt instanciated the HttpConnection Object Check the docs. https://docs.python.org/2/library/httplib.html#httpconnection-objects Em qua, 18 de mar de 2015 às 13:24, Nivin Paul escreveu: > I need to call a web service that written using SOAP from a django >

How to make request ie GET/POST to soap (windows web service ) in Django?

2015-03-18 Thread SHINTO PETER
How to make request ie GET/POST to soap (windows web service ) in Django? -- 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: Django Query to get max rating

2015-03-18 Thread Filipe Ximenes
>From what I could understand, you are trying to fetch all the top ratings for each question in a group, correct? The problem is that this query: top_rated_list = Ratings.objects.get(rating = max_rating) ​ is returning more than one rating instance. "get" queries are supposed to return a single

Re: Uncaught TypeError: Cannot read property 'value' of null

2015-03-18 Thread Alon Nisser
Does the browser support getElementById? old browsers don't support it.. If not the your aren't really adding the input tag in the same page where you run the js script. The js by it self is valid (if an element with this id exists, and only one of course).. On Tuesday, March 17, 2015 at

Re: Reload App

2015-03-18 Thread Guilherme Leal
I'm looking for a more intern way to do this. Like clean the app cache e rebuild it. Em qua, 18 de mar de 2015 às 05:50, Avraham Serour escreveu: > if you are using uwsgi to run you django app this is very easy, just do a > uwsgi reload (different than restart), it will

Suggestion

2015-03-18 Thread Jay Prasad
Hi All, I'm started Pyhthon and django ,give me some suggestions and which sites was good .help me.thank you all -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop

Django Query to get max rating

2015-03-18 Thread Yadnesh Patil
My model structure is like this: class Group(models.Model): u_id= models.ForeignKey(User) group_name = models.CharField(max_length=50,unique=True) def __str__(self): # __unicode__ on Python 2 return self.group_name + " " + self.org_nam

Re: Reload App

2015-03-18 Thread Avraham Serour
if you are using uwsgi to run you django app this is very easy, just do a uwsgi reload (different than restart), it will reload you django app, without even closing the socket FD, meaning your users won't notice, well they may notice that will be a little delay on one request, but tht will be

Re: Django phonegap CORS

2015-03-18 Thread Florian Auer
Hello Filipe The idea with the inAppBrowser was great. I allready was using this plugin but not that way Solution for me looks like the following: 1. I'm still using djangorestframework-jwt in the first to check the user credentials - token given from server = credentials OK - no

Re: Persist shopping cart data between computers.

2015-03-18 Thread Avraham Serour
there are frameworks like cartridge, but if all you need is what you described it is fairly easy to implement it yourself, in my opinion even faster, something that simple could be done in 30min and honestly if you are still learning django it would be worth as a learning step to do this yourself

Re: Persist shopping cart data between computers.

2015-03-18 Thread mail4dk
Do I need to code this logic by myself or is there a build in mechanism or plugin that will allow me to have it like the shopping cart plugins available online that store the data in the session collection? On Sunday, March 15, 2015 at 4:45:38 PM UTC+2, Avraham Serour wrote: > > save it on the