Re: RemoteUserBackend not creating user

2012-02-20 Thread Babatunde Akinyanmi
I'm not too sure what you are trying to do but there's no part of your code that tries to create a user. Maybe you should give more information On 2/21/12, Roberto Bouza wrote: > Hello, > > I've been hitting my head pretty hard trying to figure out what the > problem is hope

Re: handling multiple parallel request

2012-02-20 Thread Derek
On Feb 20, 11:32 pm, "rafiee.nima" wrote: > tnx alot > but actually my scenario dose not deal with user so I thing cookies do > not help a lot > suppose there are 3 airline counter which fill ticket forms and send > them to the cashier maybe  simultaneously  .forms are sent

Re: doubt in the tutorial

2012-02-20 Thread kalyani ram
I will tell you what, You are just awesome :) Thanks a million. I was so worried :) As you told i tried all the way and only then posted. I ll take care of indentation from now on :) Thanks again. On Feb 20, 5:20 pm, akaariai wrote: > Check the indentation of __unicode__

Re: doubt in the tutorial

2012-02-20 Thread kalyani ram
did u try this by any chance?? I found the way out, but it doesn return what i want. When is give Poll.objects.all() it is equivalent to SELECT * from Poll; and for me it returns in your case, poll is an object ryt? now wer is the attribute? print [e.question for e in Poll.objects.all()] =

Re: Installation steps for Ubuntu 11.10 users

2012-02-20 Thread Jigish Chawda
I am facing problems in configuring geodjango with Postgresql 9.1 DB. With engine== django.contrib.gis.db.backends.postgis , I get an error saying it doesnot exist. I have put up this question here also :

Re: dropdown select box in django

2012-02-20 Thread Mario Gudelj
Hey there, Try this: In your forms.py create a field such as this message = forms.ChoiceField(label='Event Type', choices=EVENT_TYPE_CHOICES) That will create a dropdown. Also, I think that the first thing in the tuple is a value and shouldn't have a space, so change: EVENT_TYPE_CHOICES =

Re: registration forms.py

2012-02-20 Thread Stanwin Siow
Thanks akaarial and bill, Much appreciated for the help on getting me to understand more about django. :) Best Regards, Stanwin Siow On Feb 20, 2012, at 5:11 AM, akaariai wrote: > On Feb 19, 1:42 pm, Stanwin Siow wrote: >> Hello, >> >> The below method is an

About managing dependencies in a collaborative development team and good practices.

2012-02-20 Thread Santiago Basulto
Hello people, some time ago with a couple of friends started a project with Django. We are really getting into it now, and have made several progress in the last 3 months. But, as the code starts to grow up, everything start to get complicated. Right now we have our project hosted on Bitbucket,

Re: Creating a hospital erp (hospital management) in Django

2012-02-20 Thread Alec Taylor
... Design doesn't matter one bit for what you're doing. Don't try and win design awards by having CSS dropdowns. Concentrate on solving their business logic rather than adding images of sexy nurses And get that book. There are free books online, there's the official django tutorial also. On

Re: dropdown select box in django

2012-02-20 Thread larry.mart...@gmail.com
On Feb 20, 5:54 pm, Anurag Chourasia wrote: > This is weird > > I simply copy pasted your code in my environment and it shows me a Drop > Down. > > Could you save the models file again and close your browser (or even try > clearing cache) and restart your

Re: dropdown select box in django

2012-02-20 Thread Micky Hulse
Your code looks good to me. Maybe you need to restart apache (or similar)? This is typically the format I use for choice fields: LIVE_STATUS = 1 DRAFT_STATUS = 2 HIDDEN_STATUS = 3 STATUS_CHOICES = ( (LIVE_STATUS, u'Live'), (DRAFT_STATUS, u'Draft'), (HIDDEN_STATUS, u'Hidden'), )

Re: dropdown select box in django

