Re: How to get the values of a field of the model

2008-11-26 Thread izzy
I still don't get it. reports = Report.objects.all() author = # how can I retrieve all author names (author names should be unique) I can't figure it out. please give me direct answer.. --~--~-~--~~~---~--~~ You received this message because you are

Re: Configuring multiple Django installs transparently via FastCGI mutiplexing

2008-11-26 Thread Brian
Malcolm: Thanks for the reply. > Whilst I'm all in favour of attempting to solve problems given arbitrary > constraints as a thought exercise, I think this one isn't really the > best practical solution to anything. I'm sure that's a fault of my explanation, not the design. ;o) > You are

runserver error on Mac OSX 10.5.5

2008-11-26 Thread jconway
I just did a django install on my Macbook Pro (2.5 GHz Intel Core 2 Duo) running 10.5.5. I can create projects with startproject and they are populated with manage.py, settings.py, settings.pyc and urls.py. The problem is when I try to run the server, I get the following errors. Thoughts? $

Re: Turning all zero's to blank strings in a model.

2008-11-26 Thread nbv4
On Nov 26, 9:06 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Wed, 2008-11-26 at 19:50 -0800, nbv4 wrote: > > I'm new to django, and I'm having a problem setting up a model. > > > I have a model which has about 12 decimal fields and two integer > > fields. Each field, when displayed,

Re: Configuring multiple Django installs transparently via FastCGI mutiplexing

2008-11-26 Thread Graham Dumpleton
On Nov 27, 3:45 pm, Brian <[EMAIL PROTECTED]> wrote: > Accounts could be created as often as hourly. I'd be very bad to have > the webserver go down while people use the system (unless it was for > less than a second or two... but even then, it's still be very > bad :) ). I don't know how

Re: Configuring multiple Django installs transparently via FastCGI mutiplexing

2008-11-26 Thread Malcolm Tredinnick
On Wed, 2008-11-26 at 20:17 -0800, Brian wrote: [...] > The situation is this: I'm creating a web-site with a bunch of > accounts - each account having its own database. I want people to go > to the site (i.e. www.example.com/) and when they log in the > application gets all its

Re: Configuring multiple Django installs transparently via FastCGI mutiplexing

2008-11-26 Thread Brian
Accounts could be created as often as hourly. I'd be very bad to have the webserver go down while people use the system (unless it was for less than a second or two... but even then, it's still be very bad :) ). On Nov 26, 11:31 pm, Graham Dumpleton <[EMAIL PROTECTED]> wrote: > On Nov 27, 3:17 

Re: Configuring multiple Django installs transparently via FastCGI mutiplexing

2008-11-26 Thread Graham Dumpleton
On Nov 27, 3:17 pm, Brian <[EMAIL PROTECTED]> wrote: > Hi Graham, > > Thanks for the reply. No, I'm not stuck using Lighttpd at all - I just > like it because it's simple and fast. :) > > Here's a link to a description of what I'd like to > see:http://stackoverflow.com/questions/314515 > > The

Re: Configuring multiple Django installs transparently via FastCGI mutiplexing

2008-11-26 Thread Brian
Hi Graham, Thanks for the reply. No, I'm not stuck using Lighttpd at all - I just like it because it's simple and fast. :) Here's a link to a description of what I'd like to see: http://stackoverflow.com/questions/314515 The situation is this: I'm creating a web-site with a bunch of accounts -

Re: Turning all zero's to blank strings in a model.

2008-11-26 Thread Malcolm Tredinnick
On Wed, 2008-11-26 at 19:50 -0800, nbv4 wrote: > I'm new to django, and I'm having a problem setting up a model. > > I have a model which has about 12 decimal fields and two integer > fields. Each field, when displayed, will always be blank if the value > is zero. In other words, "0" or "0.0"

Turning all zero's to blank strings in a model.

2008-11-26 Thread nbv4
I'm new to django, and I'm having a problem setting up a model. I have a model which has about 12 decimal fields and two integer fields. Each field, when displayed, will always be blank if the value is zero. In other words, "0" or "0.0" will never be displayed, either when the object is

Re: How to get the values of a field of the model

2008-11-26 Thread Malcolm Tredinnick
On Wed, 2008-11-26 at 19:43 -0800, izzy wrote: > Hi all. > > I'm new to Django and I would like to get the unique values of a field > in a model. > > For example: > > Class Report(models.Model): > title = models.Charfield > category = models... > author =

