Re: Calculations in Queries

2012-08-15 Thread Sandeep kaur
On Thu, Aug 16, 2012 at 2:31 AM, Callum Bonnyman wrote: > I am creating a popular page for my app and for the most part this is just > to gain an understanding. > Any ideas? I know its something to do with query expressions and looking at > this page confuses the hell out of me. Any guidelines, o

Re: Stuck on "ViewDoesNotExist" last step of tutorial part 4

2012-08-15 Thread Sky
I've moved the urls.py out of mysite as instructed by the tutorial into polls. My polls/url.py from django.conf.urls import patterns, include, url from django.views.generic import DetailView, ListView from polls.models import Poll #Uncomment the next two lines to enable the admin: from django.c

Re: Auto login with external cookie from different system

2012-08-15 Thread Kurtis Mullins
On Wed, Aug 15, 2012 at 10:08 AM, Melvyn Sopacua wrote: > ... > Split does not work like you think it does: > http://localhost/doc/python/library/stdtypes.html#str.split > ... Just wanted to clear one small thing up I saw :) Not all of us host the Python docs, locally, haha. I think the link you

Re: Calculations in Queries

2012-08-15 Thread Kurtis Mullins
On Wed, Aug 15, 2012 at 8:51 PM, Callum Bonnyman wrote: > I've tried a few things but i cannot get the correct date formats to > calculate the difference, so far i have this: > > popular_posts = Post.objects.extra(select={ > 'popularity': '(' + datetime.datetime.now() + ' - created) * view

Re: Stuck on "ViewDoesNotExist" last step of tutorial part 4

2012-08-15 Thread Kurtis Mullins
I just noticed another thing here. But, it could just be related to copying and pasting your source here. See below On Tue, Aug 14, 2012 at 11:16 PM, Sky wrote: > I've having a similar problem here using Django 1.4 and I can't quite > figure what's wrong. The error reads: Could not import polls.

Re: 回复: Stuck on "ViewDoesNotExist" last step of tutorial part 4

2012-08-15 Thread Sky
Oh, and it works when the url is http://localhost:8000/polls/1/vote/ On Thursday, August 16, 2012 11:19:09 AM UTC+8, Sky wrote: > > I'm pretty sure the source is the same as I copied it out from the editor. > I'm using sqlite3, not sure if that affects anything. I'm not sure what's > wrong as I

Re: 回复: Stuck on "ViewDoesNotExist" last step of tutorial part 4

2012-08-15 Thread Sky
I'm pretty sure the source is the same as I copied it out from the editor. I'm using sqlite3, not sure if that affects anything. I'm not sure what's wrong as I got the code straight from the tutorial. The traceback: - /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site

Re: 回复: Stuck on "ViewDoesNotExist" last step of tutorial part 4

2012-08-15 Thread Kurtis Mullins
This line should be commented out: "Uncomment the next two lines to enable the admin:" Also, I don't see why it's trying to import 'polls.views.index'. That would be a function named 'index' in your views.py file in the polls directory (also known as a module). Not only does that 'index' method/fu

Re: 回复: Stuck on "ViewDoesNotExist" last step of tutorial part 4

2012-08-15 Thread Sky
How do I do that? I've tried the commands python manage.py syncdb followed by python manage.py runserver several times but they don't work. On Wednesday, August 15, 2012 9:45:21 PM UTC+8, Melvyn Sopacua wrote: > > On 15-8-2012 10:01, Pengfei Xue wrote: > > there's no function in views.py, you

Re: Where to place Context

2012-08-15 Thread Gregory Strydom
Thanks very much, i have been confused about this for awhile but can now see much clearer! -- 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/-/WXD7UoocVSIJ. To

Re: Where to place Context

2012-08-15 Thread Melvyn Sopacua
On 16-8-2012 2:33, Gregory Strydom wrote: > Hi all , great to be here. Welcome. > I just have a very simple question if thats ok. I am quite new to Django > but am enjoying it very much, but seem to be struggling with templates. Im > sure this is a simple question but could anyone please tell

Re: Calculations in Queries

2012-08-15 Thread Callum Bonnyman
I've tried a few things but i cannot get the correct date formats to calculate the difference, so far i have this: popular_posts = Post.objects.extra(select={ 'popularity': '(' + datetime.datetime.now() + ' - created) * views' }) It shows an error, i've tried googling it but not had

Where to place Context

2012-08-15 Thread Gregory Strydom
Hi all , great to be here. I just have a very simple question if thats ok. I am quite new to Django but am enjoying it very much, but seem to be struggling with templates. Im sure this is a simple question but could anyone please tell me where do you place context that you define for your temp

Re: Calculations in Queries

