Re: Going throught the Django tutorial help pls

2014-08-01 Thread Michael Carey
On Saturday, 2 August 2014 12:55:25 UTC+10, Collin Anderson wrote: > > It currently shows a list of the polls, what I am trying to work out is >> how to print out the integer value that is associated with that pole. > > > Is poll.id what you want? In the template it would be {{ poll.id }} > > Or

Re: Get latest timestamp+value from each group

2014-08-01 Thread Collin Anderson
I'm not an ORM/SQL pro myself, so if I were doing this, I would just cache/denoralize the last value onto the device whenever there's a new log. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving e

Re: Going throught the Django tutorial help pls

2014-08-01 Thread Collin Anderson
> > It currently shows a list of the polls, what I am trying to work out is > how to print out the integer value that is associated with that pole. Is poll.id what you want? In the template it would be {{ poll.id }} Or: Poll.objects.get(name="Test").id -- You received this message because yo

Going throught the Django tutorial help pls

2014-08-01 Thread Michael Carey
I have: Enter code here...from django.shortcuts import render from django.template import RequestContext, loader from django.http import HttpResponse from polls.models import Poll def index(request): latest_poll_list = Poll.objects.get(name="Test") #Poll.objects.all().order_by('-pub_date')[

Community blog posts

2014-08-01 Thread Lee
Am I the only one who gets irritated by the periodic mass re-posting of strings of old blog articles to the community feed on djangoproject? I want to see fresh stuff I've not seen before, not the same rubbish I ignored the first three times it was posted. Seems like a pretty cheap shot to keep

Re: unsupported opperand type(s)

2014-08-01 Thread Collin Anderson
p.id == 3 is just fine. It's auto-incrementing, and even if you delete items, an object will never get p.id == 1 again. If you really want a Poll with id=1, either clear out your database, or create it manually like so: p = Poll(id=1, question="What's new?", pub_date=timezone.now()) p.save() --

Re: Djamin, a new and clean styles for Django admin.

2014-08-01 Thread Ryan Blunden
This looks pretty clean. I’ll give it a try on a new Django app I’m developing. Have you tested it on Django 1.7? On Friday, August 1, 2014 at 11:13 AM, Herson wrote: > Hey guys, in the last days, i push my new project called Djamin[0], a new and > clean styles for django admin. > > I

Re: unsupported opperand type(s)

2014-08-01 Thread Mariusz Wilk
thanks, that helped I also got confused and created too many objects, so now instead of p.id "1" cdm returns "3". How do I delete objects from p? >>> from django.utils import timezone>>> p = Poll(question="What's new?", >>> pub_date=timezone.now()) # Save the object into the database. You ha

Re: How to call a function when a project starts.

2014-08-01 Thread Russell Keith-Magee
As others have pointed out, the reason putting it in settings.py causes it to be run twice is because settings is loaded twice when you use runserver. That won't happen in production, however, as the mod_wsgi binding doesn't require the "other" process when it's deployed through the wsgi interface.

Re: BigInt / Long for Auto Incrementing PK

2014-08-01 Thread Nicholas Haggmark
Hi guys, I was aware that you could set the BigInt model type to PK, but there doesn't appear to be a good way to make it auto-increment. Also, will FK columns introspect it to a long correctly? On Friday, August 1, 2014 11:21:14 AM UTC-4, Collin Anderson wrote: > > Hi, you can use a biginteger

Re: unsupported opperand type(s)

2014-08-01 Thread Collin Anderson
> > def was_published_recently(self): > return self.pub_date >= timezone.now - datetime.timedelta(days=1) > timezone.now() -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails fro

unsupported opperand type(s)

2014-08-01 Thread Mariusz Wilk
Hi guys. I'm just going through the official tutorial for Django: "Writing your first Django app, part 1" At the bottom of the page it says: # Make sure our custom method worked. >>> p = Poll.objects.get(pk=1) >>> p.was_published_recently() True So far everything went well but now cmd retur

Djamin, a new and clean styles for Django admin.

2014-08-01 Thread Herson
Hey guys, in the last days, i push my new project called Djamin[0], a new and clean styles for django admin. I hope you like and i sent in django dev tool for a proposal to change. Forken, commit and send suggestions, all are welcome. [0] https://github.com/hersonls/djamin -- Herson Leite, Sof

Re: Changing website version written in python+django

2014-08-01 Thread CLIFFORD ILKAY
On 08/01/2014 01:06 AM, Zoltán Turcsányi wrote: > Hi Everyone, > > > I have a website written in python+django and I deployed it to > pythonanywhere.com. It's okay, works well, but I want to deploy new > versions. How should I do that? > Just copy the new files with rsync? Or change the full django

Re: building a xenserver web client

2014-08-01 Thread Cal Leeming [Simplicity Media Ltd]
Hi Marc, Although somewhat off-topic for this list, I would say there's several people out there that aren't at all happy with OpenStack (myself included). However the requirements for creating an interface for virtualization management can very quickly become overwhelming, as there are so many a

Trouble accessing message_dict of ValidationError

