Re: New field in django

2013-09-10 Thread Mike Dewhirst
On 10/09/2013 3:28pm, Harjot Mann wrote: On Mon, Sep 9, 2013 at 10:59 AM, Xavier Ordoquy wrote: The message is: "Table 'tcc_report' already exists" This means that you already created the tables with syncdb which bypassed south and you're trying to created them again

Re: QuerySet to cover a date range

2013-09-10 Thread Borislav Borisov
Hey, You can use https://docs.djangoproject.com/en/dev/ref/models/querysets/#range. Cheers. On Tue, Sep 3, 2013 at 7:02 PM, Neil Menne wrote: > Hello, all! > > I'm trying to get a query set that 'covers' a date range. Each object only > contains a single date. For

Middleware Causing OperationalError: (2006, 'MySQL server has gone away')

2013-09-10 Thread Paul Childs
Environment: Django 1.4, MySQL 5.5.33 In one of my views I am consistently getting a MySQL error: OperationalError: (2006, 'MySQL server has gone away') Traceback (most recent call last): File "C:\Python26\Lib\wsgiref\handlers.py", line 93, in run self.result = application(self.environ,

Re: Middleware Causing OperationalError: (2006, 'MySQL server has gone away')

2013-09-10 Thread Paul Childs
I went as far as to reboot my machine. I tried the view and it worked but then my other view started exhibiting the same error message. On Tuesday, September 10, 2013 11:01:42 AM UTC-3, Paul Childs wrote: > > Environment: Django 1.4, MySQL 5.5.33 > > In one of my views I am consistently getting

Re: Middleware Causing OperationalError: (2006, 'MySQL server has gone away')

2013-09-10 Thread Paul Childs
Hey Sanjay, Thanks for the reply. I will probably pick at this problem every so often but I am not hopeful about finding a solution as the problem seems to be down deep in Django. I'm afraid that I will probably be out of my league on this one. I have been wanting to upgrade my Djano version

Re: Paginattion: How do I pass current page number around views, forms and templates?

2013-09-10 Thread DJ-Tom
Hi, hmmm, I don't think I understand what you mean with "setting" Thomas Am Dienstag, 10. September 2013 17:47:41 UTC+2 schrieb ke1g: > > Assuming that you can't get the edit view to cooperate, maybe store it on > the setting? > > -- You received this message because you are subscribed to

integrity error with transaction middleware, django 1.3

2013-09-10 Thread Brian Craft
I'm getting duplicate entry integrity errors when saving an object, with transaction middleware enabled in django 1.3. I thought the point of the middleware was to rollback transaction errors and retry the view. Why would I be getting this error? The db is mysql. The save code looks like this:

Re: Paginattion: How do I pass current page number around views, forms and templates?

2013-09-10 Thread Bill Freeman
Assuming that you can't get the edit view to cooperate, maybe store it on the setting? On Tue, Sep 10, 2013 at 11:34 AM, DJ-Tom wrote: > Hi, > > I'm currently using django's default pagination and it works as expected. > > The problem i still have is that when I'm on

django user (using django ORM) + SQLAlchemy for other db tables

2013-09-10 Thread Dennis
Any advice (or potential problems) with using SQLAlchemy with the django framework but keeping the django user auth module? The django ORM would be used for the auth module (and its user table). SQLAlchemy ORM would be used for other tables and also to read (but not write) the django user

Re: django user (using django ORM) + SQLAlchemy for other db tables

2013-09-10 Thread Avraham Serour
why? On Tue, Sep 10, 2013 at 7:34 PM, Dennis wrote: > Any advice (or potential problems) with using SQLAlchemy with the django > framework but keeping the django user auth module? > > The django ORM would be used for the auth module (and its user table). > SQLAlchemy ORM

Re: Middleware Causing OperationalError: (2006, 'MySQL server has gone away')

2013-09-10 Thread Paul Childs
I ran my test suite and the error didn't crop up there. All tests that run my views passed. -- 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: URL Mapping Confusion

2013-09-10 Thread Chris Kavanagh
I understand it now Tom, thanks to you. I didn't quite get the "include" statement and what it did until you mentioned it, and a little help from the django book. . .Again, THANKS for taking the time to help, it's greatly appreciated! Chris On Monday, September 9, 2013 10:57:51 PM UTC-4,

Paginattion: How do I pass current page number around views, forms and templates?

2013-09-10 Thread DJ-Tom
Hi, I'm currently using django's default pagination and it works as expected. The problem i still have is that when I'm on (lets say) page 5 of 10, go into edit the edit form of one of the objects, I don't know how I can preserve/access the current page number from the edit view/form template

Re: django user (using django ORM) + SQLAlchemy for other db tables

2013-09-10 Thread Dennis
This combination would allow the power of SQLAlchemy but maintain compatibility with django auth -- a sweet combination! On Wednesday, September 11, 2013 1:30:12 AM UTC+8, אברהם סרור wrote: > > why? > > > On Tue, Sep 10, 2013 at 7:34 PM, Dennis >wrote: > >> Any advice (or

Re: Paginattion: How do I pass current page number around views, forms and templates?

2013-09-10 Thread Bill Freeman
The remaining trick will be when to remove it from the session. You don't want to go into another list and start at page 5. On Tue, Sep 10, 2013 at 12:43 PM, DJ-Tom wrote: > ah ok - now all makes sense :-) > > Am Dienstag, 10. September 2013 18:23:12 UTC+2 schrieb ke1g:

Re: How do I output a variable from Models.py to Detail.html?

2013-09-10 Thread Pepsodent Cola
Affirmative! On Monday, September 9, 2013 11:42:53 AM UTC+2, Daniel Roseman wrote: > > On Monday, 9 September 2013 10:24:54 UTC+1, Pepsodent Cola wrote: > >> This is my Models code and I want to output the contents of variable * >> blackbox* to my screen. >> >> 1.) Do I need to write some code

Re: Paginattion: How do I pass current page number around views, forms and templates?

2013-09-10 Thread Bill Freeman
Sorry. I meant session. On Tue, Sep 10, 2013 at 12:15 PM, DJ-Tom wrote: > Hi, > > hmmm, I don't think I understand what you mean with "setting" > > Thomas > > Am Dienstag, 10. September 2013 17:47:41 UTC+2 schrieb ke1g: > >> Assuming that you can't get the edit view to

Re: django user (using django ORM) + SQLAlchemy for other db tables

2013-09-10 Thread Avraham Serour
from what I understand SQLAlchemy is an ORM, which django already have, I would assume you need something specific in the "power" that django's ORM doesn't have. so again I question why? what exactly do you need in SQLAlchemy? also what's so special about django auth? you could easily create your

Re: Displaying a custom field (PickledObjectField) in the admin

2013-09-10 Thread Paul
If you just want to see (read) the contents you could do this: class Example(models.Model): value = PickledObjectField() def value_unpacked(self): return u'{value}'.format(value=self.value) filter_link.allow_tags = True class ExampleAdmin(admin.ModelAdmin): list_display = ('id',

Re: Reliable and cheap hosting for simple webapp in Django

2013-09-10 Thread Andre Lopes
I'm visiting the Heroku webpage. I can get freehosting there. Any experience on what can I get from Heroku freehosting. The website have 5/10 visits a day. On Tue, Sep 10, 2013 at 10:57 PM, Avraham Serour wrote: > try webfaction or digitalocean > > > On Wed, Sep 11, 2013 at

Re: Paginattion: How do I pass current page number around views, forms and templates?

2013-09-10 Thread DJ-Tom
ah ok - now all makes sense :-) Am Dienstag, 10. September 2013 18:23:12 UTC+2 schrieb ke1g: > > Sorry. I meant session. > > > On Tue, Sep 10, 2013 at 12:15 PM, DJ-Tom > wrote: > >> Hi, >> >> hmmm, I don't think I understand what you mean with "setting" >> >> Thomas >> >>

Re: Reliable and cheap hosting for simple webapp in Django

2013-09-10 Thread Rich Haase
Try one of the following: Gondor GoogleApp Engine Heroku On Tue, Sep 10, 2013 at 3:55 PM, Andre Lopes wrote: > Hi all, > > I'm stuck with Django hosting. I've A2hosting but the Django hosting > is not good at all. > > They use FCGI and Passenger and both have a

Reliable and cheap hosting for simple webapp in Django

2013-09-10 Thread Andre Lopes
Hi all, I'm stuck with Django hosting. I've A2hosting but the Django hosting is not good at all. They use FCGI and Passenger and both have a problem. If I'm more than 15min without doing a request to the site, the first request is very slow and most of the time will do an Internal Server Error.

Re: Reliable and cheap hosting for simple webapp in Django

2013-09-10 Thread Avraham Serour
try webfaction or digitalocean On Wed, Sep 11, 2013 at 12:55 AM, Andre Lopes wrote: > Hi all, > > I'm stuck with Django hosting. I've A2hosting but the Django hosting > is not good at all. > > They use FCGI and Passenger and both have a problem. > > If I'm more than

Re: Reliable and cheap hosting for simple webapp in Django

2013-09-10 Thread Avraham Serour
you asked cheap not free, in any case if you already found something that fits you why waste the time of others? On Wed, Sep 11, 2013 at 1:05 AM, Andre Lopes wrote: > I'm visiting the Heroku webpage. I can get freehosting there. Any > experience on what can I get from

Dynamic image content

2013-09-10 Thread Mark O
Hi folks, Consider the snippet in views.py url = http://127.0.0.1:8806/test request = urllib2.Request ( url ) f = urllib2.urlopen ( request ) result = f.info().getheader ( 'Content-Type' ) if result == "image/jpeg" : print "image/jpeg" s = f.read() t =

Best practice: Models.py vs View.py?

2013-09-10 Thread Storn White
I am developing my first relatively complex django project. I have written some code and I'm not sure whether it belongs in an app's models.py or views.py file. I have written a class and a few functions that have to do with routing content to views. For example, all the different *types* of

[ANNOUNCE] Security releases issued (1.4.7, 1.5.3, 1.6 beta 3)

2013-09-10 Thread James Bennett
Today the Django team is issuing multiple releases -- Django 1.4.7, Django 1.5.3, and Django 1.6 beta 3 -- as part of our security process. These releases address a directory-traversal vulnerability in one of Django's built-in template tags. More details can be found on our blog:

Re: Middleware Causing OperationalError: (2006, 'MySQL server has gone away')

2013-09-10 Thread Sanjay Bhangar
On Tue, Sep 10, 2013 at 7:50 PM, Paul Childs wrote: > I went as far as to reboot my machine. > I tried the view and it worked but then my other view started exhibiting > the same error message. > > Not sure if this helps, but I saw this once recently on a colleague's windows

Resize image size in the view

2013-09-10 Thread Robin Lery
Hello, I have been trying to achieve thumbnail for the uploaded images, but it just don't seem to resize the image on the apache server when the page is loaded. Only when I run through the django's inbuilt server, it loads the uploaded image. So, is there any way, that I can specify the size of

Resize image in the view

2013-09-10 Thread Robin Lery
Hello, I have been trying to achieve thumbnail for the uploaded images using sorl-thumbnail and easy_thumbnail, but it just don't seem to resize the image on the apache server when the page is loaded. Only when I run through the django's inbuilt server, it loads the uploaded image. So, is there