2012-08-15 Thread Melvyn Sopacua
On 15-8-2012 23:01, Callum Bonnyman wrote: > > > I am creating a popular page for my app and for the most part this is just > to gain an understanding. > > The idea is to divide the number of views by the days old, now i don't know > if this will be successful or even working but like I said i

Re: blocktrans inside a with tag

2012-08-15 Thread Melvyn Sopacua
On 15-8-2012 19:27, ernando wrote: > I just checked provided code - and it works ok (1.4 Django). Are u using > the latest version or 1.3 one? Actually, my reply was a bit in a hurry cause I was on my way out. The dollar sign means nothing to python or django templates, so it is just raw text. J

Calculations in Queries

2012-08-15 Thread Callum Bonnyman
I am creating a popular page for my app and for the most part this is just to gain an understanding. The idea is to divide the number of views by the days old, now i don't know if this will be successful or even working but like I said its go get an idea of how queries work... My fields are

Re: join models on Timestamp field without foreign keys

2012-08-15 Thread Jeff Dickens
On Tuesday, August 14, 2012 1:43:18 PM UTC-4, Dennis Lee Bieber wrote: > > On Mon, 13 Aug 2012 21:58:59 -0700 (PDT), Jeff Dickens > > declaimed the following in > gmane.comp.python.django.user: > > > Hi all. I have a number of models, each of which is based on an > abstract > > class that i

Re: UnicodeDecodeError with non ascii app_label

2012-08-15 Thread vitalije
Just in case someone else run in the same problem, I have found a solution. It is explained here: https://code.djangoproject.com/ticket/17566 HTH Vitalije -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visi

Re: blocktrans inside a with tag

2012-08-15 Thread dipo . elegbede
H Sent from my BlackBerry wireless device from MTN -Original Message- From: ernando Sender: django-users@googlegroups.com Date: Wed, 15 Aug 2012 10:27:30 To: Reply-To: django-users@googlegroups.com Subject: Re: blocktrans inside a with tag Sorry, didn't catch it :) I just che

Re: blocktrans inside a with tag

2012-08-15 Thread ernando
Sorry, didn't catch it :) I just checked provided code - and it works ok (1.4 Django). Are u using the latest version or 1.3 one? -Dmitry -- 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

read only datatime field with a custom admin

2012-08-15 Thread brian downing
How do I create a read only datatime field with a custom admin? Here is the psudo code from what I've done: - class myAdminForm(forms.ModelForm): def __init__(self, *args, **kwargs): super(myAdminForm, self).__init__(*args, **kwargs)

transaction.rollback() raises an exception when my transactions fail due losing connection to oracle. How to handle?

2012-08-15 Thread Matthew Lauber
All, I've got an issue with a flakey connection between my oracle database and my webserver. We run a background merge process, managed by django. Every so often, the database connection will go down with an ORACLE-03113 error, "Received end-of-file on communication channel. This is occu

Re: blocktrans inside a with tag

2012-08-15 Thread Melvyn Sopacua
On 15-8-2012 16:26, ernando wrote: > I really didn't try to use blocktrans and with tags together but why do > use val variable value with $ sign? Try just {{val}} one - it works ok for > me. Because it's a monetary ammount? -- Melvyn Sopacua -- You received this message because you are subs

Re: What is the easy way to install DJango?

2012-08-15 Thread Vibhu Rishi
Hi, If you are new to Django and are just getting around to learn it, I recommend using BitNami Django stack for windows. http://bitnami.org/stack/djangostack So far, it has been the easiest to install on the windows machine. Vibhu On Wednesday, 15 August 2012 14:06:33 UTC+5:30, Thato wrote:

Re: blocktrans inside a with tag

2012-08-15 Thread ernando
I really didn't try to use blocktrans and with tags together but why do use val variable value with $ sign? Try just {{val}} one - it works ok for me. - Dmitry On Tuesday, August 14, 2012 2:41:16 AM UTC+3, Jason Buckner wrote: > > I would like to use a blocktrans tag inside a with tag so I can

Re: Auto login with external cookie from different system

2012-08-15 Thread Melvyn Sopacua
On 15-8-2012 13:04, Tomas Jacobsen wrote: > Hello > > I'm trying to write a custom backed for login in users from an > external encrypted cookie. > > I have done it in PHP, but I'm trying to convert it to python/django > logic, but this is most advanced python code I have tried to write! I > have

Re: New to dj: relational limitations

2012-08-15 Thread Tomas Neme
> On Tue, Aug 14, 2012 at 8:49 PM, Russell Keith-Magee > wrote: I'm just glad I didn't come back with a half-assed response -- "The whole of Japan is pure invention. There is no such country, there are no such people" --Oscar Wilde |_|0|_| |_|_|0| |0|0|0| (\__/) (='.'=)This is Bunny. Copy an

Re: 回复: Stuck on "ViewDoesNotExist" last step of tutorial part 4

