Re: Custom SQL or database API?

2008-09-02 Thread janedenone
On 2 Sep., 23:14, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Tue, 2008-09-02 at 13:12 -0700,janedenonewrote: > > Hi, > > > I am in the process of moving my handmade website to a Django-based > > version. One of my SQL queries returns all articles by a certain > > author if this article is

Re: How to display Html in my screen

2008-09-02 Thread David Zhou
> I got confused, when i write html scripts in my admin testfield like > hello and save them in mysql, but when i wanna display them > in screen, they can not display as bold font as i want, the source > file writes:

hello

> > What can i do to make it right? Django autoescapes. See:

Re: django web hosting

2008-09-02 Thread David Zhou
60 megs is kind of low for djangohosting.ch's higher plan -- webfaction, for example, gives 80 mb memory with their lowest plan. I also really dislike hosts that claim "unlimited" bandwidth, and then say in the fine print that "unlimited" really means no more than 200gb a month. In fact, d

Re: registering an admin class causes complete meltdown

2008-09-02 Thread Malcolm Tredinnick
On Tue, 2008-09-02 at 22:16 -0700, Justin Fagnani wrote: > Of course. I've been doing it this way at the start of conversions and > this is the first time it's been a problem. Some internal changes were necessary recently (particularly r8605) to work around some other problems that have made thi

Re: registering an admin class causes complete meltdown

2008-09-02 Thread Malcolm Tredinnick
On Tue, 2008-09-02 at 21:40 -0700, Justin Fagnani wrote: > I have a very, very simple model that when I register with the admin > completely kills my app/project. I can't for the life of me figure out > what's going on. If I don't register the admin class, everything works > fine, if I do, the no

registering an admin class causes complete meltdown

2008-09-02 Thread Justin Fagnani
I have a very, very simple model that when I register with the admin completely kills my app/project. I can't for the life of me figure out what's going on. If I don't register the admin class, everything works fine, if I do, the nothing that's loaded after the registration can be imported, includ

Re: My site die every two hours

2008-09-02 Thread Jason Cui
Sorry, it's my fault, the DEBUG is setted to true in settings file. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscr

Re: Where is the source code for Practical Django Projects?

2008-09-02 Thread James Bennett
On Tue, Sep 2, 2008 at 8:13 PM, Joeyx2 <[EMAIL PROTECTED]> wrote: > Still waiting on that source code? Guys, I promise you all that there will be a loud and triumphant announcement on my blog when the package goes up. With Django 1.0 landing and the final changes from that still being worked on,

Re: Testing framework observations

2008-09-02 Thread Malcolm Tredinnick
On Tue, 2008-09-02 at 18:45 -0700, ballparkfh wrote: > My fixtures won't load unless I name them "initial_data". What is the > reason for this? Based on the complete lack of example code you've provided, it's difficult to tell. Perhaps post a short example of your TestCase-derived class so we c

inlineformset_factory ValidationError

2008-09-02 Thread Aaron
Hi, has anyone encounter a similar error? ValidationError at /post/add/ [u'ManagementForm data is missing or has been tampered with'] I am able to display the inline form, but the error occurs when I try to pass the request.POST data into the PostImageFormSet Below is my view: ---

Re: Where is the source code for Practical Django Projects?

2008-09-02 Thread Ray Smith
I'd be pretty sure 99.999% of Django people are happy for James to keep working 1.0 final released before getting the fully updated source code for the book completed ;) Regards, Ray Smith http://RaymondSmith.com On Tue, 2 Sep 2008 18:13:34 -0700 (PDT), Joeyx2 <[EMAIL PROTECTED]> wrote: > >

ANNOUNCE: Django 1.0 release candidate now available

2008-09-02 Thread James Bennett
We've just put up the package for the first Django 1.0 release candidate; this package contains all of the progress made on Django through the alpha and beta releases, and is fairly close to the final Django 1.0 release. It's still not recommended for production use, but we do encourage everyone t

Re: django web hosting

2008-09-02 Thread Nikos Delibaltadakis
If you want just django then http://djangohosting.ch/ is much better than webfaction, i have accounts in both. If you want other platforms too, then prefer webfaction. 2008/9/3 Ed Wong <[EMAIL PROTECTED]> > > hi all, > > i am looking for a good web host for my django website. does anyone > sugge

Re: django web hosting

