Re: Django TypeError

2012-07-16 Thread @@
u = User.objects.all() u is not a user. On Tue, Jul 17, 2012 at 2:00 PM, Sandeep kaur wrote: > I want to have different views for my application for different types > of users. For this I have this code for my views.py file : > > def index1(request): > u = User.objects.all() > i

Django TypeError

2012-07-16 Thread Sandeep kaur
I want to have different views for my application for different types of users. For this I have this code for my views.py file : def index1(request): u = User.objects.all() if u.is_staff ==1 and u.is_active == 1 and u.is_superuser == 1: return render_to_response('tc

Re: Any free cloud database hosting ?

2012-07-16 Thread surya
Hi Alex, Actually I am perfectly aware of Heroku. The point is, when I tried to install Postgre add-on in it, its asking to "verify" my account. i.e., to provide credit card details. Thats the problem... So I looked around OpenShift and I think most of it is for free. can you tell me more on

How to toggle active/inactive items on webpage using Djnago/python......?

2012-07-16 Thread Pervez Mulla
Hey, In my webpage how can Active/Inactive some items based on user subscription? If customer is subscribed (Active)then he can able to access all the futures ,else customer will able to access only few(limited) items in webpage? How can do this in Djnago...? Please help me Thank Yo

Can't use admin with apache

2012-07-16 Thread Matt Smith
Background: I work on my projects using apache2 on my desktop machine, then just rsync across to the actual server (also apache2), that way I thought I could avoid the hassle of having things work with the dev server, but not with apache. Not so. Today I've discovered that the admin works under

Re: Query Distance from User

2012-07-16 Thread JJ Zolper
Just use Lat/Lon. You can fidget over which ojection to use later as long as your data is good. (WGS84 is the best btw) I agree lat long sounds beautiful to me! Well thats good. For geolocation, you can use the HTML5 Geolocation API that will use the person's browser to give you a location us

Re: Query Distance from User

2012-07-16 Thread JJ Zolper
I absolutely agree! That sounds like a much better way to install postgis and the other various packages. No more fiddling with my configure issues. I will try installing all of it tomorrow. -- You received this message because you are subscribed to the Google Groups "Django users" group. To

Re: Any free cloud database hosting ?

2012-07-16 Thread Alec Taylor
No, I have a heorku account without a credit card. Admittedly it was automatically created via facebook... :P So just do the same thing, create an app on facebook and it'll say "special offer from partner" click that and you'll be setup for free on Heroku On Tue, Jul 17, 2012 at 1:39 PM, surya

Re: Query Distance from User

2012-07-16 Thread JJ Zolper
So wait, Does UTM have to do with the timezones in the USA? Do some of the lines match to tomezone lines? You also never really answered my question before. Sure it sounds like you know what UTM is but I sure dont and thats all youre talking about. If this is about the timezones or whatever th

Re: Any free cloud database hosting ?

2012-07-16 Thread surya
Heroku even needs "credit card". and let me check about red hat! On Tuesday, July 17, 2012 9:06:18 AM UTC+5:30, Alec Taylor wrote: > > Heroku or Red Hat Open Cloud > > On Tue, Jul 17, 2012 at 1:27 PM, surya wrote: > >> I am building a facebook application where I have to use database models >> (

Re: Any free cloud database hosting ?

2012-07-16 Thread Alec Taylor
Heroku or Red Hat Open Cloud On Tue, Jul 17, 2012 at 1:27 PM, surya wrote: > I am building a facebook application where I have to use database models > (very small size ~ 1MB - 2MB). Is there any good cloud db storage website > for hosting the database?? > > I looked around Amazon Web Services,

Any free cloud database hosting ?

2012-07-16 Thread surya
I am building a facebook application where I have to use database models (very small size ~ 1MB - 2MB). Is there any good cloud db storage website for hosting the database?? I looked around Amazon Web Services, it has really great offers but "I don't have credit card" :( I thought of using G

Re: FastCGI Problems

2012-07-16 Thread Jarrett Chisholm
Hey Newt, not sure if this is your problem, but I think os.environ["DJANGO_SETTINGS_MODULE"] = "settings.py" should be os.environ["DJANGO_SETTINGS_MODULE"] = "proj1.settings" good luck On Saturday, 14 July 2012 14:05:35 UTC-4, Newt wrote: > > (Sorry if this is a repost - it isn't showing up

django on shared hosting

2012-07-16 Thread Jarrett Chisholm
Hi all, I'm trying to setup django on greengeeks (shared hosting). I've setup flup and django and a small app. I've also created my cgi file (mysite.cgi) that runs from my cgi-bin directory. I originally setup my .htaccess file as well, but it seems to redirect fine without any changes to .h

start with django

2012-07-16 Thread Arian Asadi
hello all I learnt very small of python and django . what I must to do to learn these? can you get me a link to download the learn video ? -- 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

Re: Built-in filter "linebreaks" does not do what it says in the documentation

2012-07-16 Thread Russell Keith-Magee
On Mon, Jul 16, 2012 at 7:43 PM, Daniel Klein wrote: > So the bog-standard built-in filter linebreaks is supposed to do the > following: > > "Replaces line breaks in plain text with appropriate HTML" > > The doc string is: > > """Converts newlines into and s.""" > > However, it doesn't do this a

Re: Excluding items from a queryset

2012-07-16 Thread akaariai
On 16 heinä, 14:38, Sithembewena Lloyd Dube wrote: > Hi everyone, > > I have a queryset of categories and would like to exclude categories with > no items associated. I am cycling through the queryset as follows, without > the desired result: > > for cat in categories: >                 if cat.ite

how forms.py works

2012-07-16 Thread 银涛 徐
Dear all, I am a learner  and reading Django Documentation, how forms.py works? does it like models.py, Django can find it automatically? or everytime I need use "import forms"? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this g

Re: Is upgrading to a newer Django version generally hassle-free?

2012-07-16 Thread sadpluto
Thanks to all for the feedback. It looks safe enough. I guess I was hoping for a 2to3-like tool for these properly announced upgrades! -- 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.goog

Re: ForeignKey problem

2012-07-16 Thread Kurtis Mullins
I'd suggest taking a step back from the data structure of your application, decide what you want to do with your data, and then take another stab at it. If you have more questions, I'd recommend posting your questions using your application's real domain instead of continuing to use "similar" idea

Re: satchmo and django-admin-tools

2012-07-16 Thread Tomas Neme
> thanks for sharing, I'll try to understand it. > > where should I put this file? inside localsite? > > what admin template are you talking about? the admin tools or the plain > admin? dashboard's (it's part of admin_tools) admin/index template. > I thought of using the admin tools templates and

Re: Excluding items from a queryset

2012-07-16 Thread Michael Elkins
On Mon, Jul 16, 2012 at 01:38:47PM +0200, Sithembewena Lloyd Dube wrote: I have a queryset of categories and would like to exclude categories with no items associated. I am cycling through the queryset as follows, without the desired result: for cat in categories: if cat.item_set.

Re: satchmo and django-admin-tools

2012-07-16 Thread Avraham Serour
thanks for sharing, I'll try to understand it. where should I put this file? inside localsite? what admin template are you talking about? the admin tools or the plain admin? I thought of using the admin tools templates and building from that, but all I got was noReverseMatch erros, looks like th

Re: Django in MovablePython

2012-07-16 Thread Michael Palumbo
Hi, I have been recently concerned about getting a portable Django development environment as well. I wanted it to work on any computers without installing anything. I could get it to work, I can now carry my environment and projects on a USB stick. :) I assume it is a bit late for your case no

Django Unit Tests Missing Database Columns

2012-07-16 Thread Simon
I created a unit test on Django to create a user account and send a verification e-mail. The user is created, but the e-mail fails to send. The e-mail's default contents are supposed to be created as a field in the user when a user is created, but for some reason, Django is claiming - Databas

Re: satchmo and django-admin-tools

2012-07-16 Thread Tomas Neme
> I thought they extended the templates instead of trying to replace > everything they don't replace everything. But the admin site's index template is called 'admin/index.html', so it's not easy to extend them. They DO extend admin/base.html. This is my dashboard.py file, where I create a modul

Re: m2m through intermediate model: template friendly syntax not working. dj1.3

2012-07-16 Thread Ramiro Morales
On Mon, Jul 16, 2012 at 4:10 PM, brycenesbitt wrote: > I'm still stuck on this. Is there any tutorial example that shows access > m2m intermediate model data from a template. The issue is the template > library won't accept parameters. Do I have to write a custom tag to get the > m2m intermedia

Re: m2m through intermediate model: template friendly syntax not working. dj1.3

2012-07-16 Thread brycenesbitt
I'm still stuck on this. Is there any tutorial example that shows access m2m intermediate model data from a template. The issue is the template library won't accept parameters. Do I have to write a custom tag to get the m2m intermediate data fields? -- You received this message because you

Handling millions of rows + large bulk processing (now 700+ mil rows)

2012-07-16 Thread Fadi Samara
Interested. -- 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/-/RWAeYm45nIEJ. To post to this group, send email to django-users@googlegroups.com. To unsubscribe

Re: Excluding items from a queryset

2012-07-16 Thread Avraham Serour
isn't it possible to define this in the query? to return only non empty categories? or return categories where it has more than 1 member? On Mon, Jul 16, 2012 at 2:38 PM, Sithembewena Lloyd Dube wrote: > Hi everyone, > > I have a queryset of categories and would like to exclude categories with >

Re: satchmo and django-admin-tools

2012-07-16 Thread Avraham Serour
I thought they extended the templates instead of trying to replace everything do you know which templates would I have to redefine? everything I find in both? On Mon, Jul 16, 2012 at 6:09 PM, Tomas Neme wrote: > Yes, you'll need to get your hands dirty, and merge the two admin > templates, sinc

Re: Directory indexes are not allowed here. for Grappilli

2012-07-16 Thread Thomas Orozco
What is your actual problem here? Do you not understand the message? Do you have a reason for which you'd want this directory indexed? Le 16 juil. 2012 13:24, "chhots" a écrit : > Page not found (404) Request Method: GET Request URL: > http://localhost:8080/static/grappelli/ > > Directory inde

Re: Is Tutorial / Part 4 wrong? (or is it me?)

2012-07-16 Thread Tomas Neme
It's the second time this issue appears in the list in two weeks, maybe it's time to recheck the tutorial? There's no "polls" in your results' url, doesn't the tutorial say you should have two urls file? one in project/urls.py and another one in polls/urls.py ? the polls-specific urls shouldn't s

Re: values() and order_by()

2012-07-16 Thread dmik
https://code.djangoproject.com/ticket/17144 has patch fixing this problem On Tuesday, July 3, 2012 2:51:17 PM UTC+4, jjmaestro wrote: > > Hi there! > > I have the following model: > > class Visit(models.Model): > user = models.ForeignKey(User) > visitor = models.ForeignKey(User,

Is Tutorial / Part 4 wrong? (or is it me?)

2012-07-16 Thread Bill Torcaso
Django is great, and the tutorial is great. I'm having a problem at the very end of tutorial-4. I try to use generic views, and I get an error when I Redirect from the POST request in vote() to the Results page. Details below. The tutorial code says to put this in my urls.py: url(r'^(?P

Directory indexes are not allowed here. for Grappilli

2012-07-16 Thread Brent
Did you try changing your settings.py file from DEBUG=True to DEBUG=False? -- 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/-/_xGLm2OIgFIJ. To post to this gro

Re: Why am I getting an error when send e-mail from hosting?

2012-07-16 Thread Sergiy Khohlov
good question contains answer: SMTPDataError: (554, 'mail server permanently rejected message (#5.3.0)') your SMTP reject your message thanks Serge 2012/7/16 Andrejus : > Nicolas, thanks for help. > > I'm glad and proud to state I've discovered the cause of the problem myself > - the prob

Progress monitoring using Django model is not syncronized (One writer and multiple readers)

2012-07-16 Thread Wei An
I am implementing a progress monitoring function using Django. However, I cannot get the updated value in the front end. A Django management command is executed by popen to keep updating the progress of the model webscan. Scan is a Django model and progress_info is an attribute of the model w

Re: Why am I getting an error when send e-mail from hosting?

2012-07-16 Thread Andrejus
Nicolas, thanks for help. I'm glad and proud to state I've discovered the cause of the problem myself - the problem was SMTP (or maybe the recipient's side) on hosting has been configured to reject any message without sender's address. Using send_mail with specifying sender explicitly solved my

Re: satchmo and django-admin-tools

2012-07-16 Thread Tomas Neme
Yes, you'll need to get your hands dirty, and merge the two admin templates, since both apps redefine templates/admin/index.html and some other templates. The best approach, I think, is just use django-admin-tools' templates and create custom dashboard/modules to duplicate satchmo's templates' beh

Re: Why am I getting an error when send e-mail from hosting?

2012-07-16 Thread Nicolas Emiliani
On Mon, Jul 16, 2012 at 4:05 AM, Andrejus wrote: > I've got a Django instance (1.4, python 2.7.2) running via FastCGI on > vds-hosting. > The problem is: > > (mypython)-bash-4.1$ python manage.py shell > Python 2.7.2 (default, Dec 8 2011, 12:06:29) > [GCC 4.4.4 20100726 (Red Hat 4.4.4-13)] on lin

Re: access the state of a Model object prior to it's modification ?

2012-07-16 Thread Nicolas Emiliani
Jani, thanks for the idea, some thoughts below your code. > > class MyPublicationModel(Model): > def save(...): # I don't remember the signature > if self.is_published and not self.publication_date: > # Published previously unpublished - set the date > self.pu

Built-in filter "linebreaks" does not do what it says in the documentation

2012-07-16 Thread Daniel Klein
So the bog-standard built-in filter linebreaks is supposed to do the following: "Replaces line breaks in plain text with appropriate HTML" The doc string is: """Converts newlines into and s.""" However, it doesn't do this at all. It neither replaces nor converts; instead it leaves linebreak

Excluding items from a queryset

2012-07-16 Thread Sithembewena Lloyd Dube
Hi everyone, I have a queryset of categories and would like to exclude categories with no items associated. I am cycling through the queryset as follows, without the desired result: for cat in categories: if cat.item_set.count() == 0: categories.exclude(pk=cat.

Re: Use Django to implement my GUI!

2012-07-16 Thread Eugène Ngontang
Ok! I think several times and solved the problem. In fact I think the admin was waiting an address to build the http response it self, not really a http response. I remove the HttpResponse or HttpResponseRedirect method from the return statement, and it worked as I expected. The wrong code lin

Directory indexes are not allowed here. for Grappilli

2012-07-16 Thread chhots
Page not found (404) Request Method: GET Request URL: http://localhost:8080/static/grappelli/ Directory indexes are not allowed here. You're seeing this error because you have DEBUG = True in your Django settings file. Change that to False, and Django will display a standard 404 page.

Re: Handling millions of rows + large bulk processing (now 700+ mil rows)

2012-07-16 Thread Cal Leeming [Simplicity Media Ltd]
Hi guys, This has now been confirmed for the following date: - Thursday 9th August 2012 - 7:00 PM (UTC) Webcast details will be sent 48 hours before. Cheers Cal On Sun, Jul 1, 2012 at 4:09 PM, Cal Leeming [Simplicity Media Ltd] < cal.leem...@simplicitymedialtd.co.uk> wrote: > Wow - glad to

Re: Nested querysets or a smarter template?

2012-07-16 Thread Alex Strickland
On 2012/07/16 11:28 AM, Alex Strickland wrote: I am new to Django and a bit lost at sea. I want to use Bootstrap and their accordion control. I have these models: Write a request for help, and then you'll work it out pretty soon after: {% for group in group_list %}

Nested querysets or a smarter template?

2012-07-16 Thread Alex Strickland
Hi all I am new to Django and a bit lost at sea. I want to use Bootstrap and their accordion control. I have these models: class Research_Category_Group(models.Model): name = models.CharField(max_length=40) class Meta: ordering = ["name"] class Research

Re: Extend groups admin interface

2012-07-16 Thread yillkid
upload a screen shut I want to extend it: https://picasaweb.google.com/lh/photo/WF1hH23eRHse3IsmmERcDdMTjNZETYmyPJy0liipFm0?feat=directlink yillkid於 2012年7月16日星期一UTC+8下午3時35分23秒寫道: > > Hi all ! > > I want to extend my group admin interface, > url is "/admin/auth/group/add/" > > Now my interface

Re: How to present a calculated field in a admin edit form.

2012-07-16 Thread tWoolie
What would it mean to django to have a formfield for a method anyway? You need to override the edit page template for that model. or You need to supply a custom form for the edit page that takes care of inserting and removing the calculated data on __init__ and clean -- You received this messa

Re: 'NoneType' object has no attribute 'datetime' bug?

2012-07-16 Thread tWoolie
somehow, your global datetime variable is being clobbered with the value None. Find where that happens, and your bug will disappear. -- 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: Query Distance from User

2012-07-16 Thread tWoolie
Just use Lat/Lon. You can fidget over which projection to use later as long as your data is good. (WGS84 is the best btw) For geolocation, you can use the HTML5 Geolocation API that will use the person's browser to give you a location usually accurate to 200m (better if they're on a phone with

How to present a calculated field in a admin edit form.

2012-07-16 Thread Erlend Dalen
Hi, I'm using Django 1.0 (beta_1) and have the following issue: I have a method in a model that returns a calculated value and I would like this value to be displayed in the admin edit form related to that view. I have no problem showing the field in the list_display, but if I add it to fields i

Re: 'NoneType' object has no attribute 'datetime' bug?

2012-07-16 Thread dobrysmak
Thank's for help , i did this and now i've got this AttributeError at /wejdz-do-gry/76/ 'NoneType' object has no attribute 'now' This is strange because the shell import works fine but the server script throus an exception. >>> from datetime import datetime, time, date > >>> print datetime.now

Re: access the state of a Model object prior to it's modification ?

2012-07-16 Thread Jani Tiainen
Probably you want to do that logic a slightly differently on a model level (so rule would apply always when you save your model). So you would actually override model save method. Probably rule is something like this: class MyPublicationModel(Model): def save(...): # I don't remember the si

Extend groups admin interface

2012-07-16 Thread yillkid
Hi all ! I want to extend my group admin interface, url is "/admin/auth/group/add/" Now my interface have 2 fields 1. name 2. permissions And now I want to add a country field. In UserProfile extend I just follow this link and work very good: http://jessenoller.com/2011/12/19/quick-example-o

Re: m2m through intermediate model: template friendly syntax not working. dj1.3

2012-07-16 Thread brycenesbitt
> > Using 'for entry in category.ce_.all', as suggested elsewhere also fails >> > > -- 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/-/qVATgZeGAWMJ. To po

Re: 'CSRF verification failed." from django.contrib.comments. can you help solve it? django 1.3

2012-07-16 Thread brycenesbitt
It works now that I have fully uninstalled pybbm. Pybbm was incompatible with my app because it also extended the User object (something apparently you can only do once?) -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, sen