Re: 'str' object has no attribute '_meta' while using comment system

2008-11-26 Thread izzy
Ok. I get it. form should have an object instance. Thanks for pointing it out. And sorry to bother you from my stupid mistake. On Nov 27, 10:14 am, "Chatchai Neanudorn" <[EMAIL PROTECTED]> wrote: > what happen if form = "" ? > > better to use meaning full object, you will need to use form in

How to get the values of a field of the model

2008-11-26 Thread izzy
Hi all. I'm new to Django and I would like to get the unique values of a field in a model. For example: Class Report(models.Model): title = models.Charfield category = models... author = models.ForeignKey(auth.User) ... in views.py, how can I retrieve the unique

Re: Configuring multiple Django installs transparently via FastCGI mutiplexing

2008-11-26 Thread Graham Dumpleton
On Nov 27, 2:06 pm, Brian <[EMAIL PROTECTED]> wrote: > Hi everyone, > > Here's a questions I just posted on stackoverflow.com (because I like > that forum's layout) - but I thought posting it here might lead to > more / better coverage.  See:http://stackoverflow.com/questions/322694/ > >

Configuring multiple Django installs transparently via FastCGI mutiplexing

2008-11-26 Thread Brian
Hi everyone, Here's a questions I just posted on stackoverflow.com (because I like that forum's layout) - but I thought posting it here might lead to more / better coverage. See: http://stackoverflow.com/questions/322694/ Multiple installs of Django - How to configure transparent multiplex

Re: Tricky URLs Question

2008-11-26 Thread Malcolm Tredinnick
On Thu, 2008-11-27 at 13:44 +1100, Malcolm Tredinnick wrote: [...] > The second comment is that you might want to consider your URL design a > bit more. You are really saying that none of the tag names are any more > special or highly prioritised than any of the others. Although what you >

Re: Tricky URLs Question

2008-11-26 Thread Malcolm Tredinnick
On Wed, 2008-11-26 at 17:54 -0800, Dylan Lorimer wrote: > Hi, > > So I'm trying to model my URLs for a blog I'm building on Django using > the following structure: > > http://www.myblog.com/tags/tag1/tag2/tag3/tag4/etc etc > > The idea being that after the initial /tags/ you can add on any

Tricky URLs Question

2008-11-26 Thread Dylan Lorimer
Hi, So I'm trying to model my URLs for a blog I'm building on Django using the following structure: http://www.myblog.com/tags/tag1/tag2/tag3/tag4/etc etc The idea being that after the initial /tags/ you can add on any tag and it would act as a filter against the blog entries. I'm trying to

Re: UnicodeDecodeError when uploading files with non-ascii characters in filename

2008-11-26 Thread Malcolm Tredinnick
On Wed, 2008-11-26 at 06:20 -0800, gnijholt wrote: > Hello, > > I'm running Django r7548 using PostgreSQL 8.3 on Leopard. > The problem: When I upload a file with a filename like '.jpg', I > get the following error: > --- > UnicodeDecodeError at /library/documents/12114/addFile/ > 'ascii'

Re: Testing dynamic apps

2008-11-26 Thread Julien Phalip
I'm keen to try to find some proper ways to fix this, but before I go too deep into the bowels of Django's testing framework, I was wondering what would be the criticisms you'd have about the "solution" I came up with (at the start of this thread)? It sort of works without patching Django, but is

Re: 'str' object has no attribute '_meta' while using comment system

2008-11-26 Thread Chatchai Neanudorn
what happen if form = "" ? better to use meaning full object, you will need to use form in advance 2008/11/27 izzy <[EMAIL PROTECTED]> > > Yes I've done that. > > def packagingreport_details(request, object_id): >report = get_object_or_404(PackagingReport, pk=object_id) >user =

Re: order by ... nulls [first|last]

2008-11-26 Thread Malcolm Tredinnick
On Wed, 2008-11-26 at 14:22 +0100, Thomas Guettler wrote: > Jarek Zgoda schrieb: > > Wiadomość napisana w dniu 2008-11-26, o godz. 10:20, przez Thomas > > Guettler: > > > > > >> I am missing order by nulls [first|last] > >> > >> Either I am blind, or it is not possible. > >> > > > > >

Re: 'str' object has no attribute '_meta' while using comment system

