Filtering a query based on potential arguments

2008-06-11 Thread truebosko
I have a card store and I would like to add 3 options a user can search by. Year, Brand, and Card Title Normally this would be easy but my dilemna here is: - All of these are optional, and if they do not search for a certain one, the query should ignore that filter entirely and display in full (S

Re: foreign key and verbose name?

2008-06-11 Thread Peter of the Norse
On Jun 9, 2008, at 10:10 AM, pihentagy wrote: > > Hi all! > > In the docs here: > http://www.djangoproject.com/documentation/model-api/#verbose-field-names > > Each field type, except for ForeignKey, ManyToManyField and > OneToOneField, takes an optional first positional argument — a verbose > nam

Re: Syncdb error

2008-06-11 Thread Karen Tracey
On Wed, Jun 11, 2008 at 10:11 PM, JV <[EMAIL PROTECTED]> wrote: > > Hello group. > When I try to run the command syncdb I'm getting the following > error. I'm using python 2.4, the last Django repository core (in > particular revision 7618). > I got this error using MySQL and PostgreSQL, the wei

Syncdb error

2008-06-11 Thread JV
Hello group. When I try to run the command syncdb I'm getting the following error. I'm using python 2.4, the last Django repository core (in particular revision 7618). I got this error using MySQL and PostgreSQL, the weird thing is that the same code base is working in Windows. /work/Django/pr

Re: Donate to Django

2008-06-11 Thread Gene Campbell
I, too, intend to donate (money, and hopefully time) as soon as I can. On Thu, Jun 12, 2008 at 5:51 AM, RKnobelspies <[EMAIL PROTECTED]> wrote: > > Well, Djangoproject is in progress of establishing a foundation and > after the paperwork is done (maybe it´s done already), you should > probably b

Re: reloading models in the shell

2008-06-11 Thread Gene Campbell
Oops. "For the changes to take effect, exit out of the Python shell and enter it again with python manage.py shell. (This is the simplest way to make code changes take effect.)" >From http://www.djangobook.com/en/1.0/chapter05/ On Thu, Jun 12, 2008 at 1:01 PM, Gene Campbell <[EMAIL PROTECTED]>

reloading models in the shell

2008-06-11 Thread Gene Campbell
I'm very new to Python and Django, I'm going through building some models for the first time. When I load the models in my shell like this python manage.py shell >>> from app.models import ModelClass then make a change to the ModelClass in models.py Now when back in the shell how do I reload th

Re: Django and Fliqz

2008-06-11 Thread Peter Herndon
Hi Julie, Unfortunately, I have only the briefest of acquaintances with SOAP and the Python modules for working with it. I don't know where their lists are hosted. About all I do know is that ZSI stands for Zolera SOAP I-something (infrastructure, perhaps?). If you search Google for "Zolera SO

Re: Can I loop over attributes in model.attribute?

2008-06-11 Thread Johannes Dollinger
You are looking for setattr(): http://docs.python.org/lib/built-in- funcs.html#l2h-66 for attr in ('groupon', 'companyon', 'addressfirst', 'extendnames', 'clubfieldson'): setattr(settings, attr, attr in data) Am 12.06.2008 um 00:48 schrieb Wim Feijen: > > Thanks Russell! > > I suppose

Re: Can I loop over attributes in model.attribute?

2008-06-11 Thread Wim Feijen
Thanks Russell! I suppose the code I want to get looks like: settings = Settings.objects.get(owner=userid) for switchable in ['groupon', 'companyon', 'addressfirst', 'extendnames', 'clubfieldson']: if switchable in data: settings._meta.get_field(switchable). = True else: s

Re: sessions, Internet Explorer cookies and domain forwarding

2008-06-11 Thread Wim Feijen
Many thanks Peter for your help in identifying the problem! After making an upgrade in my domainhosting package I can use DNS and now I am okay: setting the cookie works. Yes! I am a very happy person now, thanks again! Wim On Jun 5, 5:27 pm, Peter Rowell <[EMAIL PROTECTED]> wrote: > Sigh, bra

Re: best solution for different address formats?

2008-06-11 Thread Rajesh Dhawan
Hi, Do you need to do anything special with the fields of these addresses? For example, locate users by their city and country? In other words, do you need the various components of an address (street, locality, postal code) to be captured as separate DB fields for your application to work? If t

Re: best solution for different address formats?

2008-06-11 Thread Norman Harman
[EMAIL PROTECTED] wrote: > Hello Django-Community, > > currently I'm working on a project where I need to save the user's > postal address. The problem is that the users come from different > parts of the world and postal addresses are formatted differently in > the U.S. or in Austria. > > Does

Re: Help for strategy to load dynamic content by domain (not subdomains)

2008-06-11 Thread ge
Thanks, this seems to work well! On Jun 10, 11:14 pm, "Ronny Haryanto" <[EMAIL PROTECTED]> wrote: > On Wed, Jun 11, 2008 at 10:00 AM, ge <[EMAIL PROTECTED]> wrote: > > I have what I hope is a simple question here.  I do have a working > > solution, but I'd like to know if anyone has any thoughts

Re: Possibly very dumb questions about accessing object in template.

2008-06-11 Thread [EMAIL PROTECTED]
On Jun 11, 1:43 pm, Daniel Roseman <[EMAIL PROTECTED]> wrote: > It might help to answer this question if you show us the actual view > and models that are producing this dictionary. I'm building the dict in the view like this: itemx = {} mtypes = MerchandiseType.

best solution for different address formats?

2008-06-11 Thread [EMAIL PROTECTED]
Hello Django-Community, currently I'm working on a project where I need to save the user's postal address. The problem is that the users come from different parts of the world and postal addresses are formatted differently in the U.S. or in Austria. Does anybody of you already have a suggestion

Re: Possibly very dumb questions about accessing object in template.

2008-06-11 Thread Daniel Roseman
On Jun 11, 7:03 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > This is what I'm sending to the template: > > {: [], issue collection>: [], collection>: [, , > ], : [, > , ], Panels>: [], stickers>: [], Banner>: [], collection>: [], Plate Frame>: []} > > if I call that items, then say

Re: Question about searching multiple fields

2008-06-11 Thread Adam
I was actually thinking to myself "There must be some way to auto- populate a full_name field when I create the object." but I didn't think to override the save method. Shows you how much I still need to learn; thanks for the tip! -Adam > The SimplestThinkThatCouldPossiblyWork (while certainly

Re: Painfully slow... why?

2008-06-11 Thread [EMAIL PROTECTED]
On Jun 10, 7:58 am, "James Bennett" <[EMAIL PROTECTED]> wrote: > That'll do it (and IIRC it's covered in the deployment docs). Could be. I was relying on Webfaction's default install, which does not set it to Off. --~--~-~--~~~---~--~~ You received this message b

