Re: How do I patch django.core.mail.send_mail for testing?

2015-05-19 Thread Stephen J. Butler
I think you instead want to use self.modify_settings() or self.override_settings() to change EMAIL_BACKEND to locmem: https://docs.djangoproject.com/en/1.8/topics/email/#in-memory-backend Then you can inspect django.core.mail.outbox to verify recipients, message, etc. On Tue, May 19, 2015 at

Django and Jquery UI

2015-05-19 Thread Robert librado
Seems tough to get the Jquery UI code to do anything like on Jquery.com Im using there demos just to get my feet wet ive already added jqueryui to my settings.py I already did collectstatic I added the draggable demo to an html template created the view it shows on the page but does not allow

Re: Embeding HSQLDB in a standalone App

2015-05-19 Thread Robert librado
Anybody understand how to connect Django and Jquery UI together I downloaded the Files and added to the site and added html and inserted the code yet it does not do the jquery motions like drag just comes out plain Ive done python manage.py collectstatic On Tue, May 19, 2015 at 7:57 PM, Russell

Re: Embeding HSQLDB in a standalone App

2015-05-19 Thread Russell Keith-Magee
On Tue, May 19, 2015 at 7:49 PM, Kapil Solanki wrote: > Hi All, > > I need to embed hsqldb in my project. I have been looking for solution > online but couldnt find a proper one. > BDW am new to django and python so its bit difficult also for me to search > the right

How do I patch django.core.mail.send_mail for testing?

2015-05-19 Thread Andrew Farrell
Hi folks, I'm trying to use mock.patch to test that a particular post-save signal kicks off an email. My current approach to this is... from django.test import TestCase from mock import patch class RegisterTestCase(TestCase):

Re: django-admin.py --> permission denied (shared server deployment)

2015-05-19 Thread x
hey, thanks for the quick responses! before i go any further on installing i need to think about tom evans advise: > Incidentally, having your python code installed inside your htdocs is > a stunningly bad idea even if you can get it to work, as anyone who > can guess the path to a particular

select_related problems

2015-05-19 Thread Joris
I have problems with the use of select_related. I have two models where one model keeps language independent data, and the other keeps translations in various languages. class Model() company = ForeignKey(Company, null=True, blank=True) def getCompanyName(self): return

Re: select_related problems

2015-05-19 Thread Joris
Ok please excuse my message, I found there was a comma missing somewhere betwen different select_related parameters. J I have problems with the use of select_related. I have two models where one model keeps language independent data, and the other keeps translations in various languages.

Re: Logout user on tab closing

2015-05-19 Thread Thorsten Sanders
I wouldnt do that at all, lets take ebay as an example when I use that I have several tabs at the same time open and it would be really annoying if I get a logout if I close one of those tabs and the same is true for many other sites. Same is true for my bank too, they just do a logout if I

Re: Logout user on tab closing

2015-05-19 Thread Gergely Polonkai
Well, onunload can be used if you are creating a one-page app, e.g. by using AngularJS. With multipage apps, this is of no use. On 19 May 2015 16:54, "Javier Guerra Giraldez" wrote: > On Tue, May 19, 2015 at 8:23 AM, Miloš Milovanović > wrote: > >

Also: installing postgres w/o root Re: django-admin.py --> permission denied (shared server deployment)

2015-05-19 Thread Andrew Farrell
Hi Florian It occurs to me that, you may want to install postgresql, a more powerful database. Here is how to do so without root permissions: conda install --channel https://conda.binstar.org/bkreider postgresql psycopg2 which psql createuser -s test_user1 --pwprompt --createdb --no-superuser

Re: django-admin.py --> permission denied (shared server deployment)

2015-05-19 Thread Andrew Farrell
Hello Florian, If you are having trouble installing python without root permissions, you should consider installing the miniconda distribution of python that is used in the scientific computing community. Assuming you are on a linux server, you can do this

Re: How to get selects option value !!

2015-05-19 Thread Tom Evans
On Tue, May 19, 2015 at 5:13 PM, Reznov Ammar wrote: > oh dude yes am doing flask, but you know here doesn't exist any flask group, > so please if you can help it would be really appreciated :) . http://flask.pocoo.org/mailinglist/ HTH Tom -- You received this message

Re: How to get selects option value !!

2015-05-19 Thread Adolphe Cher-Aime
My previous answer is related to django. For flask I think you need to ask in a flask mailling list. On Tue, May 19, 2015 at 12:18 PM, Adolphe Cher-Aime wrote: > In your view try request.POST.getlist('oblast_select'). It will return > the selected values in a list. > > >

Re: How to get selects option value !!

