Force exception raising when transaction fails

2012-11-20 Thread Isaac XXX
Hi everybody, I run into a weird scenario, caused by a complex code involving threads and so on. The problem arised in some point, with a DatabaseError exception, saying: /current transaction is aborted, commands ignored until end of transaction block/ Obviously, the line which arises that

Re: how to use get_queryset in my code

2012-11-20 Thread Daniel Roseman
On Tuesday, 20 November 2012 07:25:55 UTC, Nebros wrote: > I can really need your help, i don't have found the solution till now. :( > You've had no replies because no-one can understand what you're asking. Something about querysets, but you seem to be using raw SQL in your code, for no appare

Re: How to syncdb programatically (django standalone script) ?

2012-11-20 Thread Samar Agrawal
Wow this is the coolest thing...thnx On Tuesday, 16 September 2008 07:20:24 UTC+5:30, Steve Holden wrote: > > Mathieu Leplatre wrote: > > Hi all, > > > > I found many post about specific errors regarding django as a > > standalone tool. > > > > With a little bit of researching, I ended up with thi

missing column name in subclasses

2012-11-20 Thread Emmanuel Jannetti
Hi, Using django 1.3.1 with SQLlight backend. I want to use the following kind of model. *class Bar(models.Model): a = models.PositiveSmallIntegerField(default=1) class Foo(models.Model): mybar = models.ForeignKey(Bar,blank=False,null=True,on_delete=models.CASCADE) class Meta: a

Re: Multi Database + Huge lookups

2012-11-20 Thread alexandre...@gmail.com
Thanks I will follow directions -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/UzXu0Wzm4W0J. To post to this group, send email to django-users@googlegroup

Re: missing column name in subclasses

2012-11-20 Thread Tom Evans
On Tue, Nov 20, 2012 at 10:23 AM, Emmanuel Jannetti wrote: > Hi, > > Using django 1.3.1 with SQLlight backend. > I want to use the following kind of model. > > > class Bar(models.Model): > a = models.PositiveSmallIntegerField(default=1) > > class Foo(models.Model): >mybar = > models.ForeignK

Re: need help with postgres installation and set-up for doing tutorials

2012-11-20 Thread Bill Freeman
On Mon, Nov 19, 2012 at 6:40 PM, Luisa Beck wrote: > Hi, I'm new to web development and I'm trying to get my mac set up for > doing the tutorials. > I installed postgres and pgAdmin III and set it up on the default port > (5433). I created a test database. Now when I try to open it on the local >

Re: how to use get_queryset in my code

2012-11-20 Thread Nebros
Ok, what is my task... I have my first page called "Portal". i can give there in a variable, and can send the value with this form to the next page. I tryed now to use this value as a variable you can see here: AND (x.t_user = %r)" %x this %x have to be my value of page one, i have given. I

Re: how to use get_queryset in my code

2012-11-20 Thread Martin J. Laubach
Okay. You seem to be rather confused about the django approach to things I'm afraid. (a) You use raw sql instead of django's ORM mapper. That's okayish, but then you're on your own for building your queries and have to manually do validation and escaping and whatnot, which is, as you notice

Re: how to use get_queryset in my code

2012-11-20 Thread Nebros
I tryed first this part with db models. but mssql doesnt work on it... i cant generate the model by themself. thats why i made it by my own. in addition, the next part of my program is to implements lotus notes db... i can do it on the same way, thats why i try to do this. And yes, i create my o

Re: django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: No module named MySQLdb

2012-11-20 Thread Cj Taylor
Correct, Sergiy. As I fiddle with this nightly, the core of my issue seems to be that mysqldb is not yet python3 ready and django 1.5 is calling for it. I changed my database settings in settings.py to ' django.db.backends.mysql' which in return calls for mysqldb when I do: python manage.py sy

how i do a update in django QuerySet like this: update table t set col_a = col_a + 2 where col_b = 1

2012-11-20 Thread peixinchen
how i do a update in django QuerySet like this: update table t set col_a = col_a + 2 where col_b = 1, i could use filter take the place of "where clause", but how "set col_a = col_a + 2" to being? -- You received this message because you are subscribed to the Google Groups "Django users" gro

Re: how to use get_queryset in my code

2012-11-20 Thread Tom Evans
On Tue, Nov 20, 2012 at 2:07 PM, Nebros wrote: > so pls just help me by this problem, cause i do not know everything about > programming with django. The problem is that there is a lot going wrong in your code than just not knowing Django. I would recommend some python training, or a good book o