2012-02-20 Thread Anurag Chourasia
This is weird I simply copy pasted your code in my environment and it shows me a Drop Down. Could you save the models file again and close your browser (or even try clearing cache) and restart your apache/django dev server whatever may be the case and try again? Regards, Anurag On Mon, Feb

Re: dropdown select box in django

2012-02-20 Thread larry.mart...@gmail.com
On Feb 20, 5:39 pm, Stanwin Siow wrote: > Try removing > > "Event Type", > > in the following > > message = models.CharField("Event Type", max_length=12, > choices=EVENT_TYPE_CHOICES) > > Best Regards, > > Stanwin Siow No difference. > > On Feb 21, 2012, at 8:32 AM,

Re: dropdown select box in django

2012-02-20 Thread Stanwin Siow
Try removing "Event Type", in the following message = models.CharField("Event Type", max_length=12, choices=EVENT_TYPE_CHOICES) Best Regards, Stanwin Siow On Feb 21, 2012, at 8:32 AM, larry.mart...@gmail.com wrote: > ield("Event Type", max_length=12, > choices=EVENT_TYPE_CHOICES) -- You

dropdown select box in django

2012-02-20 Thread larry.mart...@gmail.com
I'm fairly new to django, still getting my feet wet. I want to have a dropdown menu (django seems to call this a select box). I read this: https://docs.djangoproject.com/en/dev/ref/models/fields/#django.db.models.Field.choices So I did this: class EventsTable(models.Model):

RemoteUserBackend not creating user

2012-02-20 Thread Roberto Bouza
Hello, I've been hitting my head pretty hard trying to figure out what the problem is hope someone here can help. I've set up the remote backends and middleware as per the docs and blatantly I'm coding the META remote_user and nothing happens. like this: MIDDLEWARE_CLASSES = (

Re: I am getting TypeError: coercing to Unicode: need string or buffer, long found. Please help.

2012-02-20 Thread Furbee
As an aside, I would assume you want your phone number field to be a string (models.CharField) instead of integer. Furbee On Mon, Feb 20, 2012 at 2:39 PM, Babatunde Akinyanmi wrote: > @Daniel > Your __unicode__ should always return a string so like Shawn said, > when you

Re: I am getting TypeError: coercing to Unicode: need string or buffer, long found. Please help.

2012-02-20 Thread Babatunde Akinyanmi
@Daniel Your __unicode__ should always return a string so like Shawn said, when you check your phone model, its __unicode__ method should be returning str() or unicode() not int On 2/20/12, Shawn Milochik wrote: > Read the error message in your subject line. Then look at the

Re: Associating Form Data with Users

2012-02-20 Thread Thorsten Sanders
You could do for example: exclude the user field from the form and in your view something like this: form = YourModelForm(request.POST) #fill the modelform with the data if form.is_valid(): # check if valid mynewobject = form.save(commit=False) #save it to create the

Re: Associating Form Data with Users

2012-02-20 Thread ds39
I hate to keep bringing this issue up, but I'm still not entirely sure how to implement this. I've tried a number of different ways to connect some kind of user ID with form data without much success. Is the idea that after authenticating the user in the view, request.user be set to some variable

Re: handling multiple parallel request

2012-02-20 Thread rafiee.nima
tnx alot but actually my scenario dose not deal with user so I thing cookies do not help a lot suppose there are 3 airline counter which fill ticket forms and send them to the cashier maybe simultaneously .forms are sent to the cashier which is just a function in my view ,,I want to know how I

Re: Count values grouped by date

2012-02-20 Thread Martin Tiršel
On Mon, 20 Feb 2012 18:33:40 +0100, Tom Evans wrote: On Mon, Feb 20, 2012 at 5:17 PM, Martin Tiršel wrote: (btw, are you sure that works for views? looks like it is counting clicks as well) Yes, that was counting all records. This type

Re: I am getting TypeError: coercing to Unicode: need string or buffer, long found. Please help.