2015-05-19 Thread Adolphe Cher-Aime
In your view try request.POST.getlist('oblast_select'). It will return the selected values in a list. On Tue, May 19, 2015 at 12:01 PM, Reznov Ammar wrote: > Hey guys, > > I've had created a search form, and i need to send a post request to my > python file to get

Re: How to get selects option value !!

2015-05-19 Thread Reznov Ammar
oh dude yes am doing flask, but you know here doesn't exist any flask group, so please if you can help it would be really appreciated :) . On Tuesday, May 19, 2015 at 10:06:10 PM UTC+6, aRkadeFR wrote: > > Are you sure you're doing Django? > > It looks like flask to me. > > On 05/19/2015 06:01

Re: How to get selects option value !!

2015-05-19 Thread aRkadeFR
Are you sure you're doing Django? It looks like flask to me. On 05/19/2015 06:01 PM, Reznov Ammar wrote: Hey guys, I've had created a search form, and i need to send a post request to my python file to get information . Here is my html code :

How to get selects option value !!

2015-05-19 Thread Reznov Ammar
Hey guys, I've had created a search form, and i need to send a post request to my python file to get information . Here is my html code : Область/Город республиканского значения нет value1 value2

Re: Adding a one field to user model: trying not to create custom one)

2015-05-19 Thread Carl Meyer
On Tuesday, May 19, 2015 at 8:18:24 AM UTC-6, Ilya Kazakevich wrote: > > > I am really unhappy with idea of using custom user model. >> >> Why? >> >> If it's because this is an existing project and the prospect of >> migrating your existing data to a custom user model is daunting, I >> totally

Re: Possible bug in QuerySet API when chaining filter() and update() methods?

2015-05-19 Thread Tom Lockhart
On May 19, 2015, at 8:13 AM, Chi Gao wrote: > I encounter a similar problem. This issue is due to in MySQL "Currently, you > cannot update a table and select from the same table in a subquery." A > workaround way (in MySQL) is to create a template table from the

Re: Possible bug in QuerySet API when chaining filter() and update() methods?

2015-05-19 Thread Chi Gao
I encounter a similar problem. This issue is due to in MySQL "Currently, you cannot update a table and select from the same table in a subquery. " A workaround way (in MySQL) is to create a template table from the selection: UPDATE

Django Hackathon Starter - A boilerplate for Django Web Applications

2015-05-19 Thread David Leonard
Hello everyone, I'd like to share with you a project that you might find helpful - the Django Hackathon Starter Out of the box, it provides the user with several social logins (Twitter, Instagram, Tumblr, Github, LinkedIn, Facebook,

Re: Converting bytes to unicode that works both in python2 and 3

2015-05-19 Thread Vernon D. Cole
if sys.version_info >= (3,0): def str2bytes(sval): return sval.encode("latin1") unicode = str else: def str2bytes(sval): if isinstance(sval, str): return sval return sval.encode("latin1") This is what I use to solve the opposite problem. It should

Re: Adding a one field to user model: trying not to create custom one)

2015-05-19 Thread Ilya Kazakevich
Hello. On Tuesday, May 19, 2015 at 2:26:10 AM UTC+3, James Schneider wrote: > > The point of using a OneToOne relation to create a 'profile' is that the > profile is meant to contain information that is only accessed on an > individual basis (such as displaying a single users' address, etc.),

Re: django-admin.py --> permission denied (shared server deployment)

2015-05-19 Thread monoBOT
2015-05-19 13:32 GMT+01:00 Tom Evans : > for any suggestions how to domesticate django on this shared server i'd be > very happy. ​try ​python /customers/homepages/45/d5012545412/htdocs/python27/bin/django-admin.py startapp myapp -- *monoBOT* Visite mi sitio(Visit

Re: Adding a one field to user model: trying not to create custom one)