2014-08-01 Thread Rosemary McCloskey
Hi, I'm writing a view to create a model, and am trying to capture any ValidationErrors and display them to the user. I have code that looks like this: # exceptions is a dict of errors already encountered try: # create model except ValidationError as e: for key, msg in e.message_d

Re: BigInt / Long for Auto Incrementing PK

2014-08-01 Thread Collin Anderson
> > Hi, you can use a bigintegerfield > > and set it as primary-key > . > But will it auto-increment when you save? -- You received this message b

Re: Image upload problem with UserProfile and my form

2014-08-01 Thread Collin Anderson
This looks wrong to me: > > > so maybe, rearranging your code a bit: {% if form.avatar %} {% endif %} {{ form.avatar }} -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving e

Re: Having LiveServerTestCase use same database as tests

2014-08-01 Thread Chris Wilson
Hi Phil, On Sunday, October 21, 2012 5:37:45 PM UTC+1, Phil Gyford wrote: > > No, I'm afraid not. I didn't get any replies (nor to a StackOverflow > question http://stackoverflow.com/q/12041315/250962 ) and haven't gone > back to try again. I'd tried everything I could think of already. Good >

Re: hanging django/postgres idle connections

2014-08-01 Thread Jani Kajala
Haven't tried (yet), I'm new to Python & Django & Postgres, got on board with Python 3.4.1 and Django 1.7c1. I'm starting to suspect this isn't really Django related directly, since I can consistently reproduce the problem following way: 1) Run e.g. test case, break it in debugger 2) Stop debug

Re: BigInt / Long for Auto Incrementing PK

2014-08-01 Thread Stefano Probst
Hi, you can use a bigintegerfield and set it as primary-key . Am Donnerstag, 31. Juli 2014 17:34:17 UTC+2 schrieb Nicholas Haggmark: > > Hi Guys, > >

Image upload problem with UserProfile and my form

2014-08-01 Thread Pepsodent Cola
Hi, I have problems displaying my avatar image which I have uploaded from my forms page. The browser source code seem to say that it cannot find the correct path to my uploaded image file. Which file or files do I need to fix? Profilehttp://127.0.0.1:8000/accounts/profile/>" method="p

Re: Redirect with string?

2014-08-01 Thread Lachlan Musicman
Thanks Collin, I'll test on Monday L. On 1 August 2014 22:47, Collin Anderson wrote: > redirect is a django shortcut for an http redirect response, not a file/pipe > redirect. You need to use a python socket to connect to the ip address. > > http://stackoverflow.com/questions/68774/best-way-to-op

Re: Redirect with string?

2014-08-01 Thread Collin Anderson
redirect is a django shortcut for an http redirect response, not a file/pipe redirect. You need to use a python socket to connect to the ip address. http://stackoverflow.com/questions/68774/best-way-to-open-a-socket-in-python -- You received this message because you are subscribed to the Googl

Re: invalid attribute

2014-08-01 Thread Collin Anderson
all of your methods are indented too much. They should be at the same level as `class Meta`, not part of 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 dja

Re: invalid attribute

2014-08-01 Thread Daniel Roseman
On Friday, 1 August 2014 11:55:10 UTC+1, ngangsia akumbo wrote: > > class Meta invalid attribute , price_sale, get_absolute_url > >> >>> You *have* to do better than this. As I have told you before, you must provide *all* the relevant information if you want people to help you. Put yourself in ou

Re: Using settings.LOGIN_URL and django.core.urlresolvers.reverse

2014-08-01 Thread Michel Rugenbrink
Have you tried using reverse_lazy instead of reverse? On Wednesday, April 25, 2007 12:32:16 PM UTC+2, Matt wrote: > > Hi everyone, > > I have a quick question about the new LOGIN_URL, LOGOUT_URL, and > LOGIN_REDIRECT_URL settings. If, in my project's settings module, I > write: > > LOGIN_URL

Re: invalid attribute

2014-08-01 Thread ngangsia akumbo
class Meta invalid attribute , price_sale, get_absolute_url On Friday, August 1, 2014 3:10:40 AM UTC+1, cmawe...@gmail.com wrote: > > Do you have the full error message? > > > On Thursday, July 31, 2014 5:48:55 PM UTC-4, ngangsia akumbo wrote: >> >> *Got an invalid attribut error* >> >> class Prod

Problem with limit_choices_to and filtering foreign key

2014-08-01 Thread Hilde Rafaelsen
I have two models, ReqForChange(models.Model) and RfcStatus(models.Model). class ReqForChange(models.Model): rfc = models.AutoField (primary_key=True) user = models.ForeignKey(User, verbose_name="Requested by") status = models.ForeignKey(Status, verbose_name="RfC State") effect

How ignore tags when use makemessages?

2014-08-01 Thread Neto
I have the following line: Olá a todos bem-vindos ao site! After using makemessages is generated the following lines in the '.po' file: msgid "Olá a todos, bem-vindo!" msgstr "" I repeat the span tag? Or is there a method to not appear in the translation file? -- You received this message be