2012-02-20 Thread Shawn Milochik
Read the error message in your subject line. Then look at the __unicode__ method of your Phone model. It appears that this is the problem, and not the Device model. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send

I am getting TypeError: coercing to Unicode: need string or buffer, long found. Please help.

2012-02-20 Thread Daniel Marquez
Hey all, I am a beginner django user. I am going through the tutorial, but when I post the following I get the TypeError: coercing to unicode: class Phone(models.Model): phonenumber = models.IntegerField() pub_date = models.DateTimeField('date published') def

How do I display non-field errors at the bottom of a form?

2012-02-20 Thread richard.prosser
Essentially I want to ensure that a DB record provided via a form is unique AND be able to handle the error(s) produced in my own way. After lengthy and often fruitless searching I decided that a Model.validate_unique() call to trap the ValidationError would be suitable, so that I could populate

Re: Count values grouped by date

2012-02-20 Thread Tom Evans
On Mon, Feb 20, 2012 at 5:17 PM, Martin Tiršel wrote: > Hi, > > I have: > > class BannerStats(models.Model): >    ACTION_TYPE_VIEW = 0 >    ACTION_TYPE_CLICK = 1 > >    ACTION_TYPES = ( >        (ACTION_TYPE_VIEW, 'view'), >        (ACTION_TYPE_CLICK, 'click'), >    ) > >    

Count values grouped by date

