Templating patterns

2008-05-01 Thread [EMAIL PROTECTED]
I've got a lot of templates with the same pattern, so i want to put some code like this in a template. {% if iterable %} {% for variable in iterable %} <{{tag}}> something {% endfor %} Is it posible to send the {{tag}} variable as a parameter from another template (where i use the

ModelForm and required fields

2008-05-01 Thread zmalloc
ModelForm currently does not provide anything like class="required" on rendered forms where fields are required. This has led me to create the fields manually in the form and add the style attribute to the widget. Doing this, I then lose help_text definitions created in the model. So I can

Re: django-tagging or search engine?

2008-05-01 Thread [EMAIL PROTECTED]
On 2 май, 05:40, Eric <[EMAIL PROTECTED]> wrote: > The beauty for using a search engine is you can do tag unions as easy > as tag:python OR tag:django > > or a tag intercection as: > tag:python AND tag:django > > and you can do: > tag:python AND tag:django AND tag:database > > with a sql

Re: Stability of using SVN versus 0.96 or 0.96.1

2008-05-01 Thread Jeff Anderson
blis102 wrote: Hello All! I am currently working on a CMS using Django and I am ready to make a switch to the SVN version because of the new features, bug fixes, and increased performance but the developer I am working with is unsure of the usefulness/safety of changing to SVN. We are at a

Re: Access Control List

2008-05-01 Thread Richard Dahl
The documentation says that it is not provided by the auth system and not built into the admin, but it may be possible. One thing you should try is to build a custom manager for your model and use threadlocals (search the archives for this) to enable this. Something like: class

Re: django-tagging or search engine?

2008-05-01 Thread Eric
I was experimenting with that very thing just now. Doing tagging in a sql database can get pretty expensive quick. I was experimenting with pysolr and solr. Solr is a enterprise search engine server . Solr is a little more work than to get set up than us pythonistas are used to, but it's

Re: Access Control List

2008-05-01 Thread Ronny Haryanto
On Fri, May 2, 2008 at 10:04 AM, Rit Lim <[EMAIL PROTECTED]> wrote: > "Mary may change news stories, but only the ones she created > herself..." > > How do I go about doing that? I was told I need to write an ACL. > However, I'm not sure how to do it. > > Anyone has some sample code? The

Access Control List

2008-05-01 Thread Rit Lim
“Mary may change news stories, but only the ones she created herself..." How do I go about doing that? I was told I need to write an ACL. However, I'm not sure how to do it. Anyone has some sample code? Thanks, --~--~-~--~~~---~--~~ You received this message

Re: Django and Services

2008-05-01 Thread Russell Keith-Magee
On Fri, May 2, 2008 at 6:07 AM, Michael Burton <[EMAIL PROTECTED]> wrote: > > I'm coming to Django from the Java Spring MVC world, and over in those > remote lands we have something called a "Service" layer. > > The service layer is responsible for doing all the business logic that > your

Re: Django and Services

2008-05-01 Thread Michael Elsdörfer
> So I guess I'm just curious to hear how other members of the > community have solved this. Are people slipping business logic into > the model classes for the most part? If what I need to write doesn't really fit in any of the common "places" (models, managers, views, middleware etc.), then I

Re: Should I set up Django locally or on a web server?

2008-05-01 Thread selmac
I didn't realize I could use an SQLite that was already installed. I have python 2.5.1 on my IMac. I've gone as far through the tutorial and already installed Django and run some of the code in the first few chapters, I was just getting stuck with how to interface with the database. Is there

Re: urls() and request.user

2008-05-01 Thread Nathaniel Whiteinge
On May 1, 10:04 am, "Guillaume Lederrey" <[EMAIL PROTECTED]> wrote: > This of course doesnt work because the request isnt in the scope. I > could redefine a view in my views.py and do the work on the request > manually, but i have a feeling there is a solution to do that directly > in my urls.py.

Re: Looking at objects by year, month