Re: django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: No module named MySQLdb

2012-11-20 Thread Tom Evans
On Tue, Nov 20, 2012 at 2:14 PM, Cj Taylor wrote: > Correct, Sergiy. As I fiddle with this nightly, the core of my issue seems > to be that mysqldb is not yet python3 ready and django 1.5 is calling for > it. I changed my database settings in settings.py to > 'django.db.backends.mysql' which in

Re: Building an API to facilitate a mobile app

2012-11-20 Thread Bill Freeman
On Mon, Nov 19, 2012 at 7:08 PM, Amrutha Rajiv wrote: > Hey All, > I posted this on the django-tastypie group and I haven't got a response > yet. I hope there's someone here who can help me with this: > > I have a django project that is currently accessible through a web client. > What I need to d

Re: how i do a update in django QuerySet like this: update table t set col_a = col_a + 2 where col_b = 1

2012-11-20 Thread Tom Evans
On Tue, Nov 20, 2012 at 1:00 PM, peixinchen wrote: > how i do a update in django QuerySet like this: update table t set col_a = > col_a + 2 where col_b = 1, > > i could use filter take the place of "where clause", but how "set col_a = > col_a + 2" to being? > from django.db.models import F Foo.ob

Using South with Custom User Model

2012-11-20 Thread Chris Pagnutti
I'm wondering if anyone has ever had success with using South when you have AUTH_USER_MODEL set to a custom User model. I've made various attempts, which are basically all the same steps but in different orders. Basically, my problems is related to this ticket http://south.aeracode.org/ticket/1

django admin site