2008-11-26 Thread izzy
Yes I've done that. def packagingreport_details(request, object_id): report = get_object_or_404(PackagingReport, pk=object_id) user = request.user messages = '' errors = '' if report.author == user: form = report else:

Re: pythonpath problem

2008-11-26 Thread Malcolm Tredinnick
On Wed, 2008-11-26 at 12:50 -0800, Chris Amico wrote: > OK, here's another wrinkle: The modules in that folder import fine on > the browser end. I put tagging in there, and that shows up in my admin > list with no errors. So mod_python is picking up the vhost file, but > I'm not getting it in

Re: Is the initial value of a form field available in the template?

2008-11-26 Thread Malcolm Tredinnick
I think you really need to explain what the real problem is that you're trying to solve, because you're asking a question that is too specific. On Wed, 2008-11-26 at 12:19 -0800, ChrisK wrote: > Sorry, I cut down my example poorly. > > template has > > > {{form.teaser.field.initial}} >

Re: Multiple Database

2008-11-26 Thread Malcolm Tredinnick
On Wed, 2008-11-26 at 11:46 -0600, Tim Chase wrote: > > I am currently attempting to roll my own multiple database > > support for django for a new project. I have attempted to > > search for examples of this but have not found very much. > > Does anyone have some examples on how I can

Re: 'str' object has no attribute '_meta' while using comment system

2008-11-26 Thread Chatchai Neanudorn
{% get_comment_count for *form *as comment_count %} make sure you put the right object (in your code is form, what is it? do you have template context names form?) for comment templatetag and it is available chatchai 2008/11/27 izzy <[EMAIL PROTECTED]> > > Hi all. > > I've been having a

Re: Testing dynamic apps

2008-11-26 Thread Rock
I took a similar path. I cloned the run_tests function from django.tests.simple.py and put it in my project directory as test_setup.py while adding this near the top of the function: if settings.TEST_APPS: settings.INSTALLED_APPS += settings.TEST_APPS That at least allows me to define

'str' object has no attribute '_meta' while using comment system

2008-11-26 Thread izzy
Hi all. I've been having a problem regarding my app using comment system in Django1.0.2. I've used comment so that anyone can comment on the report. When I view the report with the comment using the user that writes a comment it will raise no error but when I tried to login as different user I

Appengine Admin

2008-11-26 Thread Valts Mazurs
Hello, dear Djangonauts! Today it is the 0th birthday of Appengine Admin - Django like automatic administration panel for Google App Engine. The reason why this project was started and actually released is quite simple - I am so addicted to Django automatic admin panel that I realized that I

Re: Testing dynamic apps

2008-11-26 Thread Julien Phalip
On Nov 27, 10:55 am, "Russell Keith-Magee" <[EMAIL PROTECTED]> wrote: > On Thu, Nov 27, 2008 at 8:33 AM, Julien Phalip <[EMAIL PROTECTED]> wrote: > > > So, all this works pretty well. The 'fakeapp' app is loaded > > dynamically, tables are created and the FakeItem model can be use in > > my

Re: Testing dynamic apps

2008-11-26 Thread Russell Keith-Magee
On Thu, Nov 27, 2008 at 8:33 AM, Julien Phalip <[EMAIL PROTECTED]> wrote: > > So, all this works pretty well. The 'fakeapp' app is loaded > dynamically, tables are created and the FakeItem model can be use in > my tests. > > But it feels dirty. The dynamically created tables can potentially >

Re: Best IDE for Django and python?

2008-11-26 Thread Ivan Mincik
Komodo Edit 5 couldn't run at Debian Etch. Has anybody some older version ? (4) Ivan On Wednesday 26 November 2008 17:50, vivek wrote: > > I also use komodo ide : > - It can be used with other dynamic languages like php, so if you > sometimes need to do something in languages other than

Re: Apache Setup

2008-11-26 Thread Graham Dumpleton
On Nov 27, 1:10 am, Django Newbie <[EMAIL PROTECTED]> wrote: > Graham Dumpleton wrote: > > > On Nov 26, 3:32 pm, Django Newbie <[EMAIL PROTECTED]> wrote: > > >> Hi Everybody, > > >> Django newbie here.  I'm trying to get it to work under apache with > >> mod_python on a freebsd server but

Re: Project Setup and PYTHONPATH