Re: Newbie FileField/ImageField Problems

2008-06-11 Thread Aaron Fay
Hi Brian, Something like this should work for you: if form.is_valid(): photo = Photo() photo.save_source_file(form.cleaned_data['source'].filename, form.cleaned_data['source'].content) # redirect/etc Hth, Aaron brianmac wrote: > For the life of me I can't get django to upload a fi

Possibly very dumb questions about accessing object in template.

2008-06-11 Thread [EMAIL PROTECTED]
This is what I'm sending to the template: {: [], : [], : [, , ], : [, , ], : [], : [], : [], : [], : []} if I call that items, then say for foo in items, of course I get the MerchadiseType.. no problem there. But no matter what I try, I can't seem to get the related list. I just know this is so

Newbie FileField/ImageField Problems

2008-06-11 Thread brianmac
For the life of me I can't get django to upload a file. I have all of the settings correct, PIL installed and correct enctype. My model is as follows: class Photo(models.Model): source = models.ImageField(upload_to='images') Then in my view I try: Photo(request.FILES).save # I receive and

Re: Question about searching multiple fields

2008-06-11 Thread bruno desthuilliers
On 11 juin, 16:41, Adam <[EMAIL PROTECTED]> wrote: > I'm new to Django, and as a learning exercise I've been putting > together a simple contact database. There are separate fields for > first_name and last_name, and another field for the company name > called ac_name > > In the template for the

Re: Donate to Django

2008-06-11 Thread RKnobelspies
Well, Djangoproject is in progress of establishing a foundation and after the paperwork is done (maybe it´s done already), you should probably be able to contribute money "the official way". Until then I´m aware of one wishlist by Malcolm Tredinnick, who deserves our greatest appreciation for his

Donate to Django

2008-06-11 Thread Michael Trythall
I've been working with Django a lot lately and while I can't contribute to the code base until my project is done, I can contribute money. Is there a way to send money to Django developers to help with development costs, staff, etc? Do the developers have any wish lists I can look through? Maybe a

AttributeError getting cached SortedDict using database cache

2008-06-11 Thread John Huddleston
Preface: I'm not sure if this is a bug or not, but I could not find any mention of it in the tickets or the mailing lists. Problem: Using database caching, I set a non-empty SortedDict instance in the cache. When I try to retrieve it, I get an AttributeError with the message "'SortedDict' objec

Re: Form Validation

2008-06-11 Thread Adi
Thanks, I will make that change so that the database integrity is maintained. But I also want to do this on the form level. I can do this outside the form in the view but i think that might be inelegant. I will have to create the validation errors by hand and put it in the error_messages for the

Re: Form Validation

2008-06-11 Thread Nathaniel Whiteinge
On Jun 10, 9:42 pm, Adi <[EMAIL PROTECTED]> wrote: > The application flow works like this: You create a Relation object > within the context of an Owner Object. There is a rule that says that > a owner cannot have two Relation with the same pet value. How can I > create a validation on the form th