2012-02-20 Thread Martin Tiršel
Hi, I have: class BannerStats(models.Model): ACTION_TYPE_VIEW = 0 ACTION_TYPE_CLICK = 1 ACTION_TYPES = ( (ACTION_TYPE_VIEW, 'view'), (ACTION_TYPE_CLICK, 'click'), ) banner = models.ForeignKey( Banner ) date = models.DateTimeField(

Re: Installing Django from GIT/Subversion - package dependency in virtual environment

2012-02-20 Thread Denis Darii
Yes Mateusz, you understood right. On Mon, Feb 20, 2012 at 4:07 PM, Mateusz Marzantowicz < mmarzantow...@gmail.com> wrote: > Yes, it works! > > Although I was previously installing Django according to docs at > https://docs.djangoproject.com/en/1.3/topics/install/#installing-development-version,

Re: template tag that iterates over list with for loop

2012-02-20 Thread Bill Freeman
Perhaps a filter rather than a tag. You will need to provide input for the filter, but it can ignore it. So: {% for a in random_variable|list_print %} Bill On 2/19/12, brian wrote: > Is it possible to create a template tag that will create a list that a >

Re: Installing Django from GIT/Subversion - package dependency in virtual environment

2012-02-20 Thread Mateusz Marzantowicz
Yes, it works! Although I was previously installing Django according to docs at https://docs.djangoproject.com/en/1.3/topics/install/#installing-development-version, your method works perfectly so far. I understand that keep in sync with trunk/master is as easy as invoking git pull (svn up) and

Re: Year dropdown in Django admin

2012-02-20 Thread grimmus
Excellent, Thanks very much -- 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/-/VfjSLhXCkPcJ. To post to this group, send email to

Re: Year dropdown in Django admin

2012-02-20 Thread Denis Darii
I was in the same situation as you and I found this solution... in your models.py: import datetime YEAR_CHOICES = []for r in range(1980, (datetime.datetime.now().year+1)):YEAR_CHOICES.append((r,r)) so, your field can now use YEAR_CHOICES: year = models.IntegerField(_('year'), max_length=4,

Year dropdown in Django admin

2012-02-20 Thread grimmus
Hi, I have a car model that contains many fields including a 'year' field. I need the dropdown for this field to display the current year as the first option and also display the previous 25 years as individual options. I was thinking i could create a list object and then populate the list

Re: Creating a hospital erp (hospital management) in Django

2012-02-20 Thread Saadat
Hello all I'm stuck on static files since yesterday. It gives me an error that no module called "staticfiles" found. What my requirement is that i have a header file where I'm including a css dropdown menu. how do i include that file, without using staticfiles. What all needs to be done to

Re: Installation steps for Ubuntu 11.10 users

2012-02-20 Thread Tom Evans
On Mon, Feb 20, 2012 at 10:49 AM, jigbox wrote: > The installation guide has instructions for Ubuntu 10.10 and below > users. > However, there is no help for Ubuntu 11.10 users. since I am facing > some uncommon problems, I request to put up installation steps for >

Re: Installation steps for Ubuntu 11.10 users

2012-02-20 Thread Leonardo Giordani
Can you detail your problems? I installed it on a 11.10 some time ago and perhaps I can help you 2012/2/20 jigbox > The installation guide has instructions for Ubuntu 10.10 and below > users. > However, there is no help for Ubuntu 11.10 users. since I am facing > some

Re: Request Context problem

2012-02-20 Thread Roald
On 20 feb, 00:03, Reinout van Rees wrote: > On 19-02-12 14:16, dummyman dummyman wrote: > > The solution is simple: just add a {{ csrf_token }} somewhere in your > form. That ought to do it. A typo there, Reinout ;-). You meant: {% csrf_token %} Cheers, Roald -- You

Re: Installing Django from GIT/Subversion - package dependency in virtual environment

2012-02-20 Thread Denis Darii
Do you mean django-trunk installation? If so, I use this in my requirements.txt: -e svn+http://code.djangoproject.com/svn/django/trunk/#egg=django-trunk or directly with pip: $ pip install -e svn+ http://code.djangoproject.com/svn/django/trunk/#egg=django-trunk Hope it helps. On Mon, Feb 20,

Re: Cannot import django.core ??

2012-02-20 Thread Andreas Rehn
Tnx alot for the quick response Anssi! Your were absolutely right, I downloaded the django tarball and installed from scratch again and it works. Funny how the disk failure corrupted both the django module under site-packages and the raw unpacked tarball from home dir /andreas 20 feb

Installation steps for Ubuntu 11.10 users

2012-02-20 Thread jigbox
The installation guide has instructions for Ubuntu 10.10 and below users. However, there is no help for Ubuntu 11.10 users. since I am facing some uncommon problems, I request to put up installation steps for Ububtu 11.10 users. Any help will be appreciated. -- You received this message because

(One-way) Communicate between processes

2012-02-20 Thread Ervin Hegedüs
Hello list, I've a long time run process, which started by a method of a Django model object. It runs through djutils.decorators.async decorator, like this: @djutils.decorators.async def my_long_time_process(self, foo): When this process starts, it creates a file, and write the

[ANN]: FeinCMS v1.5.0

2012-02-20 Thread Matthias Kestenholz
Hello everyone FeinCMS v1.5.0 has been released this noon and is available from usual places. The differences to v1.5.0.rc1 are very small, only an update of the AUTHORS file and a few fixes to the thumbnail template filters. What is FeinCMS anyway? === FeinCMS is one of

Installing Django from GIT/Subversion - package dependency in virtual environment

2012-02-20 Thread Mateusz Marzantowicz
Hello, I'm having a problem with managing Django installation which was done from git repository (might be svn as well) in clean virtual environment. The problem is that when I install some other package via pip which has a Django as a dependency, it doesn't find my django installation and then

Re: Script to call loaddata on multiple fixtures

2012-02-20 Thread Tom Evans
On Sat, Feb 18, 2012 at 4:46 PM, LJ wrote: > I have quite a number of fixtures that I call loaddata to insert > fixtures into my sqlite database using the following syntax: > > python ./manage.py loaddata ./apps/addresses/fixtures/cities.json > python ./manage.py loaddata

Re: doubt in the tutorial

2012-02-20 Thread akaariai
Check the indentation of __unicode__ method (and other methods too)... - Anssi On Feb 20, 1:50 pm, kalyani ram wrote: > hey all, > > I am learning the db connectivity using this > tutorialhttps://docs.djangoproject.com/en/dev/intro/tutorial01/ > Now, i followed every

Re: doubt in the tutorial

2012-02-20 Thread waax
I'm as well new to django/python but did you tried for poll in Polls.objects.all(): print poll ? Thanks! On Feb 20, 12:50 pm, kalyani ram wrote: > hey all, > > I am learning the db connectivity using this >

Re: How to show the template reserved keyword on html.

2012-02-20 Thread Morris
It works, thanks for your great help. On Feb 20, 4:19 pm, kahara wrote: > Hi, > > the doc says "argument tells which template bit to output", so > shouldn't this be: > > {% templatetag openvariable %} sample {% templatetag closevariable %} > >     /j > > On 20 helmi,

doubt in the tutorial

2012-02-20 Thread kalyani ram
hey all, I am learning the db connectivity using this tutorial https://docs.djangoproject.com/en/dev/intro/tutorial01/ Now, i followed every single step and yet, when i give Polls.objects.all() is gives the output as But then it should be returning the fields right? I checked the db also. I has

Re: TypeError: 'tuple' object is not callable

2012-02-20 Thread kalyani ram
Thank you. :) i ll do my best and sort this issue out :) On Feb 20, 2:32 pm, akaariai wrote: > On Feb 20, 11:16 am, kalyani ram wrote: > > > > > > > > > > > Thank you very much Anssi. I just got it perfect :D I know i am so > > silly with errors. but