2008-11-26 Thread Graham Dumpleton
On Nov 27, 1:06 am, Flo Ledermann <[EMAIL PROTECTED]> wrote: > Hi all, > > my name is flo, i am relatively new to django but would consider > myself an experienced web developer. I am sorry if this has been asked > hundreds of times, but after doing somewhat extensive research i still > would

Testing dynamic apps

2008-11-26 Thread Julien Phalip
Hi, I have an app which allows users to rate/vote for any kind of object. Now, to test this app I need to have a fake model contained in a fake app. Here's the file structure of my app: myapp/ tests/ fakeapp/ __init__.py models.py __init__.py

Re: pythonpath problem

2008-11-26 Thread Graham Dumpleton
On Nov 27, 7:50 am, Chris Amico <[EMAIL PROTECTED]> wrote: > OK, here's another wrinkle: The modules in that folder import fine on > the browser end. I put tagging in there, and that shows up in my admin > list with no errors. So mod_python is picking up the vhost file, but > I'm not getting it

Join me on Bebo

2008-11-26 Thread Aljosa Mohorovic
You will like it. Click to find out why You also have the following outstanding friend requests: Bakheet Harire <[EMAIL PROTECTED]> You can accept or reject all of these invitations at once by clicking below: http://www.bebo.com/in/8184124264a233440073b135

Using AJAX and 'normal' forms

2008-11-26 Thread LaundroMat
Hi - I've just started fiddling about with the prototype library in order to build in some AJAX functionality into my django site (which hasn't gone live yet). On one part of the page I'm using the Ajax.PeriodicalUpdater function which asynchronously polls a URL and then integrates the html

Re: pythonpath problem

2008-11-26 Thread Chris Amico
OK, got it working. Changed it in .bash_profile. Easier than I thought, always. Thanks folks. On Nov 26, 12:50 pm, Chris Amico <[EMAIL PROTECTED]> wrote: > OK, here's another wrinkle: The modules in that folder import fine on > the browser end. I put tagging in there, and that shows up in my

Re: pythonpath problem

2008-11-26 Thread Chris Amico
OK, here's another wrinkle: The modules in that folder import fine on the browser end. I put tagging in there, and that shows up in my admin list with no errors. So mod_python is picking up the vhost file, but I'm not getting it in the shell. Thus when I try python manage.py shell with anything

Re: Overriding admin templates

2008-11-26 Thread bfrederi
It turns out I am having the same issue. I just added on batchadmin and I can't seem to override templates across the entire project (I wanted to add some JQuery to filters.html). How did you solve your problem? On Nov 3, 5:02 am, Lars Stavholm <[EMAIL PROTECTED]> wrote: > Lars Stavholm wrote: >

simple tags and (auto)escaping

2008-11-26 Thread frank h.
I am writing a simple tag as follows: - from django.template import Library from django.utils.safestring import mark_for_escaping register = Library() @register.simple_tag def testtag(): return mark_for_escaping("&><%") - calling the tag from my template, inserts

ModelForm question

2008-11-26 Thread fiedzia
Hi I am trying to achieve the following effect: A ModelForm containing list of choices and input to possibly add another element to the list is presented on page. If user will not choose any item from list and will type something into new_item field, then: - if new_item is present on the list,

Re: Is the initial value of a form field available in the template?