Re: Can't convert UTC time :(

2008-06-11 Thread Darthmahon
Tried out both pytz and dateutil. I like aspects of both, although dateutil seems to account for British Summer Time which is ideal :) Anyway, thanks for all your help I think I am on the right track now :) On Jun 11, 12:41 pm, "Horst Gutmann" <[EMAIL PROTECTED]> wrote: > Pfu, no idea. This is t

Re: serving root from static

2008-06-11 Thread Andre Meyer
oh yes, this is it! great stuff! thanks a lot André On Wed, Jun 11, 2008 at 9:46 AM, Daniel Hepper <[EMAIL PROTECTED]> wrote: > > > (r'^$', 'django.views.static.serve', {'document_root': > '/path/to/static','path':'index.html'}), > --~--~-~--~~~---~--~~ You recei

Re: Django and Fliqz

2008-06-11 Thread AestheticMindStudios
Hi Peter, Thanks for your input - are the mailing lists for the various SOAP libraries also in googlegroups? Best, Julie On Jun 11, 7:56 am, "Peter Herndon" <[EMAIL PROTECTED]> wrote: > Hi Julie, > > Django doesn't speak SOAP out of the box. You could use one of the > Python SOAP libraries tha

Question about searching multiple fields

2008-06-11 Thread Adam
I'm new to Django, and as a learning exercise I've been putting together a simple contact database. There are separate fields for first_name and last_name, and another field for the company name called ac_name In the template for the main page I put a form that allows searching by name or compan

Re: FileField not working, however ImageField is.

2008-06-11 Thread Rodrigo Culagovski
Nope, just disabled the validator and moved on to other projects. Non-ideal, but hey, that's what we get from using a pre 1.0 framework, I guess. Rodrigo On Jun 10, 4:38 pm, diggs <[EMAIL PROTECTED]> wrote: > Did you ever figure out what the problem was? I'm having the exact > same issue. Using

Re: Form Validation

2008-06-11 Thread Richard Dahl
Just an idea, not sure if it will work for you as I don't know a whole lot about how it works, but wouldn't setting unique_together on the Relation class for owner and pet accomplish what you want? The validation happens at the DB level, but I believe it propogates back to the form. hth, -richard

Re: Testing framework or model save behaves differently after qsrf merge?

2008-06-11 Thread peschler
Hi Russ, thanks for your answer. I will open a ticket and attach the test case. regards, peschler On 10 Jun., 15:45, "Russell Keith-Magee" <[EMAIL PROTECTED]> wrote: > On Tue, Jun 10, 2008 at 6:53 AM, peschler <[EMAIL PROTECTED]> wrote: > > > I'm currently facing a weird problem with the testin

Re: Total newbie question

2008-06-11 Thread Pedro Cora
Thank you all! This weekend I'll start following everything that you guys recommended. :) On Jun 10, 5:10 pm, cjl <[EMAIL PROTECTED]> wrote: > Pedro: > > If you have about 40 minutes to kill, you can check out my tutorial: > > http://www.instantdjango.com > > It is written for absolute beginners

Re: ifequal tag in template with hard coded string confusion

2008-06-11 Thread John Teague
Thank you very much Karen - You clearly defined that problem for me and that fixed the issue. For others who might run into the same problem, they would do well to remember to add either __str__ or __uinicode__ as the case warrant:s: {% ifequal foo.bar__str__ "foobar" %} or {% ifequal foo.bar_

Untruncating a comment

2008-06-11 Thread nandu
Dear All, I would just like to know if there is anyway to get the untruncated version of a truncated comment without accessing the database. I hope someone can enlighten me. Thanks Nandu 11 Jun 08 --~--~-~--~~~---~--~~ You received this message because you are su

Re: Django and Fliqz

2008-06-11 Thread Peter Herndon
Hi Julie, Django doesn't speak SOAP out of the box. You could use one of the Python SOAP libraries that are out there (ZSI comes to mind) to build your own, though. And perhaps someone has already built such an interface to Fliqz, but if so, you'd perhaps be better off asking on the mailing lis

Re: Can't convert UTC time :(

2008-06-11 Thread Horst Gutmann
Pfu, no idea. This is the first time I've heard of pytz, to be honest :-) But I'd assume that whenever you create a new datetime object with a given timezone, it should consider the DST setting. Haven't tried it though on any library. -- Horst On Wed, Jun 11, 2008 at 11:03 AM, Darthmahon <[EMAIL

Re: Basic Blog and Newforms-Admin

2008-06-11 Thread Russell Keith-Magee
On Wed, Jun 11, 2008 at 5:02 PM, Alfonso <[EMAIL PROTECTED]> wrote: > > Error while importing URLconf 'myapp.basic.blog.urls': The model Post > is already registered > > Occurs on any page whenever basic.blog.urls urlconf is involved. Any > suggestions would be appreciated! You're just discoverd

Re: Custom validationrules for newforms?

2008-06-11 Thread mwebs
:-), I swear I went trough the documentation, but I didnt find this point. Thank you! Rishabh Manocha schrieb: > http://www.djangoproject.com/documentation/newforms/#custom-form-and-field-validationis > probably what you're looking for. > > Best, > > Rishabh > > On Wed, Jun 11, 2008 at 3:20 PM,