2015-05-19 Thread Ilya Kazakevich
Hello. > I am not aware of a good solution to this problem other than manually > adding the .select_related() to your query on the list-of-users page. > Oh :(( > > > I am really unhappy with idea of using custom user model. > > Why? > > If it's because this is an existing project and the

Re: Embeding HSQLDB in a standalone App

2015-05-19 Thread Kapil Solanki
Thanks for your reply Javier. You are right, it can be done using java. I can make use of Jython to invoke a java code but i am looking for python library if it is available for hsqldb. I wish i could change my project to java but thats not an option for now. On Tuesday, May 19, 2015 at 7:15:14

Re: Logout user on tab closing

2015-05-19 Thread Javier Guerra Giraldez
On Tue, May 19, 2015 at 8:23 AM, Miloš Milovanović wrote: > I want to logout a user from application when the application tab is closed. the browser doesn't notify the server when the tab (or window) is closed. remember that the original web architecture was simply

Re: Embeding HSQLDB in a standalone App

2015-05-19 Thread Javier Guerra Giraldez
On Tue, May 19, 2015 at 6:49 AM, Kapil Solanki wrote: > I need to embed hsqldb in my project. I have been looking for solution > online but couldnt find a proper one. AFAICT, hsqldb is a Java library, you need a Java program to call it. Maybe it's possible to call the

Logout user on tab closing

2015-05-19 Thread Miloš Milovanović
Hello, I want to logout a user from application when the application tab is closed. I have tried with creating a custom middleware class and calling set_expiry(0) function inside, according to Django documentation, but I when I open the application again in a new tab the user is still logged

Embeding HSQLDB in a standalone App

2015-05-19 Thread Kapil Solanki
Hi All, I need to embed hsqldb in my project. I have been looking for solution online but couldnt find a proper one. BDW am new to django and python so its bit difficult also for me to search the right solution. Please suggest if there is any hsqldb llibraries or any module for django app

Re: django-admin.py --> permission denied (shared server deployment)

2015-05-19 Thread Tom Evans
On Tue, May 19, 2015 at 9:04 AM, x wrote: > hello hello, > > finally i was able to install a python instance on my shared-server. > it was also impossible to pip-install django. yeah. > > but right then - so close already - i got a permission problem again. > i couldn't figure

Converting bytes to unicode that works both in python2 and 3

2015-05-19 Thread Hanne Moa
I got to start a new django 1.8-project in python 3.4 for once, and happily coded away. Turns out, the PaaS it needs to run on has a broken python 3.4, so... my code now needs to work in 2.7.8. Everything works in both versions except I need to read from an uploaded file, bot in the web and from

django-admin.py --> permission denied (shared server deployment)

2015-05-19 Thread x
hello hello, finally i was able to install a python instance on my shared-server. it was also impossible to pip-install django. yeah. but right then - so close already - i got a permission problem again. i couldn't figure out exactly what django-admin.py wants to do/execute and why it's

An FieldDoesNotExist happen when I use migrate

2015-05-19 Thread Zhong Yang
Hi everyone, I'm a new user, please help me if you have time, I'm very appreciate. My Django version is 1.8.0 I have User model it has friends list which is many to many type, the code like this: friends = models.ManyToManyField("self") When I use command migrate to update database, the

Re: possible bug - CharField accepts string as max_length

2015-05-19 Thread Santiago L
El lunes, 18 de mayo de 2015, 12:33:21 (UTC+2), James Schneider escribió: > > I'd post a bug report. Based on the behavior you've outlined (haven't > looked at the Django source), there may have been some oversight on the > duck typing that python performs. It sounds like the migration package

Re: No exception supplied error while resizing image by using blobproperty

2015-05-19 Thread Tom Evans
On Tue, May 19, 2015 at 8:42 AM, wrote: > Hi guys, > I am resizing image using blobproperty but it s giving BadImageError with no > exception supllied. > > Here is my code for resizing: > > bg_image = request.FILES['bg_image'].read() > > obj_partner.bg_image =

No exception supplied error while resizing image by using blobproperty

2015-05-19 Thread akash . patni
Hi guys, I am resizing image using blobproperty but it s giving BadImageError with no exception supllied. Here is my code for resizing: *bg_image = request.FILES['bg_image'].read(*) *obj_partner.bg_image = db.Blob(images.resize(bg_image,1400,758)) // error line* and i am uploading image

Re: Cannot resolve keyword -> on reverse ForeignKey after upgrade to 1.8

2015-05-19 Thread Galia Ladiray
AHhhh! Thanks for the answer we found the problem! No wonder no one but us had this problem, it was an old monkey-patch that we did not even know it exists, that modified the behaviour of the queryset Sorry for the trouble Galia On Tuesday, May 19, 2015 at 2:46:55 AM UTC+2, James

Re: Multiple databases

2015-05-19 Thread Galia Ladiray
It depends what you need, We use redis for non sql, and postgres for sql, You can use an id field to have a link between them. Django 1.8 has a support for postgres specific fields like HStore, maybe this is good enough for you? Galia On Tuesday, May 19, 2015 at 2:40:17 AM UTC+2, Roger Dunn

Re: How to change type of field in model, when database is already populated ?

2015-05-19 Thread Galia Ladiray
>From django 1.7 it is done by the migration Change your Models class run makemigrations, it will recognise the change and create a migration file run migrate command, which will alter the database On Saturday, May 16, 2015 at 3:26:32 PM UTC+2, mangu rajpurohit wrote: > > Hi, > > I am new to