2008-11-26 Thread ChrisK
Sorry, I cut down my example poorly. template has {{form.teaser.field.initial}} {{form.auth_id}} {{form.fence_id}} Reminder String: invocation looks like print m.teaser form = editFenceForm(initial={ 'auth_id' : auth_id, 'fence_id': fence_id,

Re: Access object in session from clean method in Form extending ModelForm

2008-11-26 Thread vanosten
Hi Daniel Thank you for the tip. Now it works :-) class CategoryItemForm(ModelForm): class Meta: model = CategoryItem exclude = ('position','defaultItem') #These two attributes shall only be changed in list view def clean(self): """ Checks whether the

Re: How add extra data to m2m-field before saving form?

2008-11-26 Thread dexter
This is the error i receive: 'EventForm' object has no attribute 'managers' --~--~-~--~~~---~--~~ 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

Re: Django ORM and phpMyAdmin

2008-11-26 Thread Adi Jörg Sieker
Hi, On 26.11.2008 10:32 Uhr, Seth Kaïne wrote: > I'm learning about ORM, but it's not easy to understand the whole > picture. > I'm trying to create a "function" or a "filter" linked to my models.py > or to PHPmyAdmin to give me a signal when something is changing. > I'm making reseachs on

How add extra data to m2m-field before saving form?

2008-11-26 Thread dexter
I want to add 'request.user' to 'members' of an 'event' that the user creates. I have tried several different methods and googled without finding any correct solutions. Right now, code looks like this but still wont work: # views.py def new_event(request): if request.method == 'POST':

Re: Is the initial value of a form field available in the template?

2008-11-26 Thread Rajesh Dhawan
On Nov 26, 2:14 pm, ChrisK <[EMAIL PROTECTED]> wrote: > I'm doing a custom template (probably stupid), and using initial > values. Here's a precis: > > template has > > > {{form.url.field.initial}} > {{form.auth_id}} {{form.media_id}} {{form.fence_id}} > Reminder String: >     p> > > form

Is the initial value of a form field available in the template?

2008-11-26 Thread ChrisK
I'm doing a custom template (probably stupid), and using initial values. Here's a precis: template has {{form.url.field.initial}} {{form.auth_id}} {{form.media_id}} {{form.fence_id}} Reminder String: form type looks like class editFenceForm(forms.Form): teaser =

Re: Multiple Database

2008-11-26 Thread Tim Chase
> I am currently attempting to roll my own multiple database > support for django for a new project. I have attempted to > search for examples of this but have not found very much. > Does anyone have some examples on how I can accomplish this? There are multiple facets to "multiple database"

Re: Multiple Database

2008-11-26 Thread Austin Gabel
Tim. I'm looking for a federation type of usage. I have several databases that I need to pull data from into one view. On Wed, Nov 26, 2008 at 11:46 AM, Tim Chase <[EMAIL PROTECTED]>wrote: > > > I am currently attempting to roll my own multiple database > > support for django for a new project.

Re: hidden fields in forms

2008-11-26 Thread ChrisK
> form = newFenceForm(initial={'auth_id' : auth_id}) Awesome. That was exactly what I needed - thanks very much. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group,

Re: Multiple Database

2008-11-26 Thread kron4eg
But be careful with this piece of code, It's only prototype. For example, it opens new connection to database each time you accessing manager :) On Nov 26, 7:25 pm, Rock <[EMAIL PROTECTED]> wrote: > http://www.eflorenzano.com/blog/post/easy-multi-database-support-django/ > > On Nov 26, 8:30 am,

Re: significance of date published

2008-11-26 Thread Alex Koshelev
It is just verbose_name - something like human description or label for field. On Wed, Nov 26, 2008 at 20:40, mahesh_aka_amol <[EMAIL PROTECTED]> wrote: > > Hi > > I have came across a constructor like this > models.DateTimeField('date published') > > What is significance of 'date published'

significance of date published

2008-11-26 Thread mahesh_aka_amol
Hi I have came across a constructor like this models.DateTimeField('date published') What is significance of 'date published' can I replace it with say 'date printed' or 'date ed' Thank you in advance --~--~-~--~~~---~--~~ You received this message because you

significance of date published

2008-11-26 Thread mahesh_aka_amol
Hi I have came across a constructor like this models.DateTimeField('date published') What is significance of 'date published' can I replace it with say 'date printed' or 'date ed' Thank you in advance --~--~-~--~~~---~--~~ You received this message because you

Re: No module named urls

2008-11-26 Thread TheIvIaxx
So i've narrowed down the problem more. Its failing on the template call to {% url django-admindocs-docroot as docsroot %} on the admin page and all other pages. If i remove this line, the site works just fine, recognizing all urls defined. Not sure just the template engine would fail to see

Re: Multiple Database

2008-11-26 Thread Rock
http://www.eflorenzano.com/blog/post/easy-multi-database-support-django/ On Nov 26, 8:30 am, "Austin Gabel" <[EMAIL PROTECTED]> wrote: > Hello, > I am currently attempting to roll my own multiple database support for > django for a new project.  I have attempted to search for examples of this >

Re: Best IDE for Django and python?

2008-11-26 Thread vivek
I also use komodo ide : - It can be used with other dynamic languages like php, so if you sometimes need to do something in languages other than python, it can come in handy. - They have excellent licensing policy but i doubt there is any "best" ide to everyone's need. Most of choices

Re: Copy data from 1 model to another

2008-11-26 Thread issya
Thank you for the nifty code. I changed it just a little so it would iterate through model A's queryset and get_or_create model B. It works great, thanks again. obja = Mls.objects.filter(mls_agent_id='261505106') fieldnames = FeaturedProperties._meta.get_all_field_names() for obj in obja:

Re: Best IDE for Django and python?

2008-11-26 Thread Horst Gutmann
Well, if you install ipython, you also get auto completion with manage.py shell :-) -- Horst On Wed, Nov 26, 2008 at 4:20 PM, Steve Phillips <[EMAIL PROTECTED]> wrote: > I personally use Komodo Edit along with IDLE. Also instead of using > "manage.py shell" I use IDLE. I am so spoiled by the