2008-09-02 Thread David Zhou
I've had pretty good experiences with WebFction. David Sent from my iPhone On Sep 2, 2008, at 7:30 PM, Ed Wong <[EMAIL PROTECTED]> wrote: > > hi all, > > i am looking for a good web host for my django website. does anyone > suggest a good host? thanks. > > > --~--~-~--~~

Re: OT: Google Chrome

2008-09-02 Thread Jon Brisbin
I tried it on my Windows VM (still waiting on a Mac version) and it seemed quite fast. Since it's WebKit, I'm hoping it'll be as easy to develop for as Safari. I like that Gears is integrated, though I haven't yet used Gears in an app (it's on my list! :). I'm seriously considering using ge

Re: django web hosting

2008-09-02 Thread Ray Smith
Hi, Have you looked at: http://djangofriendly.com/hosts/ Regards, Ray Smith http://RaymondSmith.com On Tue, 2 Sep 2008 16:30:56 -0700 (PDT), Ed Wong <[EMAIL PROTECTED]> wrote: > > hi all, > > i am looking for a good web host for my django website. does anyone > suggest a good host? tha

django web hosting

2008-09-02 Thread Ed Wong
hi all, i am looking for a good web host for my django website. does anyone suggest a good host? thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to d

YUI uploader + CSRF + Firefox + Windows = 403

2008-09-02 Thread tom
Hi there, I wonder if there is someone out there who can help me to work around the flash bug, where the wrong session cookies are sent to the server. I would like to activate CSRF together with AJAX (document.getElementById('csrfmiddlewaretoken')). It is working in each and every browser, but no

Re: Url template tag errors post-8760, invalid literal for int

2008-09-02 Thread bhunter
Is it possible this is still broken? I just updated to r8883 and now some of my {% url %} tags are breaking. I'm seeing a TemplateSyntaxError because the argument is not being converted to a string before being resolved. In other words, this example is breaking: urls.py: r('^view/num=(\d+)')

Re: geodjango join problem

2008-09-02 Thread robstar
Oops, forgot to paste that in .. I've got that in there. On Sep 2, 6:29 pm, Justin Bronn <[EMAIL PROTECTED]> wrote: > > class Location(models.Model): > >   geo_loc         = models.PointField() > > > The thing that strikes me as strange is that the geomanager doesn't > > show up at all in the t

Re: geodjango join problem

2008-09-02 Thread Justin Bronn
> class Location(models.Model): >   geo_loc         = models.PointField() > > The thing that strikes me as strange is that the geomanager doesn't > show up at all in the traceback...  not sure why I can't do a join on > geo_loc ?! > > Thanks for your help. You need to put `objects = models.GeoMan

ANNOUNCE: Security updates for Django trunk, 0.96, 0.95 and 0.91

2008-09-02 Thread James Bennett
In accordance with our security policy[1], today the Django project is issuing a set of releases to fix a security vulnerability reported to us. This message contains a description of the vulnerability, a description of the changes made to fix it, and pointers to the patches for each supported ver

geodjango join problem

2008-09-02 Thread robstar
Hi guys, I just got geodjango installed and am trying to do a basic radius query as shown on the wiki. ver: Django-1.0-beta_2 class Location(models.Model): geo_loc = models.PointField() This is the example: from django.contrib.gis.geos import * from suitengine.models import Locatio

Re: Problem with ImageField and inline admin form

2008-09-02 Thread Aaron
Hi, I have similar models and wanted to do the same thing. Here's how I got my inline to work (using your provided models as an example). class Entry(models.Model): pub_date = models.DateTimeField('date published') created = models.DateTimeField(auto_now_add=True, editable=False) ed

Re: python list issue

2008-09-02 Thread tchendrix
yeah this is a standard non-django form passing a list bruno desthuilliers wrote: > On 2 sep, 22:47, Bobby Roberts <[EMAIL PROTECTED]> wrote: > >> interesting situation. I've got a form >> > > 'form' as a django.forms.Form instance or as a plain html form ? > > >> where i can check off

Re: Custom SQL or database API?

2008-09-02 Thread Malcolm Tredinnick
On Tue, 2008-09-02 at 13:12 -0700, janedenone wrote: > Hi, > > I am in the process of moving my handmade website to a Django-based > version. One of my SQL queries returns all articles by a certain > author if this article is not a chapter or section of an article by > the same author: > > SELE

Re: day is out of range for month

2008-09-02 Thread Malcolm Tredinnick
On Tue, 2008-09-02 at 08:38 -0700, Xiong Chiamiov wrote: > On a site of ours, we got a 500 on Aug 31 with the error: > > ImproperlyConfigured: Error while importing URLconf 'ee_website.urls': > day is out of range for month > > from this line: > > announcements = {'queryset': > Announcement.ob

Re: python list issue

2008-09-02 Thread bruno desthuilliers
On 2 sep, 22:47, Bobby Roberts <[EMAIL PROTECTED]> wrote: > interesting situation. I've got a form 'form' as a django.forms.Form instance or as a plain html form ? > where i can check off items to > manipulate in the database, each checkbox containing the recordID to > manipulate > > if i check

python list issue

2008-09-02 Thread Bobby Roberts
interesting situation. I've got a form where i can check off items to manipulate in the database, each checkbox containing the recordID to manipulate if i check one box, (recordID # 66) then the length of that value is 2 If i check two boxes (record id # 66,67) then the length of the list is 2

Re: Can't assign None to instance of model (SVN 8463)

2008-09-02 Thread Donn
> This error message makes it appear dimobj is a single-element sequence > containing None You're a genius! I totally missed that. I had a hanging comma and hell followed :) Thx, \d --~--~-~--~~~---~--~~ You received this message because you are subscribed to th

Re: Can't assign None to instance of model (SVN 8463)

2008-09-02 Thread Karen Tracey
On Tue, Sep 2, 2008 at 4:31 PM, Donn <[EMAIL PROTECTED]> wrote: > > Hi, > My model (Item) has this line: > dimensions = models.ForeignKey(Dimension, null=True, blank=True ) > > Later, I want to make an Item sans dimensions like so: > itemobj = Item( blah >dimensions = dimobj, >

Can't assign None to instance of model (SVN 8463)

2008-09-02 Thread Donn
Hi, My model (Item) has this line: dimensions = models.ForeignKey(Dimension, null=True, blank=True ) Later, I want to make an Item sans dimensions like so: itemobj = Item( blah dimensions = dimobj, ) But - dimobj is None (as it should be). I get this error: Cannot assign "(N

Re: problem with passing dict object to django template

2008-09-02 Thread Matt Berg
Bruno and David, Thanks. I greatly appreciate the help. You're right. I should include this in the model and have it handled by a class. Right now I'm just focused on figuring out the mechanics of django. Again, thank you very much for taking the time to explain this. Matt On Sep 2, 3:06 pm,

Custom SQL or database API?

2008-09-02 Thread janedenone
Hi, I am in the process of moving my handmade website to a Django-based version. One of my SQL queries returns all articles by a certain author if this article is not a chapter or section of an article by the same author: SELECT pages.id, pages.author_id, motherpages.author_id AS motherauthor FR

Re: Initial values in form fields

2008-09-02 Thread bruno desthuilliers
On 2 sep, 19:10, cArkraus <[EMAIL PROTECTED]> wrote: > Hey everyone, > > am pretty new to Django and Python in general. > I seem not be able to let the 'initial' value of a form-field be > calculated by its parent form. > > I'd like to do sth like this: > > class AbstractForm(forms.Form): > so

Re: Field type for 13 digit positive integer?

2008-09-02 Thread coan
For now I was planning to store ISBN13 and 13 digit ean codes. In mysql a bigint field would hold these, but I see no corresponing fieldtypes in django for bigints - the positiveintegerfield sets itself up as an int(10) signed field type in mysql. - I guess I could store them as charfields, but

Syntax highlight for django template

2008-09-02 Thread coldhitman47
I love gedit and currently using gedit 2.22.3 that comes with really good python syntax highlight and python console. I'm wondering if there's django syntax highlight plugin that I can install. --~--~-~--~~~---~--~~ You received this message because you are subscr

Re: Field type for 13 digit positive integer?

2008-09-02 Thread tchendrix
the reason i'm asking is that digits 14 and 15 will be alphanumeric so add another field or two for that data (char?) and use bigint to hold the numerical data coan wrote: > On Sep 2, 9:36 pm, tchendrix <[EMAIL PROTECTED]> wrote: > >> that looks like it's for an EAN code... how are you p

Re: Field type for 13 digit positive integer?

2008-09-02 Thread coan
On Sep 2, 9:36 pm, tchendrix <[EMAIL PROTECTED]> wrote: > that looks like it's for an EAN code... how are you planning on EAN14 > and EAN 15? I will take them on one digit at a time :-) First I have to solve my 13 digit problem. --~--~-~--~~~---~--~~ You received

Re: Field type for 13 digit positive integer?

2008-09-02 Thread tchendrix
that looks like it's for an EAN code... how are you planning on EAN14 and EAN 15? coan wrote: > If I want to store a positive integer like 9781590599969 and use mysql > - what field type can I choose in my model - if any? > > > --~--~-~--~~~---~--~~ You r

Field type for 13 digit positive integer?

2008-09-02 Thread coan
If I want to store a positive integer like 9781590599969 and use mysql - what field type can I choose in my model - if any? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group,

Re: granularpermissions app no longer creates dbtables

2008-09-02 Thread [EMAIL PROTECTED]
in granularpermission/__init__.py there is an import: line4: from models import Permission if I comment that import the dbtable is created, so I assume this is a django problem. On Sep 2, 8:30 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hi, > > I've been using granular permissions (h

granularpermissions app no longer creates dbtables

2008-09-02 Thread [EMAIL PROTECTED]
Hi, I've been using granular permissions (http://code.google.com/p/django- granular-permissions/) in one of my projects. Just updated django svn and it stoped creating the necessary dbtable. Is anyone using granular permissions that can help me. Thanks Luis --~--~-~--~~

Re: How is are Fields implemented?

2008-09-02 Thread Abdallah El Guindy
Thanks a lot for the help throughout... I finally managed to solve the problem :D Yes you are right, this is getting off-topic and I apologize for that... My questions end here! Thanks again On Tue, Sep 2, 2008 at 9:17 PM, bruno desthuilliers < [EMAIL PROTECTED]> wrote: > > On 2 sep, 13:50,

Re: How is are Fields implemented?

2008-09-02 Thread bruno desthuilliers
On 2 sep, 13:50, "Abdallah El Guindy" <[EMAIL PROTECTED]> wrote: > Hey Bruno, > > Thanks a lot! I read now 2 pages on metaclasses and I'm beginning to really > feel I'm figuring it out... If you only need to read 2 pages of doc to become proficient with metaclasses, then your way smarter than I a

Re: How is are Fields implemented?

2008-09-02 Thread bruno desthuilliers
On 2 sep, 20:46, "Abdallah El Guindy" <[EMAIL PROTECTED]> wrote: > Now that I understand a lot better, I am implementing a class that inherits > from type. IOW, a metaclass. > So now I would like to create the instance You mean the class ?-) > by writing: > > m = MyType(myClass.__name__, (),

Re: problem with passing dict object to django template

2008-09-02 Thread bruno desthuilliers
On 2 sep, 20:22, Matt Berg <[EMAIL PROTECTED]> wrote: > Sorry. > > Yes, in the template I do a loop... > > for crop in crops Where do "crops" come from ? In your above code, you only returned the ci dict, no t crops. > In the view, I make an array ci (cropinfo). It's actually a dict, not an arr

Re: problem with passing dict object to django template

2008-09-02 Thread bruno desthuilliers
On 2 sep, 19:34, Matt Berg <[EMAIL PROTECTED]> wrote: > Still new to django and python and have been struggling with the > following. > > Basically, I want to pass the following dict object to a django > template. > > def crop_info(season,crops): > ci = {} > cd = {} Since you rebind cd

Re: How is are Fields implemented?

2008-09-02 Thread Abdallah El Guindy
Now that I understand a lot better, I am implementing a class that inherits from type. So now I would like to create the instance by writing: m = MyType(myClass.__name__, (), myClass.__dict__) The problem is the fields in __dict__ are in arbitrary order, is there a way to get them in the order th

Re: getting max(field) with db-api

2008-09-02 Thread John M
i used that for mine and it always worked! Mine was for a list of child records by date, but child.objects.all()[0] always gave me the most recent object. J On Sep 2, 7:23 am, mwebs <[EMAIL PROTECTED]> wrote: > Hello, > > I want to perform a lookup an getting the object with the highest > integ

Re: name 'admin' is not defined

2008-09-02 Thread James Matthews
Also uncomment the admin.autodiscover() line. (If you are holding a svn version) On Tue, Sep 2, 2008 at 11:15 AM, Ronny Haryanto <[EMAIL PROTECTED]> wrote: > > On Wed, Sep 3, 2008 at 12:56 AM, Weber Sites <[EMAIL PROTECTED]> > wrote: > > I'm trying to follow the Tutorial02 and once i uncomment th

Re: problem with passing dict object to django template

2008-09-02 Thread Matt Berg
Sorry. Yes, in the template I do a loop... for crop in crops In the view, I make an array ci (cropinfo). Each ci I append a new dict object (cd) which is associated with the crop id. In the template, I just want to loop through the crops and then display items in the embedded dict that are ti

Re: name 'admin' is not defined

2008-09-02 Thread Ronny Haryanto
On Wed, Sep 3, 2008 at 12:56 AM, Weber Sites <[EMAIL PROTECTED]> wrote: > I'm trying to follow the Tutorial02 and once i uncomment the admin > lines in urls.py i get : > > ImproperlyConfigured at /mysite/ > Error while importing URLconf 'mysite.urls': name 'admin' is not defined This probably sou

Re: problem with passing dict object to django template

2008-09-02 Thread David Zhou
On Sep 2, 2008, at 1:34 PM, Matt Berg wrote: > In my template, I want to be able to iterate through the crops with > info like this: > > {{ ci.[crop.id].total }} Are you using this within another loop? Where's crop.id coming from? --- David Zhou [EMAIL PROTECTED] --~--~-~--~---

Re: Initial values in form fields

2008-09-02 Thread Daniel Roseman
On Sep 2, 6:10 pm, cArkraus <[EMAIL PROTECTED]> wrote: > Hey everyone, > > am pretty new to Django and Python in general. > I seem not be able to let the 'initial' value of a form-field be > calculated by its parent form. > > I'd like to do sth like this: > > class AbstractForm(forms.Form): >

Re: Random HTTP Error 500's - ImproperlyConfigured

2008-09-02 Thread James Matthews
Is it possible that some form of server security is stripping them out? On Tue, Sep 2, 2008 at 10:28 AM, cwurld <[EMAIL PROTECTED]> wrote: > > Hi, > > My site has recently starting generating a lot of HTTP Error 500's. > The traceback is always: > > ImproperlyConfigured: Error importing request p

name 'admin' is not defined

2008-09-02 Thread Weber Sites
Hi I'm trying to follow the Tutorial02 and once i uncomment the admin lines in urls.py i get : ImproperlyConfigured at /mysite/ Error while importing URLconf 'mysite.urls': name 'admin' is not defined berber --~--~-~--~~~---~--~~ You received this message becaus

Re: ModelForm, images and exclude

2008-09-02 Thread flynnguy
Ok, some experimentation has yielded that the problem lies here: def photoDir(self, filename): "Callable method used to set directory of media below" return os.path.join('pet_photos', str(self.pet.id), filename) Basically what seems to be happening is that it tries to save the file

Re: dispatch.fcgi as text

2008-09-02 Thread James Matthews
Also make sure to set the rewrite handle. On my shared host you need to enable fcgi then have the dispatch.fcgi in your web root. On Tue, Sep 2, 2008 at 8:31 AM, Milan Andric <[EMAIL PROTECTED]> wrote: > > On Mon, Sep 1, 2008 at 7:19 PM, Ronaldo Z. Afonso > <[EMAIL PROTECTED]> wrote: > > > > Hi e

problem with passing dict object to django template

2008-09-02 Thread Matt Berg
Still new to django and python and have been struggling with the following. Basically, I want to pass the following dict object to a django template. def crop_info(season,crops): ci = {} cd = {} dap_kg_dollar = 0 urea_kg_dollar = 0 seed_local_dollar = 0 seed_improved_doll

Random HTTP Error 500's - ImproperlyConfigured

2008-09-02 Thread cwurld
Hi, My site has recently starting generating a lot of HTTP Error 500's. The traceback is always: ImproperlyConfigured: Error importing request processor module xxx: "No module named yyy" where xxx and yyy are random modules. I know these modules are present and working correctly. Most of the ti

Initial values in form fields

2008-09-02 Thread cArkraus
Hey everyone, am pretty new to Django and Python in general. I seem not be able to let the 'initial' value of a form-field be calculated by its parent form. I'd like to do sth like this: class AbstractForm(forms.Form): some_attr = "foo" def some_method(self): if self.some_attr

Re: Problem with 404 page

2008-09-02 Thread marsii
Hi! > You are responsible for creating both 404.html and 500.html templates.  See: > http://docs.djangoproject.com/en/dev/topics/http/views/#customizing-e... > Karen Thanks! regards Markku --~--~-~--~~~---~--~~ You received this message because you are subscribe

Re: utf8 works on my dev server but not on my production server

2008-09-02 Thread n00m
>>> s = 'Rémi' >>> type(s) >>> s.decode('utf-8') Traceback (most recent call last): File "", line 1, in ? File "encodings/utf_8.py", line 16, in decode UnicodeDecodeError: 'utf8' codec can't decode bytes in position 1-3:

Re: define "_default_manager" and the admin-interface

2008-09-02 Thread Brett H
As far as I can see in principle you would want to leave the live manager first as your default manager and then override it in your admin class as the exception - something like this: class EntryAdmin(admin.ModelAdmin): ... manager = Entry.objects But admin needs patching to make that w

Re: ModelForm, images and exclude

2008-09-02 Thread flynnguy
I tried the id thing which didn't seem to work but then when I tried the null thing I think I found out what is going on. It looks like the callable save bit for the photo is not getting a pet id so it doesn't know where to save it. Of course this is just a guess and I have no proof... some more f

Re: ModelForm, images and exclude

2008-09-02 Thread Daniel Roseman
On Sep 2, 4:04 pm, flynnguy <[EMAIL PROTECTED]> wrote: > Found out what was causing the error but not why... > > It seems that when I tell my model to not exclude the "pet" field, > that everything works fine. (ie, I select a pet from the dropdown) > When I add it to the exclude list and try to se

DjangoCon/1.0 Release Party -- Need a Ride!

2008-09-02 Thread Derek Payton
Hey guys, For those of you going to DjangoCon... My boss and I are attending DjangoCon this weekend, and we're both super excited. Thing is, however, he's unable to attend the 1.0 release party, and I'd really like to go. Since I don't drive and he's my only ride, this leaves me with the task of

Re: S3 tutorial for File Storage Refactor?

2008-09-02 Thread shadfc
To fix the corrupt images error, add content.open() to the top of _save() on the S3Storage class (or at least before the chunks() or read() calls). This basically causes a seek(0) on content. I think perhaps some of the image validation reads part of the file and doesn't reset the pointer back t

Re: URL configuration with Django deployed in a subdirectory

2008-09-02 Thread bryanzera
I've figured it out. .htaccess above my subdirectory was trying to munge my URLs rather than letting Django take care of them. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this gro

Re: URL configuration with Django deployed in a subdirectory

2008-09-02 Thread bryanzera
> You don't say how you are deploying the site. mod_python/apache2 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubsc

day is out of range for month

2008-09-02 Thread Xiong Chiamiov
On a site of ours, we got a 500 on Aug 31 with the error: ImproperlyConfigured: Error while importing URLconf 'ee_website.urls': day is out of range for month from this line: announcements = {'queryset': Announcement.objects.filter(active=True,expire_date__gt=datetime.today()).order_by('- publi

Re: dispatch.fcgi as text

2008-09-02 Thread Milan Andric
On Mon, Sep 1, 2008 at 7:19 PM, Ronaldo Z. Afonso <[EMAIL PROTECTED]> wrote: > > Hi everybody, > > I'm running Django on a shared-hosting provider with Apache and I walked > through the documentation about FastCGI of the Django website but when I > try to access some page of my web site, instead o

Re: getting max(field) with db-api

2008-09-02 Thread mwebs
Oh thanks, I think I have overlooked it :-) On 2 Sep., 16:35, Jarek Zgoda <[EMAIL PROTECTED]> wrote: > Wiadomość napisana w dniu 2008-09-02, o godz. 16:23, przez mwebs: > > > > > > > Hello, > > > I want to perform a lookup an getting the object with the highest > > integer value. > > The Model l

Re: ModelForm, images and exclude

2008-09-02 Thread flynnguy
Found out what was causing the error but not why... It seems that when I tell my model to not exclude the "pet" field, that everything works fine. (ie, I select a pet from the dropdown) When I add it to the exclude list and try to set it manually I get an error. What seems to work is allowing th

Re: getting max(field) with db-api

2008-09-02 Thread Jarek Zgoda
Wiadomość napisana w dniu 2008-09-02, o godz. 16:23, przez mwebs: > > Hello, > > I want to perform a lookup an getting the object with the highest > integer value. > The Model looks something like this: > > MyModel: > name = > number = models.PositiveIntegerField() > > class Meta: > o

getting max(field) with db-api

2008-09-02 Thread mwebs
Hello, I want to perform a lookup an getting the object with the highest integer value. The Model looks something like this: MyModel: name = number = models.PositiveIntegerField() class Meta: ordering = [-number] So I figured out this: highest = MyModel.objects.all()[0] Is t

Re: Cannot get user profile working.

2008-09-02 Thread Alex
Thanks, worked perfectly. Not sure if it's just me and my lack of sleep or the docs aren't that clear on this item. I didn't see much regarding this on the Internet so there must not be scores of others making the same mistake. --~--~-~--~~~---~--~~ You received t

Rebuilding an application reusing the business logic

2008-09-02 Thread Dick Kniep
Hi list, This is my first post to this mailinglist, We have not used Django sofar, but we are considering Django to rewrite a big Python/wxPython application, reusing the businesslogic all written in Python. We have built our own connection the the database, which delivers a list of objects.

Re: ModelForm, images and exclude

2008-09-02 Thread TiNo
You could check with the pdb debugger where the error is returned, and maybe you can also see what field is causing the problem. On Tue, Sep 2, 2008 at 3:34 PM, flynnguy <[EMAIL PROTECTED]> wrote: > > Thanks for the tips, I did know about the get_object_or_404 and had > that there originally but

Re: ModelForm, images and exclude

2008-09-02 Thread flynnguy
Thanks for the tips, I did know about the get_object_or_404 and had that there originally but I wanted to rule things out and was hoping if the pet_id didn't exist, that would throw an error I'm used to seeing. Unfortunately that seems to not be the problem. I did make the changes regarding the Me

Re: User groups and permissions

2008-09-02 Thread caphun
In case anyone was wondering; I created a ticket in the Django bug tracker and _finally_ got a response from telenieko - thanks! quote: I'd guess this would either mean: * Field/Row level permissions, which are not (yet) implemented. * Provide more fine-grained permissions. So, it's no

Re: Using subclass of RequestContext in generic views?

2008-09-02 Thread Tim Chase
>> My subclassed RequestContext object plans to intercept the >> Context.__getitem__ call (wherein redaction will hopefully happen >> in my custom subclass), and thus needs to be the actual object, >> not just a dict-like object merged into the existing >> RequestContext object. > > Thinking

ImportError: Settings cannot be imported, because environment variable DJANGO_SETTINGS_MODULE is undefined.

2008-09-02 Thread Weber Sites
I'm using LAMP with Django 1.0 B2 and mod_python. going through http://www.djangobook.com/en/1.0/chapter20/ I get : ImportError: Settings cannot be imported, because environment variable DJANGO_SETTINGS_MODULE is undefined. in my apache2 httpd-vhosts.conf i have SetHandler

Re: (Solved) Re: Using full SQL LIKE matching in database operations

2008-09-02 Thread Djn
Right, I've managed to confuse myself at some point earlier and it shows. What I have wanted to use isn't "LIKE" but "SIMILAR TO". The actual, working, code looks similar to wordGenome.objects.extra(where=["word similar to %s"], params=[subword] ) Apologies for the noise. --~--~-~--~

Re: is_ajax and YUI uploader: works on MAC, but 403 on Windows

2008-09-02 Thread tom
Because of a known Flash bug, the Uploader running in Firefox in Windows does not send the correct cookies with the upload; instead of sending Firefox cookies, it sends Internet Explorer’s cookies for the respective domain. As a workaround, we suggest either using a cookieless upload method or app

Re: Using subclass of RequestContext in generic views?

2008-09-02 Thread Chris Emerson
Hi Tim, On Mon, Sep 01, 2008 at 10:04:36AM -0500, Tim Chase wrote: > My subclassed RequestContext object plans to intercept the > Context.__getitem__ call (wherein redaction will hopefully happen > in my custom subclass), and thus needs to be the actual object, > not just a dict-like object me

(Solved) Re: Using full SQL LIKE matching in database operations

2008-09-02 Thread Djn
On Sep 1, 7:13 pm, Djn <[EMAIL PROTECTED]> wrote: > I'm in the process of moving an existing app over to python and > Django, and ran into one snag I haven't been able to find any comments > on. > > Basically, I have objects that describe themselves as an SQL-style > pattern (they represent small

Handling 'unique'

2008-09-02 Thread David
Hi, when setting (for example) name = models.CharField('Name', max_length=50, unique = True) How does one go about handling the exception if a name is entered that already exists in the database? Thanks, David, --~--~-~--~~~---~--~~ You received this message bec

Re: Custom Comment Form - post_comment()

2008-09-02 Thread Hanne Moa
On Tue, Sep 2, 2008 at 12:29 PM, Thejaswi Puthraya <[EMAIL PROTECTED]> wrote: > For any general web-application, every user is expected to enter his > details like first name and last name so it's not a usual case to have > both of them empty. I have several projects written in Django up and runn

Re: How is are Fields implemented?

2008-09-02 Thread Abdallah El Guindy
Hey Bruno, Thanks a lot! I read now 2 pages on metaclasses and I'm beginning to really feel I'm figuring it out... I'll read a bit more and once I start implementation and if I have any problems I'll ask back... To anyone else curious about how the issue can be solved: the keyword is indeed "metc

Determine if model item is subclassed

2008-09-02 Thread gauteh
Hello Im trying to create a webpage that displays several types of posts on the front page, they all inherit from a basic Item class (say BasicItem). On the front page I query for BasicItem.objects.all() [0:20] and I want to pass them on to my template and let my template render each item based o

Re: formset issue

2008-09-02 Thread koenb
Something like this might work I think: attachment_formset = BookingAttachmentFormSet(prefix = "attachments") for form in attachment_formset.forms: form.fields['attachment'].queryset = Attachment.objects.filter(user=request.user) Koen On 2 sep, 13:05, patrickk <[EMAIL PROTECTED]> wrote: > h

Re: dumb question model-dictionary

2008-09-02 Thread bruno desthuilliers
On 2 sep, 10:18, "James Bennett" <[EMAIL PROTECTED]> wrote: > On Tue, Sep 2, 2008 at 2:30 AM, bruno desthuilliers > > <[EMAIL PROTECTED]> wrote: > > More seriously, it took me 2 minutes playing with a model object in > > the interactive shell to come up with what seems a working solution: > > Yeah

Re: formset issue

2008-09-02 Thread patrickk
hmm, if the data won´t be received twice this might be a solution. do you have any idea about the syntax? attachment_formset = BookingAttachmentFormSet(prefix="attachments") for form in attachment_formset: ??? how do I set initial_data here ??? thanks, patrick On Sep 1, 3:39 pm, koenb <[EMA

Re: How is are Fields implemented?

2008-09-02 Thread bruno desthuilliers
On 2 sep, 10:33, "Abdallah El Guindy" <[EMAIL PROTECTED]> wrote: > Thank you very much for your reply. It seems that you understood my question > really well, but the answer is not as simple as I expected... ORMs are not a "simple" topic. Nor are advanced Python OO features. > I am trying to > i

URLs Syntax Error

2008-09-02 Thread djandrow
Hi, I have the following URLs.py from django.conf.urls.defaults import * from akonline.views import current_datetime from django.views.generic import date_based from akonline.blog.models import Category, Entry archive_info = { "queryset" : Entry.objects.all(), "date_field" : "ent

Re: MySQL timediff and datetime.timedelta

2008-09-02 Thread Malcolm Tredinnick
On Tue, 2008-09-02 at 03:16 -0700, Jens Grivolla wrote: > Hi, > > I am getting weird results using django.db to do a "select > timediff(a,b)..." query from MySQL. The result is a datetime.datetime > object instead of a datetime.timedelta. When using MySQLdb directly, > it returns the expected

MySQL timediff and datetime.timedelta

2008-09-02 Thread Jens Grivolla
Hi, I am getting weird results using django.db to do a "select timediff(a,b)..." query from MySQL. The result is a datetime.datetime object instead of a datetime.timedelta. When using MySQLdb directly, it returns the expected timedelta object. The code is exactly identical in both cases other

doctest for multi-threaded apps

2008-09-02 Thread omat
Is it possible to test multi-threaded applications with doctests? I use the Timer module, which is inherited from Thread, to trigger a function after certain time, for example 1 second. When I run the test, and let the main thread sleep with time.sleep(), to give time for the triggered function

  1   2   >