Re: Custom validationrules for newforms?

2008-06-11 Thread Rishabh Manocha
http://www.djangoproject.com/documentation/newforms/#custom-form-and-field-validationis probably what you're looking for. Best, Rishabh On Wed, Jun 11, 2008 at 3:20 PM, mwebs <[EMAIL PROTECTED]> wrote: > > I want to add a custom validation rule for a newforms form. > I could not figure out how

Custom validationrules for newforms?

2008-06-11 Thread mwebs
I want to add a custom validation rule for a newforms form. I could not figure out how to do this. Can someone give me an advice how to do this. thanks, toni --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django use

Re: Choose the fields for inline editing

2008-06-11 Thread Gonzalo Delgado
El Mon, 9 Jun 2008 17:19:23 -0700 (PDT) Cliff <[EMAIL PROTECTED]> escribió: > > Hi, > I really like the inline editing option, but found that sometimes I > don't want to list all the attributes of an object for inline editing. > I guess there is a way to do this, but I cannot find it. Really > ap

Add filters to the Users List/Page in the admin app

2008-06-11 Thread Rishabh Manocha
Hey all, I'm using django's in-built authentication mechanism for my app. Several of my models are of the form: class UserTechSkill(models.Model): user = models.ForeignKey(User,edit_inline = models.TABULAR) skill = models.ForeignKey(TechSkillsList,core=True) prof_level = models.Foreig

Re: Can't convert UTC time :(

2008-06-11 Thread Darthmahon
Ahhh ok, does this handle daylight saving for you automatically do you know? Overall looks pretty useful, but I wonder how this differs to pytz: http://pytz.sourceforge.net/ Do they do the same thing? Just different implementations? Thanks for your help so far though :) On Jun 11, 8:59 am, "H

Basic Blog and Newforms-Admin

2008-06-11 Thread Alfonso
Hi Guys, Just installed newforms-admin into my django app and having a strange issue with basic-blog app: Error while importing URLconf 'myapp.basic.blog.urls': The model Post is already registered Occurs on any page whenever basic.blog.urls urlconf is involved. Any suggestions would be apprec

Re: truncate in mysql database

2008-06-11 Thread Peter Melvyn
On 6/11/08, Frédéric Degraeve <[EMAIL PROTECTED]> wrote: > I use often 'delete' on my tables. I would like to reset everytime the > auto_increment field. Is it possible to use 'truncate' with django > orm? AFAIK not. But you can run custom SQL http://www.djangoproject.com/documentation/model-

truncate in mysql database

2008-06-11 Thread Frédéric Degraeve
Hello, I use often 'delete' on my tables. I would like to reset everytime the auto_increment field. Is it possible to use 'truncate' with django orm? Thank you Frédéric --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Group

Re: Can't convert UTC time :(

2008-06-11 Thread Horst Gutmann
Ah ok, sorry, I misunderstood what you're trying to achieve :-) from dateutil.tz import gettz import datetime now = datetime.datetime.now(tz=gettz('UTC')) >> datetime.datetime(2008, 6, 11, 7, 57, 36, 812305, >> tzinfo=tzfile('/usr/share/zoneinfo/UTC')) london_time = gettz('Europe/London') >>>

Re: serving root from static

2008-06-11 Thread Daniel Hepper
> (r'^$', 'django.views.static.serve', {'document_root': '/path/to/static'}), I would not expect that to work, something like this might do the trick: (r'^$', 'django.views.static.serve', {'document_root': '/path/to/static','path':'index.html'}), I can't test that right now, ymmv. Daniel --~--

Re: Can't convert UTC time :(

2008-06-11 Thread Darthmahon
Hmm kinda. Basically, users on my site can select their timezone. As there are events on the site, I want the time of these events to be displayed based on their timezone. I.E. if an event is at 10PM GMT, a user in New York should see it as 5PM EST. I could do this as a template tag, but I want t

Re: Question about the encoding of filename

2008-06-11 Thread PENPEN
Thanks Karen, The codec should be utf8 not the server's locale. Now I'm using the urlquote to quote the non-ascii characters as it is not too important. Hoping ticket 5361 solving this problem soon. :) On 6月11日, 上午1时19分, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > 2008/6/10 PENPEN <[EMAIL PROTECT