Re: Best IDE for Django and python?

2008-11-26 Thread Andre Meyer
On Wed, Nov 26, 2008 at 4:20 PM, Steve Phillips <[EMAIL PROTECTED]> wrote: > I personally use Komodo Edit along with IDLE. Also instead of using > "manage.py shell" I use IDLE. I am so spoiled by the autocompletions. I am also using Komodo IDE and like it a lot. You may also want to check

Satchmo 0.8 Released

2008-11-26 Thread Chris Moffitt
I'm happy to announce that the Satchmo team has released Satchmo 0.8. For those of you not familiar with Satchmo, it is a django-based framework for building highly customized online stores. One of the major aspects of this release is full compatibility with Django 1.0.x. This releases includes

Re: Best IDE for Django and python?

2008-11-26 Thread Steve Phillips
I personally use Komodo Edit along with IDLE. Also instead of using "manage.py shell" I use IDLE. I am so spoiled by the autocompletions. On 11/26/08, Chagel <[EMAIL PROTECTED]> wrote: > > > anyone know when NB has Django project support? > > > On Nov 25, 8:26 pm, bedros <[EMAIL PROTECTED]>

Re: Best IDE for Django and python?

2008-11-26 Thread Austin Gabel
I have been using WingIDE from www.wingware.com. I think it's pretty good. On Tue, Nov 25, 2008 at 2:27 AM, DragonSlayre <[EMAIL PROTECTED]> wrote: > > Hey, I'm getting started with a friend in developing a site with > Django, and we're both new to this, so I am wondering what people use > to

Re: Best IDE for Django and python?

2008-11-26 Thread Chagel
anyone know when NB has Django project support? On Nov 25, 8:26 pm, bedros <[EMAIL PROTECTED]> wrote: > I personally like Komodo Edit > > after trying komodo, I switched  from pydev and eclipse to komodo; > > On Nov 25, 10:56 am, "Antoni Aloy" <[EMAIL PROTECTED]> wrote: > > > > > 2008/11/25

Multiple Database

2008-11-26 Thread Austin Gabel
Hello, I am currently attempting to roll my own multiple database support for django for a new project. I have attempted to search for examples of this but have not found very much. Does anyone have some examples on how I can accomplish this?

Re: Usage opinion wanted

2008-11-26 Thread Saurabh Agrawal
Hi Jeff, Thanks again for all the info. Can I trouble you a little more, for something which in fact, might not be Django related at all? You can choose to completely ignore this message, of course. I just want to know what is this server you are talking about? Is that some kind of insulation

UnicodeDecodeError when uploading files with non-ascii characters in filename

2008-11-26 Thread gnijholt
Hello, I'm running Django r7548 using PostgreSQL 8.3 on Leopard. The problem: When I upload a file with a filename like '.jpg', I get the following error: --- UnicodeDecodeError at /library/documents/12114/addFile/ 'ascii' codec can't decode byte 0xc3 in position 1: ordinal not in

Re: Using {% url %} with generic views

2008-11-26 Thread Alex Koshelev
Url patterns can have names [1] [1]: http://docs.djangoproject.com/en/dev/topics/http/urls/#id2 On Wed, Nov 26, 2008 at 14:48, dash86no <[EMAIL PROTECTED]> wrote: > > Yesterday I replaced hard coded links on my site with a dotted > notation path to the relevant view using the {% url %} tag. >

Project Setup and PYTHONPATH

2008-11-26 Thread Flo Ledermann
Hi all, my name is flo, i am relatively new to django but would consider myself an experienced web developer. I am sorry if this has been asked hundreds of times, but after doing somewhat extensive research i still would like to gain some insight into the design decisions involved in how

Re: Adding delete button to a form.