2012-08-15 Thread Melvyn Sopacua
On 15-8-2012 10:01, Pengfei Xue wrote: > there's no function in views.py, you should define that 'index' > handler No, he's not using it according to source. Which means the source is not in sync with what is being run, typically fixed by restarting the WSGI provider. -- Melvyn Sopacua -- You

Re: What is the easy way to install DJango?

2012-08-15 Thread baldyeti
Thato Aphane wrote, On 2012-08-15 15:06: I have downloaded Django now where do I unzip it/ In which path? Wherever you want - that'll just be a temporary working directory used during the install; afterwards the setup tools will copy the django files under your site-packages (the work directory

Prevent sorting in admin

2012-08-15 Thread Timster
Picture the following model and admin: class Section(models.Model): position = models.PositiveIntegerField(editable=False) title = models.CharField(max_length=200) class SectionAdmin(admin.ModelAdmin): list_display = ['title'] ordering = [ 'position'] The position is a column tha

Re: What is the easy way to install DJango?

2012-08-15 Thread Thato Aphane
I have downloaded Django now where do I unzip it/ In which path? On Wed, Aug 15, 2012 at 3:00 PM, Jirka Vejrazka wrote: > It's easy to install Django on a Windows machine to test it out and > develop code. Most of this is covered here: > https://docs.djangoproject.com/en/1.4/topics/install/ > >

Re: What is the easy way to install DJango?

2012-08-15 Thread Jirka Vejrazka
It's easy to install Django on a Windows machine to test it out and develop code. Most of this is covered here: https://docs.djangoproject.com/en/1.4/topics/install/ In a nutshell, you need: - Python 2.x (2.7) - install it if you already have not done so - Django (start with a stable release e.g.

Re: What is the easy way to install DJango?

2012-08-15 Thread baldyeti
You'll need the python interpreter first then 'pip install django' should give you the latest release (pip.exe lives under the Scripts subdirectory of your python install, which I think recent installers should add to you PATH automatically) Other than that I see nothing wrong with the offcial

Re: What is the easy way to install DJango?

2012-08-15 Thread Thomas Guettler
Am 15.08.2012 10:36, schrieb AbcThato: Hi guys I want to install Django on my windows computer please help me the easy way to install Django frame work. Regards AbcThato Where do you want to deploy your app if you have written some code? Most Hosting environments use Linux. That's why I woul

Re: New to dj: relational limitations

2012-08-15 Thread Axel Rau
Am 15.08.2012 um 01:49 schrieb Russell Keith-Magee: > This SQL "Standard" of which you speak… do you know of anyone that > implements it? :-) Yes. Look here: http://www.postgresql.org/docs/9.1/static/features.html At a minimum, I expect such a conformance list from a vendor. > > Python c

Re: NoReverseMatch Error

2012-08-15 Thread Karen Tracey
On Tue, Aug 14, 2012 at 10:46 AM, Serge G. Spaolonzi wrote: > Try removing the quotes from 'polls.views.vote': > > > > > Note that will work for 1.4 but it's doing things the old way, and that will break in 1.5. Much better to add {% import url from future %} and have code that will continue to w

Auto login with external cookie from different system

2012-08-15 Thread Tomas Jacobsen
Hello I'm trying to write a custom backed for login in users from an external encrypted cookie. I have done it in PHP, but I'm trying to convert it to python/django logic, but this is most advanced python code I have tried to write! I have found some basic examples to look at, but none of them

What is the easy way to install DJango?

2012-08-15 Thread AbcThato
Hi guys I want to install Django on my windows computer please help me the easy way to install Django frame work. Regards AbcThato -- 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.

Re: 'bool' object has no attribute 'render'

2012-08-15 Thread Alexis Roda
Al 15/08/12 02:59, En/na yao ge ha escrit: class NewsAdmin(admin.ModelAdmin): list_display = ('title','newstype','newsdate',) search_fields=('title',) list_filter =('newstype',) delete_selected_confirmation_template = True raw_id_fields = ('rateperson','ratetvplay',) admi

回复: Stuck on "ViewDoesNotExist" last step of tutorial part 4

2012-08-15 Thread Pengfei Xue
there's no function in views.py, you should define that 'index' handler -- Sincerely, Pengfei Xue 已使用 Sparrow (http://www.sparrowmailapp.com/?sig) 已使用 Sparrow (http://www.sparrowmailapp.com/?sig) 在 2012年8月15日星期三,上午11:16,Sky 写道: > I've having a similar problem here using Django 1.4 and

Re: more info to the user

2012-08-15 Thread Mario Gudelj
For the first question you should look at Forms topic in django docs. For the second one take a look at models docs for the info on how to mark the field as not required. M On Aug 15, 2012 3:36 PM, "heni yemun" wrote: > Hi, > I have set up a UserProfile using the technique outlined in the standa