2008-05-01 Thread Ryan Vanasse
Is events in: for event in Event.objects.order_by('start_DateTime'): events[event.start_DateTime.month]['events'].append(event) supposed to be months? (looks like months[event.start_DateTime.month] ['events'].append(event) I get a NameError if I leave it as is. when I switch to

single feed for multiple models

2008-05-01 Thread Jonathan Lukens
I have found myself in a situation where I need one RSS feed for two models that are related by a FK to the same model, something like Member.foo_set.all() and Member.bar_set.all(). How would I go about doing this? It doesn't seem possible to use the syndication framework in this case.

Re: Announcing django-compress

2008-05-01 Thread hiwd
this sounds awesome. i'll take a look, and implement, and try to push some code to prod next week (if things are hunky dory) On May 1, 9:57 am, [EMAIL PROTECTED] wrote: > Hi > > I recently put up django-compress on Google > Code:http://code.google.com/p/django-compress/ > > django-compress

Re: Memcached hangs & never responds?

2008-05-01 Thread Karen Tracey
On Thu, May 1, 2008 at 6:51 PM, Gregor Hochmuth <[EMAIL PROTECTED]> wrote: > > Hello, > Has anyone experienced the following symptom with Memcached before? > > Intermittently and unpredictably, requests to our production web > server will start "hanging" in the "Waiting for response..." loop and

Re: Should I set up Django locally or on a web server?

2008-05-01 Thread Adam Seering
If you really want everything, then either MacPorts or Fink work well. If you just want to run through the tutorial, though, you can probably get away with the built-in version of Python and SQLite as suggested. Older Macs have Python 2.3, which should work (though it is quite old); Leopard

Re: Django and Services

2008-05-01 Thread Michael Burton
Thanks for the response, Alex. That's certainly possible in some cases. But it seems like there are at least a few situations where you wouldn't want to or are unable to put these methods into the model: For example, maybe this model is not under your control. Perhaps it's in a different app,

Re: ManyToMany error with new queryset refactoring

2008-05-01 Thread Karen Tracey
On Thu, May 1, 2008 at 5:13 PM, bcurtu <[EMAIL PROTECTED]> wrote: > > Thanks, > > Attributes is just a simple abstract class with some fields. Nothing > special. > See, though, I could not recreate any error with a nothing-special abstract base class named Attributes that I made up myself.

Re: Should I set up Django locally or on a web server?

2008-05-01 Thread [EMAIL PROTECTED]
Probably the most painless way to get everything you need for the production setup is via MacPorts - apache, python, postgres, etc. On May 1, 2:56 pm, Kevin Monceaux <[EMAIL PROTECTED]> wrote: > Selmac?, > > I've never used a Mac, so take the following with a grain of salt. > > On Thu, 1 May

Re: Best way to extend an existing django app

2008-05-01 Thread joasch
On May 2, 12:01 am, Scott SA <[EMAIL PROTECTED]> wrote: > On 5/1/08, joasch ([EMAIL PROTECTED]) wrote: > > I've been reading about newforms here > but have yet to put it > into action. That will change any day now - I appreciate your

Memcached hangs & never responds?

2008-05-01 Thread Gregor Hochmuth
Hello, Has anyone experienced the following symptom with Memcached before? Intermittently and unpredictably, requests to our production web server will start "hanging" in the "Waiting for response..." loop and never get any further. When we restart memcached on the server, the request executes

django-tagging or search engine?

2008-05-01 Thread francesco
Hi, I'd like to have an opinion regarding two possible ways to go on the implementation of a set of features for my application. I'm developing a website where there are a set of products each of which should come with a description and a set of tags. A fundamental feature of such website is to

Re: Custom Authentication System

2008-05-01 Thread jonknee
> Can anyone refer a nice tutorial or explain how to create custom > user attributes and use the authentication/authorization app? It would be just like a regular user registration form, only with more fields. In the view you would create the account using the data that belongs to Auth and after

Re: Custom Authentication System

2008-05-01 Thread jonknee
> Can anyone refer a nice tutorial or explain how to create custom > user attributes and use the authentication/authorization app? It would be just like a regular user registration form, only with more fields. In the controller you would create the account using the data that belongs to Auth and

Re: Django and Services

2008-05-01 Thread [EMAIL PROTECTED]
You actually would place the on the model, for example you might have a send_email method on an invitation model, to abstract the template, simply make it a parameter to the function. On May 1, 5:07 pm, Michael Burton <[EMAIL PROTECTED]> wrote: > I'm coming to Django from the Java Spring MVC

Django and Services

2008-05-01 Thread Michael Burton
I'm coming to Django from the Java Spring MVC world, and over in those remote lands we have something called a "Service" layer. The service layer is responsible for doing all the business logic that your views might otherwise do. For example, you might have something like: class

Re: Best way to extend an existing django app

2008-05-01 Thread Scott SA
On 5/1/08, joasch ([EMAIL PROTECTED]) wrote: >this is what I have done. I checked out satchmo trunk and keep it >updated. After checkout I exported it to a new copy and check it in on >my own SVN, and there I make my changes. When ever there is a change >in satchmo trunk I merge these changes

Re: Image Field problem, probably something to do with the path, but I'm not sure

2008-05-01 Thread mw
Bumping the thread. Still having the problem. Pil is installed and everything since I know it worked before. Any ideas? Thanks, mw On Apr 28, 3:57 pm, mw <[EMAIL PROTECTED]> wrote: > Hello, > > I created a small little application that included a field for an > image upload in the admin

Re: OS X install help --I think I broke something...

2008-05-01 Thread mw
Yeah overall I ended up just blowing away the entire SVN and the symlinks and restarting. I don't know what went wrong, but I was able to get things working from the documentation on the second time around. No idea if I typoed something or if there was something else like that other people have

Re: ManyToMany error with new queryset refactoring

2008-05-01 Thread bcurtu
Thanks, Attributes is just a simple abstract class with some fields. Nothing special. I don't think is has to do with "related_name", or maybe I don't know how to use it... friends=models.ManyToManyField("self",symmetrical=False,related_name="friend") On 1 mayo, 22:23, Rajesh Dhawan

Re: feed api : why have templates t specify item and description fields

2008-05-01 Thread Rajesh Dhawan
> > On #1, there is already similar information in the class (such as the > overall feed description, url, etc... Yes, but most of that counts as "metadata" for the feed whereas the title and description are meant directly for end user consumption.

Re: queryset-refactor: ordering by foreign key with null values

2008-05-01 Thread hotani
I changed the query from an "inner join" to "left outer join" which returned issues with null resolutions. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: feed api : why have templates t specify item and description fields

2008-05-01 Thread Mike Chambers
Thanks. On #1, there is already similar information in the class (such as the overall feed description, url, etc... #2 makes sense though. mike chambers Rajesh Dhawan wrote: > On May 1, 2:11 pm, Mike Chambers <[EMAIL PROTECTED]> wrote: >> I am using the feed api, and it works well.

Re: Best way to extend an existing django app

2008-05-01 Thread joasch
Scott, this is what I have done. I checked out satchmo trunk and keep it updated. After checkout I exported it to a new copy and check it in on my own SVN, and there I make my changes. When ever there is a change in satchmo trunk I merge these changes into my own copy. It's a bit of extra work

Re: feed api : why have templates t specify item and description fields

2008-05-01 Thread Rajesh Dhawan
On May 1, 2:11 pm, Mike Chambers <[EMAIL PROTECTED]> wrote: > I am using the feed api, and it works well. However, i was curious why > the title and description fields are specified via templates, and not > just as a property of the feed class? Two reasons that I can think of: 1. The title and

queryset-refactor: ordering by foreign key with null values

2008-05-01 Thread hotani
In a helpdesk app, I have a model called 'issue' which has a foreign key called 'resolution'. The 'resolution' model allows null values - if an issue is open, 'resolution' will be null, if closed, there will be a value there. Before queryset-refactor, I could do the following and get results

Custom Authentication System

2008-05-01 Thread Abdallah El Guindy
Hey all, I am trying to create a login/profile system for my application... I have read the section in the django book explaining how to add profile (other attributes) to User object by using another model that refers to the User object... However, I cannot get a decent registration form... The

Re: multiple children in multitable inheritance

2008-05-01 Thread AmanKow
I've been trying to keep away from the idea of using MTI (multitable inheritance) for my Person->Student|Faculty|Manager needs, but damn! The sugar is just too sweet! I understand the objection to wanting the inheritance to look as much like python as possible, but I'm not sure it applies here.

Re: ManyToMany error with new queryset refactoring

2008-05-01 Thread Rajesh Dhawan
On May 1, 3:04 pm, bcurtu <[EMAIL PROTECTED]> wrote: > Hi, > > I've just checked out the trunk with new queryset-ref changes! I'm > suffering the next problem. In my model I have a ManyToMany > relationship: > >     class Person(Attributes): >        

Re: ManyToMany error with new queryset refactoring

2008-05-01 Thread [EMAIL PROTECTED]
I believe you need to specify a related name argument: http://www.djangoproject.com/documentation/model-api/#be-careful-with-related-name On May 1, 3:18 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > On Thu, May 1, 2008 at 3:04 PM, bcurtu <[EMAIL PROTECTED]> wrote: > > > Hi, > > > I've just

Re: ManyToMany error with new queryset refactoring

2008-05-01 Thread Karen Tracey
On Thu, May 1, 2008 at 3:04 PM, bcurtu <[EMAIL PROTECTED]> wrote: > > Hi, > > I've just checked out the trunk with new queryset-ref changes! I'm > suffering the next problem. In my model I have a ManyToMany > relationship: > >class Person(Attributes): >

Re: Stability of using SVN versus 0.96 or 0.96.1

2008-05-01 Thread Rajesh Dhawan
Hi, > > I am currently working on a CMS using Django and I am ready to make a > switch to the SVN version because of the new features, bug fixes, and > increased performance but the developer I am working with is unsure of > the usefulness/safety of changing to SVN. We are at a stage in the >

A couple questions about generated queries

2008-05-01 Thread David
I've been looking at our PostgreSQL logs, trying to track down a slowness issue, and I've got two questions. 1. Do queries that are created by the API use bind parameters? When I look in the logs I see the full text of the query and it includes the actual parameter. Perhaps that's simply just

Re: Stability of using SVN versus 0.96 or 0.96.1

2008-05-01 Thread [EMAIL PROTECTED]
I would say that SVN is at least as stable as .96.1 (maybe even more since so many bugs have been fixed). As long as you pay attention to the backwards incompatible changes before svn'ing up, you should be fine(or better, what with qs-rf, modelforms...). On May 1, 2:36 pm, blis102 <[EMAIL

Re: Stability of using SVN versus 0.96 or 0.96.1

2008-05-01 Thread blis102
Im not really concerned with being bleeding edge but more of taking advantage of the new features, documentation, and performance/ bugfixes. I agree that being bleeding edge often ends up being a chase to find where the bugs are coming from, but from what Ive read Django does a really great job

Re: Stability of using SVN versus 0.96 or 0.96.1

2008-05-01 Thread Michael Wieher
I never use bleeding edge software, I let someone else be that level of bug-testing/beta-testing support. On Thu, May 1, 2008 at 2:01 PM, blis102 <[EMAIL PROTECTED]> wrote: > > Hello All! > > I am currently working on a CMS using Django and I am ready to make a > switch to the SVN version

ManyToMany error with new queryset refactoring

2008-05-01 Thread bcurtu
Hi, I've just checked out the trunk with new queryset-ref changes! I'm suffering the next problem. In my model I have a ManyToMany relationship: class Person(Attributes): friends=models.ManyToManyField("self",symmetrical=False) When I do a manage.py syncdb, i get the following

Stability of using SVN versus 0.96 or 0.96.1

2008-05-01 Thread blis102
Hello All! I am currently working on a CMS using Django and I am ready to make a switch to the SVN version because of the new features, bug fixes, and increased performance but the developer I am working with is unsure of the usefulness/safety of changing to SVN. We are at a stage in the project

Re: Should I set up Django locally or on a web server?

2008-05-01 Thread Kevin Monceaux
Selmac?, I've never used a Mac, so take the following with a grain of salt. On Thu, 1 May 2008, selmac wrote: > I know the makers of Django like postgress. Does anyone have > instructions for an installation of the whole package (apache, postgres, > django, python, mod_python) on a mac? It

Should I set up Django locally or on a web server?

2008-05-01 Thread selmac
This is a newbie question. I'm wondering which scenario would be the least painless. I had MAMP installed on my OSX and that was fairly painless for trying out PHP type cms and frameworks, but I'm not sure it will help me with getting django going. I've run some of the simple django code in the

profiling django with fastcgi & cprofile?

2008-05-01 Thread skunkwerk
the page here: http://code.djangoproject.com/wiki/ProfilingDjango mentions profiling with hotshot & mod_python, or wsgi & cprofile. the stuff here: http://www.djangosnippets.org/snippets/605/ is also for hotshot, not cprofile. i'm not sure how to get this going with fastcgi - which i'm starting

Re: a question about model inheritance after qs-rf

2008-05-01 Thread medhat
You are right, and my sample function above "extend" also works. The problem is that I had a read-only property in my child model that had the same name as one of the fields in the parent model. I had not noticed that until I dug deeper to investigate the issue :-( thanks for your help. --

feed api : why have templates t specify item and description fields

2008-05-01 Thread Mike Chambers
I am using the feed api, and it works well. However, i was curious why the title and description fields are specified via templates, and not just as a property of the feed class? http://www.djangoproject.com/documentation/syndication_feeds/ Why not just have properties on the feed class like

Re: What is reverse() good for? Not really reversing...

2008-05-01 Thread Justin Lilly
While it may be the long way around, can you not do the following? a = Articles.objects.all()[:3] a.reverse() That would probably be my solution. -justin On Thu, May 1, 2008 at 12:36 PM, web-junkie <[EMAIL PROTECTED]> wrote: > > Hi, > > what is the new reverse() method good for? Seems it

Re: Status of ticket #6430

2008-05-01 Thread Martin Diers
You will want to post this on Django-dev, instead of here, as that's the proper place to get the dev's attention or explanation on a stale ticket. :) On May 1, 2008, at 10:20 AM, Warren wrote: > > It looks like someone else hit the same trivial bug I ran into and put > some considerable

Re: a question about model inheritance after qs-rf

2008-05-01 Thread AmanKow
I did the following, it works fine: from django.db import models class Place(models.Model): name = models.CharField(max_length=50) address = models.CharField(max_length=80) def __unicode__(self): return self.name # you can call this on any model object def

What is reverse() good for? Not really reversing...

2008-05-01 Thread web-junkie
Hi, what is the new reverse() method good for? Seems it just swaps the order_by statement? I would appreciate a reverse() method that, if used after slicing, would actually reverse the queryset. In the docs it's said: "Django doesn’t support that mode of access (slicing from the end), because

urls() and request.user

2008-05-01 Thread Guillaume Lederrey
Hello ! I am trying to use the update_object generic view in http://www.djangosnippets.org/snippets/635/ I am using it directly in my urls.py like this : url(r'^(?P\d+)/edit/$', permission_required('change_news')(update_object), { 'model' : News,

Re: a question about model inheritance after qs-rf

2008-05-01 Thread AmanKow
Whoops... get should be filter existing_ct_as_dict=ContentType.objects.filter(pk=ct_pk).values()[0] On Apr 30, 9:04 am, AmanKow <[EMAIL PROTECTED]> wrote: > Assuming ACT is your class name: > > ct = #... get the content type instance to extend here, or obtain the > pk in whatever way >

Re: using Q() with relations

2008-05-01 Thread msoulier
On May 1, 11:39 am, msoulier <[EMAIL PROTECTED]> wrote: > So, I narrowed it down to the OR of the resultant querysets. Ah, it's an inner join, so this likely wouldn't work for any database. >>> p.pprint(q3._get_sql_clause()) ( [ '"clients_client"."id"', '"clients_client"."enabled"',

Re: using Q() with relations

2008-05-01 Thread msoulier
On May 1, 11:16 am, msoulier <[EMAIL PROTECTED]> wrote: > I have a case where I'm trying to OR several conditions together in a > query, and I'm including a query against a field in a foreign key > field. > > queryset = queryset.filter( > Q(clientid__icontains=filter) | >

Re: Optimising Queryset time response

2008-05-01 Thread Rajesh Dhawan
Hi, > I have implemented a simple search functionality on my site. I > searches through 8,000 entries and it takes quite long (10-15 seconds) > to respond. Before looking into indexing and other more complex search > options, I'd like to see if I can optimise my code a little bit. > Here's the

Re: concatenation of querysets

2008-05-01 Thread msoulier
On May 1, 11:20 am, msoulier <[EMAIL PROTECTED]> wrote: > I looked in the docs and I've failed to find, so I apologize if it's > freakin' obvious, but how does one concatenate two querysets? Doh! http://groups.google.ca/group/django-users/browse_thread/thread/d22e8a8f378cf0e2 Forget it. :)

concatenation of querysets

2008-05-01 Thread msoulier
I looked in the docs and I've failed to find, so I apologize if it's freakin' obvious, but how does one concatenate two querysets? ie. q1 = Client.objects.filter(name__icontains='foo') q2 = Client.objects.filter(description__icontains='bar') q3 = q1 + q2 ?? How would I merge these? They

Status of ticket #6430

2008-05-01 Thread Warren
It looks like someone else hit the same trivial bug I ran into and put some considerable effort into writing a test case for it. However, progress on getting this fix included seems to have stalled over 3 months ago. Perhaps it was just never marked "Ready for checkin"?

using Q() with relations

2008-05-01 Thread msoulier
I have a case where I'm trying to OR several conditions together in a query, and I'm including a query against a field in a foreign key field. queryset = queryset.filter( Q(clientid__icontains=filter) | Q(description__icontains=filter) |

Initial Querysets forms, validation

2008-05-01 Thread sparky
Hello All, I have an app that implements messaging between users, and I want to offer the ability to attach objects to messages. I also want the message recipients to be restricted (it is a ModelChoice Field, and should exclude the current user, rather than be Users.objects.all()). I can get

Re: How to upload_to a dynamic location in ImageField?

2008-05-01 Thread Marty Alchin
On Thu, May 1, 2008 at 9:14 AM, Karen Tracey <[EMAIL PROTECTED]> wrote: > Long term I believe the answer for this is in #5361 > (http://code.djangoproject.com/ticket/5361), which allows for upload_to to > be a callable. If you're willing to run on the bleeding edge, you could try > out the

Re: newform-admin: custom validation (multiple fields)

2008-05-01 Thread [EMAIL PROTECTED]
Thanks Felix. I did use the Form.clean() for my validation accross multiple fields. There is an open ticket for the non_field_errors() not being called withing the change_form.html template. http://code.djangoproject.com/ticket/6809 -Alen On May 1, 4:14 pm, "[EMAIL PROTECTED]" <[EMAIL

Re: newform-admin: custom validation (multiple fields)

2008-05-01 Thread [EMAIL PROTECTED]
On Apr 30, 6:04 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > After reading over the newforms documentation, I came across the > Form.clean() method that suites my case nicely regarding my newforms- > admin form: > > """ > The Form subclass’s clean() method. This method can perform any >

Re: Rendering specific widgets of a MultiWidget

2008-05-01 Thread Marty Alchin
Wow, a conversation about DurationField and I totally missed it. For what it's worth, that patch needs a bit more work before even I want it included in trunk. I've been putting it off because of my file storage work, but I do plan to get back to it soon. And Martin's right. Currently,

Optimising Queryset time response

2008-05-01 Thread Julien
Hi, I have implemented a simple search functionality on my site. I searches through 8,000 entries and it takes quite long (10-15 seconds) to respond. Before looking into indexing and other more complex search options, I'd like to see if I can optimise my code a little bit. Here's the code: def

Announcing django-compress

2008-05-01 Thread andreas . pelme
Hi I recently put up django-compress on Google Code: http://code.google.com/p/django-compress/ django-compress provides an automated system for compressing CSS and JavaScript files. By default, it only outputs compressed files, while not in DEBUG-mode. That means you can still debug and edit

Re: How to upload_to a dynamic location in ImageField?

2008-05-01 Thread Abdallah El Guindy
Thanks a lot Karen! On May 1, 4:14 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > On Thu, May 1, 2008 at 7:50 AM, Abdallah El Guindy < > > [EMAIL PROTECTED]> wrote: > > Hey all, > > > I wonder how can I do something like this: > > > class Author(models.Model): > >        first_name =

DO U WANT TO KNOW ABOUT SCIENTOLOGY?

2008-05-01 Thread ruby
HELLO FRIEND IAM SHALINI, DO U WANT TO KNOW ABOUT SCIENTOLOGY? PLS LOOK AT THE BELOW WEBSITE. www.bigconcern3.blogspot.com

Re: How to upload_to a dynamic location in ImageField?

2008-05-01 Thread Karen Tracey
On Thu, May 1, 2008 at 7:50 AM, Abdallah El Guindy < [EMAIL PROTECTED]> wrote: > Hey all, > > I wonder how can I do something like this: > > class Author(models.Model): >first_name = models.CharField(maxlength=30) >headshot = models.ImageField(upload_to='media/' + >

Using django test suite with standalone script

2008-05-01 Thread dcoy
Simply put I have a system like this (everything implemented as python scripts) * Socket server - The server receives connections from distributed clients (over GPRS). - The clients send data to the server. - The server uses django models to save the data to database. * Test client - Runs a

Re: date_based.archive_index and "IS NULL" query

2008-05-01 Thread Guillaume Lederrey
I forgot to add : I'm running django-trunk, so it might be related to the queryset refactoring merge ? 2008/5/1 Guillaume Lederrey <[EMAIL PROTECTED]>: > Hello ! > > I am getting a strange query from the archive_index generic view : > > SELECT DISTINCT

date_based.archive_index and "IS NULL" query

2008-05-01 Thread Guillaume Lederrey
Hello ! I am getting a strange query from the archive_index generic view : SELECT DISTINCT CAST(DATE_FORMAT(`news_news`.`publication_date`, '%Y-01-01 00:00:00') AS DATETIME) FROM `news_news` WHERE `news_news`.`publication_date` IS NULL ORDER BY 1 ASC I dont understand where the "IS NULL"

Re: Backwards incompatibility with fancy PostgreSQL queries and QS-RF

2008-05-01 Thread offspinner
I think I posted a similar issue almost simultaneously with Barry here. This affects MySQL 5.0.41 too. See my post: http://groups.google.com/group/django-users/browse_frm/thread/831667d32f01f5d2 On May 1, 5:59 am, Barry Pederson <[EMAIL PROTECTED]> wrote: > On Apr 30, 11:52 pm, "James Bennett"

validator_list can not work in models?

2008-05-01 Thread cougar2008
Hi all: When I use ModelForm like this: models: visa= models.CharField('visa',max_length=1,choices=(('1','yes'), ('2','no'))) visatype = models.CharField('visatype',max_length=1,null=True,blank=True, choices=(('1','l'),

How to upload_to a dynamic location in ImageField?

2008-05-01 Thread Abdallah El Guindy
Hey all, I wonder how can I do something like this: class Author(models.Model): first_name = models.CharField(maxlength=30) headshot = models.ImageField(upload_to='media/' + self.first_name.__str__()) Of course this does not work, but I need to upload to a dynamically specified

Re: Subclassing a form, changing one field into required = False

2008-05-01 Thread Karen Tracey
On Thu, May 1, 2008 at 7:22 AM, LaundroMat <[EMAIL PROTECTED]> wrote: > > Hi - > > Would it be possible to subclass a form class, and in that subclass > define that one of the fields that were required in the parent class > are no longer required in the subclass? > You mean like this? >>> from

Subclassing a form, changing one field into required = False

2008-05-01 Thread LaundroMat
Hi - Would it be possible to subclass a form class, and in that subclass define that one of the fields that were required in the parent class are no longer required in the subclass? Thanks, Mathieu --~--~-~--~~~---~--~~ You received this message because you are

Re: HEAD requests causing AttributeError

2008-05-01 Thread James Bennett
On Thu, May 1, 2008 at 4:39 AM, omat <[EMAIL PROTECTED]> wrote: > I don't see why someone / something is hitting with HEAD requests. Can > it be a security issue? No, it's not a security issue. It probably means you've enabled the middleware view-documentation middleware

Re: IE6/Safari not keeping cookie after closing browser

2008-05-01 Thread Kip Parker
Absolutely, cookies are subject to user settings and behaviour so unreliable, but as far as default browser behaviour goes I think IE6 keeps cookies forever, Firefox has an expiration limit of 90 days, and my Safari 3 at least has cookies listed to expire in 2099. So it ought to work if it's

HEAD requests causing AttributeError

2008-05-01 Thread omat
Hi, I recently start receiving server error emails. The error is thrown by django/middleware/doc.py and as far as I can tell, a HEAD request causing AttributeError: 'ModPythonRequest' object has no attribute 'user'. The application is running on a linux box with a 3 months old svn version of

Re: extra tables subselect issue in QS refactor?

2008-05-01 Thread offspinner
This issue seems to be similar/same as the another post made today http://groups.google.com/group/django-users/browse_thread/thread/ef17cb9fff6d0391 On May 1, 7:44 am, offspinner <[EMAIL PROTECTED]> wrote: > Hi folks, > > I have several rather large SQL queries that I want to return a QS. I >

Re: Translation problem

2008-05-01 Thread Mauro
On May 1, 4:36 pm, Mauro <[EMAIL PROTECTED]> wrote: > Thank you Gaetan, > > I tried to add a BOM to the .po file but I got an error when compiling > the messages. (kind of expected) > Then I tried to add it at the beginning of my template file but keep > getting the sameDjangoUnicodeDecodeError.

Re: Translation problem

2008-05-01 Thread Mauro
Thank you Gaetan, I tried to add a BOM to the .po file but I got an error when compiling the messages. (kind of expected) Then I tried to add it at the beginning of my template file but keep getting the same DjangoUnicodeDecodeError . When you mention "save your source file with a BOM" which

Re: persistence of variable in views.py

2008-05-01 Thread James Bennett
On Thu, May 1, 2008 at 1:23 AM, skunkwerk <[EMAIL PROTECTED]> wrote: > I have a variable defined by a function call in my views.py that's at > the global level at the start of the file (ie is not inside any other > function, though the variable is not prefixed by 'global'). As this > takes a

extra tables subselect issue in QS refactor?

2008-05-01 Thread offspinner
Hi folks, I have several rather large SQL queries that I want to return a QS. I need to put a subselect in the tables part of "extra" to achieve this. The example below I can refactor to be more conventional but I have other examples where I need to use this construct. It *seems* since QS

persistence of variable in views.py

2008-05-01 Thread skunkwerk
I have a variable defined by a function call in my views.py that's at the global level at the start of the file (ie is not inside any other function, though the variable is not prefixed by 'global'). As this takes a few seconds to complete, I just wanted to make sure that this function isn't