2008-11-26 Thread John M
Dominic, Welcome to the django forum :) and welcome to django > Which I've tested and seems to be working ok. (The documentation, by > the way, didn't mention anything about requiring > foo_confirm_delete.html but I guess that's not too hard to figure out > from the error message) Actually,

Re: Compare Lists for Unique Items

2008-11-26 Thread Alex Jillard
Wouldn't that give me worse performance though? Filtering the two lists verses making 300+ save()'s in a try/except, 90% of which won't be committed to the database? On Wed, Nov 26, 2008 at 9:00 AM, Jeff FW <[EMAIL PROTECTED]> wrote: > > If you already have a unique key on the project's name

Re: Apache Setup

2008-11-26 Thread Django Newbie
Graham Dumpleton wrote: > > On Nov 26, 3:32 pm, Django Newbie <[EMAIL PROTECTED]> wrote: > >> Hi Everybody, >> >> Django newbie here. I'm trying to get it to work under apache with >> mod_python on a freebsd server but running into problems. I searched >> the archives and found similar

Re: Usage opinion wanted

2008-11-26 Thread Jeff FW
This sounds, to me, like a great candidate for using Django. Each of the separate modules you described could be a distinct application within your project. Actually, you could make it even more granular than that, as a lot of the parts within each module could be separate apps. The Django

Re: Compare Lists for Unique Items

2008-11-26 Thread Rajesh Dhawan
On Nov 26, 9:00 am, Jeff FW <[EMAIL PROTECTED]> wrote: > If you already have a unique key on the project's name field, then > you're good to go--no duplicates will ever get inserted.  No need to > do any filtering ahead of time--just put each save() in a try/except > block that catches the

Re: Adding delete button to a form.

2008-11-26 Thread dash86no
K, I didn't want to go to bed without implementing some functionality, so I went ahead with my idea. This is what I implemented: {% block options %} http://localhost:8000/sam/quote/ delete/{{ object.id }}">delete{% endblock %} It works just fine, but it depresses me to think I need to be

Re: Compare Lists for Unique Items

2008-11-26 Thread Jeff FW
If you already have a unique key on the project's name field, then you're good to go--no duplicates will ever get inserted. No need to do any filtering ahead of time--just put each save() in a try/except block that catches the error you get and does nothing. -Jeff On Nov 25, 4:53 pm, "Alex

Re: App Name in Admin

2008-11-26 Thread Steve Phillips
That's what I figured, I noted when searching through the support logs on the djangoproject.org site that this seems to be in high demand. I am going to go through contrib.admin.sites and familiarize myself a little better with the methods in there and see what I can come up with so I can make it

Re: Pagination of non-Django database

2008-11-26 Thread huw_at1
Ahh great - many thanks. I did wonder this but without better documentation I could not be certain. I currently build a list from my sql query so this should be no problem. Much appreciated. On Nov 26, 12:47 pm, Thomas Kerpe <[EMAIL PROTECTED]> wrote: > Am 26.11.2008 13:19 Uhr, huw_at1

Re: order by ... nulls [first|last]

2008-11-26 Thread Thomas Guettler
Jarek Zgoda schrieb: > Wiadomość napisana w dniu 2008-11-26, o godz. 10:20, przez Thomas > Guettler: > > >> I am missing order by nulls [first|last] >> >> Either I am blind, or it is not possible. >> > > > I think this is database-dependent. > I know, but I would like to force this

Re: Overriding contrib.auth User save()