Re: TypeError: 'tuple' object is not callable

2012-02-20 Thread akaariai
On Feb 20, 11:16 am, kalyani ram wrote: > Thank you very much Anssi. I just got it perfect :D I know i am so > silly with errors. but i am  beginner. Thanks alot. > Can u help me one more error? > I trying to make a db connection using postgresql and python2.7 > when i

Re: TypeError: 'tuple' object is not callable

2012-02-20 Thread kalyani ram
Thank you very much Anssi. I just got it perfect :D I know i am so silly with errors. but i am beginner. Thanks alot. Can u help me one more error? I trying to make a db connection using postgresql and python2.7 when i type import postgresql and enter I get the following error: Python 2.7.2

Re: Cannot import django.core ??

2012-02-20 Thread akaariai
On Feb 20, 10:39 am, Andreas wrote: > Hi, > > I'm trying to get graphite hooked up with apache and it has a wsgi > script that uses django. I did a std installation according to the > graphite wiki and it worked fine, but then we experienced a disk > failure and after recovery

Re: TypeError: 'tuple' object is not callable

2012-02-20 Thread akaariai
On Feb 20, 10:01 am, kalyani ram wrote: > My urls.py is as follows. > > from django.conf.urls.defaults import * > from mysite.views import current_datetime, hours_ahead > > urlpatterns = patterns('', >     (r'^time/$', current_datetime) > (r'^time/plus/(\d{1,2})/$',

Cannot import django.core ??

2012-02-20 Thread Andreas
Hi, I'm trying to get graphite hooked up with apache and it has a wsgi script that uses django. I did a std installation according to the graphite wiki and it worked fine, but then we experienced a disk failure and after recovery the graphite.wsgi does not work anymore, it fails on this line:

Re: How to show the template reserved keyword on html.

2012-02-20 Thread kahara
Hi, the doc says "argument tells which template bit to output", so shouldn't this be: {% templatetag openvariable %} sample {% templatetag closevariable %} /j On 20 helmi, 09:35, Morris wrote: > Hi Karen, > > Thanks a lot, I tried the method. > > {% openvariable

TypeError: 'tuple' object is not callable

2012-02-20 Thread kalyani ram
Hey all, I am recently trying out the examples from the link http://www.djangobook.com/en/1.0/chapter03/, where the current time have to be displayed and then modify and display the offset. I was able to display the time without any issue, but with the offset part, i get the error TypeError at