2012-11-20 Thread Valentin Rozescu
I am going step by step in the tutorial "Writing your first Django app" (https://docs.djangoproject.com/en/dev/intro/tutorial01/) but in the part 2, step creating admin site, I'm blocked because of the fact that I cannot login to the administration site. I create a superuser with manage.py cr

Re: How to implement pre-save operations for inlines in the admin interface?

2012-11-20 Thread Carsten Fuchs
Just for info, to complete this: I read in the admin interface source code (contrib/admin/options.py) and found a solution myself. It's not as clear and straightforward as one would wish, but simple and robust: We now simply override the `ModelAdmin.save_formset()` function like this: d

Re: ModelAdmin.save_formset() questions

2012-11-20 Thread Carsten Fuchs
Unfortunately, no replies here, but to tie the loose ends up: I found a solution that I posted in the thread of my original problem: https://groups.google.com/d/topic/django-users/ZwgW7-t6CBA/discussion Best regards, Carsten -- Cafu - the open-source Game and Graphics Engine for multiplayer

Re: Django in virtualenv + nginx + uwsgi set up guide

2012-11-20 Thread abidibo
I'm glad you enjoy my post series, good work all! On Saturday, 17 November 2012 01:34:56 UTC+1, Chris Pagnutti wrote: > > Yep. I got the server up and running, and that was definitely the most > useful resource. Thanks. > > On Fri, Nov 16, 2012 at 5:30 PM, I単igo Medina > > > wrote: > >> >> Th

Re: missing column name in subclasses

2012-11-20 Thread Emmanuel Jannetti
Hi, If you drop the database (or just 'devLab_subfoo') and re-create it > dropping the DB did the trick Just found out that 'python manage.py flush --noinput ' followed by 'manage.py syncdb' is not enough. > (re-run syncdb) does the error persist? > > Looking at the generated SQL, it l

FactoryBoy & ManyToManyField

2012-11-20 Thread Craig Blaszczyk
Hi Guys, I'm using FactoryBoy in my tests, but I have a model which has a ManyToManyField to another model. Does anyone know if it's possible to make factoryboy use a factory to represent this relationship? For reference, here are a sample model and factory: --models.py from django.contrib.aut

Re: Is there a recommended pattern for creating "replaceable" apps?

2012-11-20 Thread Chris Cogdon
On Monday, November 19, 2012 9:36:40 PM UTC-6, Russell Keith-Magee wrote: > > > See the development docs for custom user models to see how this works in > practice, and adapt for your purposes. I'm intentionally going to leave the > rest vague. Call it an entrance exam -- if you can't work out

Re: django admin site

2012-11-20 Thread I単igo Medina
On Tue, 20 Nov 2012, Valentin Rozescu wrote: I am going step by step in the tutorial "Writing your first Django app" (https://docs.djangoproject.com/en/dev/intro/tutorial01/) but in the part 2, step creating admin site, I'm blocked because of the fact that I cannot login to the administration

Re: how to use get_queryset in my code

2012-11-20 Thread Martin J. Laubach
> > I tryed first this part with db models. but mssql doesnt work on it... > BTW, why? I see there's a django-mssql, that should allow you to connect to the database. Doesn't it work with your version? I've never tried it though, I just googled around a bit... -- You received this messag

Installing PyBB

2012-11-20 Thread Yogev Metzuyanim
Hi I intalled PyBB with easy install, after adding it to the INSTALLED_APPS, i run syncdb and get the following error: AtrributeError: 'Settings' object has no attribute 'PYBB_DEFAULT_MARKUP'. Does anyone know what did I do wrong? Thanks. -- You received this message because you are subscribed t

Re: django admin site

2012-11-20 Thread Yogev Metzuyanim
What database are you using? On Tuesday, November 20, 2012 5:49:40 PM UTC+2, Valentin Rozescu wrote: > > I am going step by step in the tutorial "Writing your first Django app" ( > https://docs.djangoproject.com/en/dev/intro/tutorial01/) but in the part > 2, step creating admin site, I'm blocked

login page shouldn't open when I am already logged in, but it does !

2012-11-20 Thread Loai Ghoraba
Hi all I am trying to build a login page using Django auth app, it is all working nice but there is one problem: If I browse to accounts/login (the login url) when I am already logged in, in normal situation the login view shouldn't be rendered and the correct action will be to redirect to the

Django web app pages not displaying

2012-11-20 Thread coded kid
I just deployed my django website, I tried visiting some pages on the site and it's not displaying. I have three web browsers on my PC, I tried visiting those pages through the other two web browsers but the pages are not displaying. I asked a friend of mine in Poland to check those pages out, he s

Re: Installing PyBB

2012-11-20 Thread carlos
read de documentation http://packages.python.org/pybb/ or send mail for the author :/ cheers On Tue, Nov 20, 2012 at 11:15 AM, Yogev Metzuyanim wrote: > Hi > I intalled PyBB with easy install, after adding it to the INSTALLED_APPS, > i run syncdb an

Re: Django web app pages not displaying

2012-11-20 Thread Yogev Metzuyanim
Thanks, I needed to add this line: from pybb.settings import * to my settings file. But now I have another problem, as I follow the instruction from the link you gave me, I'm trying to run this command: manage.py pybb_created_related_objects and i get the following error: TypeError: get_db_prep_

Re: Installing PyBB

2012-11-20 Thread Yogev Metzuyanim
Thanks, I needed to add this line: from pybb.settings import * to my settings file. But now I have another problem, as I follow the instruction from the link you gave me, I'm trying to run this command: manage.py pybb_created_related_objects and i get the following error: TypeError: get_db_prep_

Re: Django web app pages not displaying

2012-11-20 Thread Babatunde Akinyanmi
Hi coded, What error is your browser complaining of? "Connection timed out" or "Server Not Found"?? On 11/20/12, coded kid wrote: > I just deployed my django website, I tried visiting some pages on the > site and it's not displaying. I have three web browsers on my PC, I > tried visiting those pa

Re: Login failing

2012-11-20 Thread Aryeh Leib Taurog
> On Feb 22, 11:34 pm, "Aryeh Leib Taurog" wrote: >> I'm seeing a very strange intermittent problem with logging in.  The login >> appears to be successful, because the response to the login POST is a 302 >> redirect.  However sometimes the user doesn't seem to be stored in the >> session. >> >> I

Best way to create an advanced search bar for the admin app.

2012-11-20 Thread Nicolas Emiliani
Hi people. I have this huge class Foo that has a lot of attributes , not only that but it has an m2m relation with a through table that specifies values for each relation, and I want to be able to search using those values. For example : class Foo ... class Attr ... and the class Has:

Re: Is there a recommended pattern for creating "replaceable" apps?

2012-11-20 Thread Marc Aymerich
On Tue, Nov 20, 2012 at 4:35 AM, Russell Keith-Magee wrote: > > On Tue, Nov 20, 2012 at 6:28 AM, Chris Cogdon wrote: >> >> Hi folks! >> >> I'm creating an application to manage an art show (with art pieces to view >> and sell, silent and voice auctions, and a sales process). To have this >> work,

Re: ipython 0.11 with django 1.3 /in virtualenv

2012-11-20 Thread Martin
This comment explains why it is not loaded: https://code.djangoproject.com/ticket/17078#comment:8 Not sure how to go on from that though. -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.

Request for inspiration on business system

2012-11-20 Thread Peter Edström
Hello, A short background: I'm about to develop a web-based portal for my friend's company that deals with cleaning services of all kind, and I want to try out Django for this. In brief, the portal should consist of a database with data on employees, customers, contracts, work orders... and upon

Re: login page shouldn't open when I am already logged in, but it does !

2012-11-20 Thread Issam Outassourt
Hi, Well what you could do actually, and it's of commun use is to give your user a session-cookie id, which you can generate based on some informations in the header, typically his login, his ip adress, his password, his user-agent... As he tries to get the login page, challenge him by checking if

Re: FactoryBoy & ManyToManyField

2012-11-20 Thread Andres Reyes Monge
The simplest would be to class ATestCase(TestCase): def setUp(self): super(ATestCase, self).setUp() self.user = UserFactory() self.workplace = WorkplaceFactory() self.workplace.employees_set.add(self.user) def test_foobar(self): # how do I add sel

Can't get Web font loader in django

2012-11-20 Thread Chris Pagnutti
Hi. I'm trying to get the Google Web Font loader via http://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js";> in my section. But when I load the page I get (in Chromium's console) this message: GET https://www.googleapis.com/webfonts/v1/webfonts 403 (Forbidden) HOWEVER, if I call the webf

Re: Request for inspiration on business system

2012-11-20 Thread Lachlan Musicman
On Wed, Nov 21, 2012 at 8:37 AM, Peter Edström wrote: > Hello, Hi! > A company's internal business database system pretty much, and nothing new > under the sun. Perhaps accompanied by an external website further on. > Now on to the questions. > > Do you think Django would be suitable for this?

django password_reset_email.html not rendering in HTML

2012-11-20 Thread Larry Martell
I have set up the password reset feature, but the email that gets sent comes in plain text - it does not get rendered in HTML. I googled this and found this on SO: http://stackoverflow.com/questions/13285976/python-django-email-template-is-not-rendered-shows-html-tags-and-doesnt-conve/13286215#132

Re: Using South with Custom User Model

2012-11-20 Thread Russell Keith-Magee
Hi Chris, You've asked if anyone has had success, which implies the thou haven't, but you haven't said what problem you're having. My experience (which is logged in the ticket you reference) is that yes, running convert_to_south raises an error -- but the migration is created correctly, and works

Re: Can't get Web font loader in django

2012-11-20 Thread Issam Outassourt
{ "error": { "errors": [ { "domain": "usageLimits", "reason": "dailyLimitExceededUnreg", "message": "Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup.", "extendedHelp": "https://code.google.com/apis/console"; } ], "code": 403, "message": "Da

Re: Django web app pages not displaying

2012-11-20 Thread coded kid
I set Debug=False. It didn't bring any errors. Also django didn't send an error mail to me. The page is just blank. On Tuesday, 20 November 2012 22:23:14 UTC+1, Tundebabzy wrote: > > Hi coded, > What error is your browser complaining of? "Connection timed out" or > "Server Not Found"?? > > On

Re: password reset

2012-11-20 Thread Larry Martell
Just getting back to this now. We were able to get this going on my client's client's system, but not on my client's test system. There we're getting errno 111 (https://www.pythonanywhere.com/forums/topic/54/). It would be nice to have some place to test, but we're not going to go nuts, since the c

What's the difference between django.views.generic.ListView and django.views.generic.list_detail?

2012-11-20 Thread Dae_James
What's the difference between django.views.generic.*ListView* and django.views.generic.*list_detail*? I think the two have same function. Only the usage of them are different. Why do both of them exist? -- You received this message because you are subscribed to the Google Groups "Django users

Re: how i do a update in django QuerySet like this: update table t set col_a = col_a + 2 where col_b = 1

2012-11-20 Thread peixinchen
thanks, it works 在 2012年11月20日星期二UTC+8下午11时09分23秒,Tom Evans写道: > > On Tue, Nov 20, 2012 at 1:00 PM, peixinchen > > wrote: > > how i do a update in django QuerySet like this: update table t set col_a > = > > col_a + 2 where col_b = 1, > > > > i could use filter take the place of "where clause

Re: how to use get_queryset in my code

2012-11-20 Thread Nebros
Its not a problem of the version, my pycharm gave no error, but it was not possible to generate the model... by generating there was always an error, like it cant find an class or something else. Am Dienstag, 20. November 2012 19:35:36 UTC+1 schrieb Martin J. Laubach: > I tryed first this par