2008-11-26 Thread sergioh
Signals are the better way to achieve. You usually override the save method when you need to define something related with the model itself, but in many cases signals are the better way to notify some function to do something if a model change (after save) def your_function(sender, instance,

Adding delete button to a form.

2008-11-26 Thread dash86no
I'm sorry to ask what I feel must be a simple question, but I've just spent the last hour trawling through the documentation, and can't for the life for me find out how to add a "delete button" to a form. I've set up a generic view: (r'^quote/delete/(?P\d+)/$',

Re: App Name in Admin

2008-11-26 Thread Kurczak
I believe the only way to do this is to edit admin index template. On Nov 26, 10:15 am, "Alex Koshelev" <[EMAIL PROTECTED]> wrote: > Application not model. verbose_name works for model itself > > Just now there is no way to set custom application name. > > On Wed, Nov 26, 2008 at 10:40, Daniel

Re: Pagination of non-Django database

2008-11-26 Thread Thomas Kerpe
Am 26.11.2008 13:19 Uhr, huw_at1 schrieb: > A small part of my framework queries a non-Django db due to it being a > legacy db with primary keys already in use. My question is is there a > recognised way of applying pagination to non-Django db objects such > that I can paginate the sql select

Pagination of non-Django database

2008-11-26 Thread huw_at1
Hey all, A small part of my framework queries a non-Django db due to it being a legacy db with primary keys already in use. My question is is there a recognised way of applying pagination to non-Django db objects such that I can paginate the sql select query on this database? Many thanks

Re: order by ... nulls [first|last]

2008-11-26 Thread Jarek Zgoda
Wiadomość napisana w dniu 2008-11-26, o godz. 10:20, przez Thomas Guettler: > I am missing order by nulls [first|last] > > Either I am blind, or it is not possible. I think this is database-dependent. -- We read Knuth so you don't have to. - Tim Peters Jarek Zgoda, R, Redefine [EMAIL

Using {% url %} with generic views

2008-11-26 Thread dash86no
Yesterday I replaced hard coded links on my site with a dotted notation path to the relevant view using the {% url %} tag. However, I also moved all of my views over to generic views, which has broken the url tags because I am no longer using the views.py file. Is there a way to use the url

Re: help, ORM memory problems

2008-11-26 Thread derek73
Thanks, DEBUG was my problem. totally forgot about that. On Nov 23, 4:50 pm, Doug B <[EMAIL PROTECTED]> wrote: > One thing that has bitten me more times than I care to remember is > forgetting to disable DEBUG in settings.py before processing large > datasets.  The SQL queries build up in

Re: Dynamic image creation

2008-11-26 Thread Aneurin Price
On Tue, Nov 25, 2008 at 9:04 PM, Jeff Anderson <[EMAIL PROTECTED]> wrote: > Aneurin Price wrote: >> Hello, >> >> I'd like to be able to generate images dynamically for a Django-based >> website, and I'm wondering how best to go about it. >> >> The idea is to do certain things to existing images,

Re: Reusable forms!

2008-11-26 Thread Alfonso
Got it working, it was because I thought I had to pass the seach form class as an argument to 'show_form'. That wasn't necessary. Taking a step back from your work does wonders :-) Thanks Alex On Nov 26, 10:59 am, "Alex Koshelev" <[EMAIL PROTECTED]> wrote: > Oh.. and what is the error you

Re: Reusable forms!

2008-11-26 Thread Alex Koshelev
Oh.. and what is the error you get? On Wed, Nov 26, 2008 at 13:39, Alfonso <[EMAIL PROTECTED]> wrote: > > Thanks Alex, > > I'm attempting to go the inclusion tag route but having difficulty > understanding how to get the form in place correctly. > > I've defind a simple form within forms.py: >

Re: Overriding contrib.auth User save()

2008-11-26 Thread Alex Koshelev
Of course you can monkey-patch the User model but the better way is to use signals pre_ or post_save On Wed, Nov 26, 2008 at 13:54, Paddy Joy <[EMAIL PROTECTED]> wrote: > > I would like to override the save() method on the contrib.auth User > model so that I can run a routine when a user is

Overriding contrib.auth User save()

2008-11-26 Thread Paddy Joy
I would like to override the save() method on the contrib.auth User model so that I can run a routine when a user is created/modified. Is this possible or do I need to use a signal? I have tried overriding the User model like this but it never seems to call my code: from

Re: Reusable forms!

2008-11-26 Thread Alfonso
Thanks Alex, I'm attempting to go the inclusion tag route but having difficulty understanding how to get the form in place correctly. I've defind a simple form within forms.py: class PropertySearch(forms.Form): name = forms.CharField(max_length=100, initial="Property name or Location")

Re: Access object in session from clean method in Form extending ModelForm

2008-11-26 Thread Daniel Roseman
On Nov 26, 8:07 am, vanosten <[EMAIL PROTECTED]> wrote: > Hi > > I need to do custom validation to make sure that a new record does not > pick the same title as a previous record. Therefore in my overriden > clean method in my custom Form (which extends ModelForm) I need to be > able to do either

Re: Django ORM and phpMyAdmin

2008-11-26 Thread Seth Kaïne
I'm learning about ORM, but it's not easy to understand the whole picture. I'm trying to create a "function" or a "filter" linked to my models.py or to PHPmyAdmin to give me a signal when something is changing. I'm making reseachs on signal on django, perhaps a solution to explore. If you have

  1   2   >