Re: problem with openid

2009-08-12 Thread Kenneth Gonsalves
On Thursday 13 Aug 2009 10:16:19 am Malcolm Tredinnick wrote: > On Thu, 2009-08-13 at 07:22 +0530, Kenneth Gonsalves wrote: > > hi, > > > > was trying out django_openidconsumer and get this error: > > > > complete() takes exactly 3 arguments (2 given) - I cannot figure it out > > as this is the

Re: save as a new entry

2009-08-12 Thread Ali Rıza Keleş
On Wed, 2009-08-12 at 15:55 -0700, Daniel Roseman wrote: > On Aug 12, 10:40 pm, Ali Rıza KELEŞ wrote: > > In admin interface, in editing section of a model, I need a button to > > save as a new entry. There are four button at the end of the editing > > form. > > - Delete,

Re: new session ID is created for every request from IE 7

2009-08-12 Thread Malcolm Tredinnick
On Wed, 2009-08-12 at 19:21 -0700, humble wrote: > Hi, > > I am writing a web application that involves session management with > the corporate backend module. I wrote my own authentication backend > plugin to satisfy the corporate requirement, not the default > authentication backend. I use

Re: problem with openid

2009-08-12 Thread Malcolm Tredinnick
On Thu, 2009-08-13 at 07:22 +0530, Kenneth Gonsalves wrote: > hi, > > was trying out django_openidconsumer and get this error: > > complete() takes exactly 3 arguments (2 given) - I cannot figure it out as > this > is the definition of complete: > > def complete(request, on_success=None,

Re: AutoRefresh model field (filled in by a trigger)

2009-08-12 Thread Malcolm Tredinnick
On Wed, 2009-08-12 at 04:55 -0700, Evgeny wrote: > Hi, > I have some fields in a model which are filled in by before_insert > trigger. > Is there any right way to autorefresh them after the object is > inserted, besides requesting a new instance of the object by > model.objects.get() method? You

raw sql Operational Error

2009-08-12 Thread adelaide_mike
Working in Django 1.0.2 with PostgreSQL backend the following produces an error: Operational Error at /report/agent_summary/ near "ON": syntax error The SQL works if run in pgadminIII but with %s replaced by "2009-01-01". Must be a newbie error somewhere. def agent_summary(request):

Admin Panel: Restrict ForeignKey selections via permissions

2009-08-12 Thread Mark Stahler
Can someone point me in the direction to best solve this problem. It would easier to show you: class Profile(models.Model): status = models.ForeignKey(Status) ... class Status(models.Model): status_name = models.CharField(max_length=50) ... I need to be able to restrict the

Re: Need for an internationalization/translation system not request-based

2009-08-12 Thread Malcolm Tredinnick
On Wed, 2009-08-12 at 15:48 +0200, Jarek Zgoda wrote: [...] > As translation.activate() is process-wide, this approach is not > safe in multithreaded environment if using static translation (not > request-based). This is not correct. The translation.activate() call is thread-specific and

Re: Inheritance at runtime (per model instance)

2009-08-12 Thread Malcolm Tredinnick
On Wed, 2009-08-12 at 14:24 +0200, Thomas Guettler wrote: > Hi Malcolm and others, > > Malcolm Tredinnick schrieb: [...] > > You already have the content type table for referring to other model > > objects. Why not use that so that you can maintain some referential > > integrity? > > Content

new session ID is created for every request from IE 7

2009-08-12 Thread humble
Hi, I am writing a web application that involves session management with the corporate backend module. I wrote my own authentication backend plugin to satisfy the corporate requirement, not the default authentication backend. I use file based session engine to avoid sqlite crap. Everything works

problem with openid

2009-08-12 Thread Kenneth Gonsalves
hi, was trying out django_openidconsumer and get this error: complete() takes exactly 3 arguments (2 given) - I cannot figure it out as this is the definition of complete: def complete(request, on_success=None, on_failure=None): any clues? the cut-and-paste view of the traceback is here:

Django Filter parser slightly less than intuitive

2009-08-12 Thread Mark Jones
{{ datevar|date: dateformat}} won't parse. You get the error: Could not parse the remainder: ': dateformat' from 'datevar|date: dateformat' Turns out that unlike most other places, spaces ARE significant here. It could be fixed by changing the filter_raw_string on line 448 of

Re: django-tinymce not appearing in admin

2009-08-12 Thread Kenneth Gonsalves
On Wednesday 12 Aug 2009 9:35:30 pm diogobaeder wrote: > Oops, sorry... it's version 1.1 final. > > I'll try to create the Media subclass with the media, then, although > it's not specified in the django-tinymce use documentation. > > About dpaste, I'm confused, because in another post I pasted

Re: Adding new object using form and inloine formset. Do I do it right?

2009-08-12 Thread Daniel Roseman
On Aug 12, 9:20 pm, Tomek wrote: > Hi, > > Question: Is there a better way of creating objects from formset > (children) without having to create and possibly delete object which > is referenced by them (parent) and which is being created on the same > page? > >

Re: save as a new entry

2009-08-12 Thread Daniel Roseman
On Aug 12, 10:40 pm, Ali Rıza KELEŞ wrote: > In admin interface, in editing section of a model, I need a button to > save as a new entry. There are four button at the end of the editing > form. > - Delete, > - Save and Add New, > - Save And Continue Editing, > - Save. > >

save as a new entry

2009-08-12 Thread Ali Rıza KELEŞ
In admin interface, in editing section of a model, I need a button to save as a new entry. There are four button at the end of the editing form. - Delete, - Save and Add New, - Save And Continue Editing, - Save. I want to save the currently editing entry as a new entry. For example: entry is:

Adding new object using form and inloine formset. Do I do it right?

2009-08-12 Thread Tomek
Hi, Question: Is there a better way of creating objects from formset (children) without having to create and possibly delete object which is referenced by them (parent) and which is being created on the same page? Here's my (simplified) models. It's basically an item with some pictures. It's

optional username registration

2009-08-12 Thread Dhruv Adhia
Hello, I have a registration system working and most of the code is pulled out from django code base. I would like to make username optional. Is there any shorter way? Thanks Dhruv --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

Re: Image handling - Custom image field?

2009-08-12 Thread TiNo
On Mon, Aug 3, 2009 at 12:53, Peter Bengtsson wrote: > > I would write a management command and let a cron job fire off to run > it. > See this for how to write management commands: > http://docs.djangoproject.com/en/dev/howto/custom-management-commands/ > > Then your cron job

RE: is Django a good choice for a LAN app?

2009-08-12 Thread Joseph Le Brech
I think you'll find it's called an intranet. I making an intranet project myself, the basics require no effort. it just the last 10% (im sure there's a lot more than 10%) that im getting to grips with it. I find it a lot quicker to develop with than rails, the admin panel kicks scaffolding's

Re: is Django a good choice for a LAN app?

2009-08-12 Thread Torsten Bronger
Hallöchen! snfctech writes: > One more question: Any advantage to just using a Python GUI > toolkit instead? Imagine you have a bug and you must update all clients ... Tschö, Torsten. -- Torsten Bronger, aquisgrana, europa vetus Jabber ID:

Re: More Than Two Models With inlineformset_factory

2009-08-12 Thread Matthias Kestenholz
On Wed, Aug 12, 2009 at 7:36 PM, Geraldo wrote: > > No, I mean two or more different forms.  I'd like Parent, Child1 AND > Child2 all in the same formset.  What you've suggested though, should > get me where I want to go. > Well, you can easily show the input fields from

Re: Location of Change User admin template

2009-08-12 Thread bfrederi
Thanks for the help. I accomplished my task. All of the links I posted were exactly what it took to make it work. -Brandon On Aug 12, 1:31 pm, bfrederi wrote: > I found > this:http://code.djangoproject.com/browser/django/trunk/django/contrib/adm... > So it looks like

ModelForm limit m2m choices

2009-08-12 Thread alain31
Hello, I have a model with m2m foreign key: Model1: field1 = models.ManytoManyField(Model2) field2 = ... and a ModelForm class MyForm(ModelForm) class Meta: model = Model1 How can I use a custom QuerySet for the choices of field1 ? I tried to pass a dictionary in dic = {field:

Can't find doc for this - concerning buildout

2009-08-12 Thread LeeRisq
Hi all, I just want to install buildout for use with my Django app, but I get an error that I can't find any documentation for. Here is what I am running: C:\somedirectory>easy_install zc.buildout This is what happens: Searching for zc.buildout Reading

ModelForm limit m2m choices

2009-08-12 Thread alain31
Hello, I have a model with m2m foreign key: Model1: field = models.ManytoManyField(Model2) and a ModelForm class MyForm(ModelForm) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to

Re: Filter based on dates

2009-08-12 Thread When ideas fail
Thanks, i'd just worked that out, was about to come and post it. Thanks though. On 12 Aug, 20:23, Dj Gilcrease wrote: > On Wed, Aug 12, 2009 at 12:02 PM, When ideas > > fail wrote: > > def months_archive(request, year, month): > >    blog_posts

Re: is Django a good choice for a LAN app?

2009-08-12 Thread snfctech
Thanks, Jonas. And do you think Django's ORM will be able to handle my multiple DB connections, with read/write fields from different DB producs/ servers on the same view (most of which will hopefully be ODBC compliant, but some might not)? On Aug 12, 11:32 am, Jonas Obrist

Re: Filter based on dates

2009-08-12 Thread Dj Gilcrease
On Wed, Aug 12, 2009 at 12:02 PM, When ideas fail wrote: > def months_archive(request, year, month): >    blog_posts = Post.objects.all().order_by("-post_date") blog_posts = Post.objects.filter(post_date__year=year, post_date__month=month).order_by("-post_date")

Re: is Django a good choice for a LAN app?

2009-08-12 Thread Jonas Obrist
In my opinion writing it in django/html/... is a lot easier and faster than doing it in a real python GUI tool. Also you have the networking in your LAN taken care of by the browser. snfctech wrote: > One more question: Any advantage to just using a Python GUI toolkit > instead? > > On Aug

Re: Location of Change User admin template

2009-08-12 Thread bfrederi
I found this: http://code.djangoproject.com/browser/django/trunk/django/contrib/admin/options.py#L192 So it looks like it will allow me to override the template here: http://code.djangoproject.com/browser/django/trunk/django/contrib/admin/options.py#L586 So if I can override this effectively:

Re: is Django a good choice for a LAN app?

2009-08-12 Thread snfctech
One more question: Any advantage to just using a Python GUI toolkit instead? On Aug 12, 9:18 am, snfctech wrote: > Thanks for all of the good feedback! > > At the very least I am enthusiastic about the health of this list! ;-) > > @Philippe: By mid-size I mean ~70

Filter based on dates

2009-08-12 Thread When ideas fail
Hello, if i have this view: def months_archive(request, year, month): blog_posts = Post.objects.all().order_by("-post_date") ... how can i filter the post objects by date? I have a field post_date which is a datetime field, and i need it to return all the posts written

Re: More Than Two Models With inlineformset_factory

2009-08-12 Thread Geraldo
No, I mean two or more different forms. I'd like Parent, Child1 AND Child2 all in the same formset. What you've suggested though, should get me where I want to go. Thanks again, Gerry On Aug 12, 12:53 am, Matthias Kestenholz wrote: > On Wed, Aug 12, 2009 at

Re: solved: Need help with filter, limit and order_by query

2009-08-12 Thread cerberos
On Aug 13, 12:06 am, cerberos wrote: > On Aug 12, 11:52 pm, Alex Gaynor wrote: > > > > > On Wed, Aug 12, 2009 at 11:49 AM, cerberos wrote: > > > > Say there are 10 records, I want records 3 & 4 in descending order. > > > > q1 =

solved: Need help with filter, limit and order_by query

2009-08-12 Thread cerberos
On Aug 12, 11:52 pm, Alex Gaynor wrote: > On Wed, Aug 12, 2009 at 11:49 AM, cerberos wrote: > > > Say there are 10 records, I want records 3 & 4 in descending order. > > > q1 = ModelName.objects.order_by('id').filter(id__gte=3)[:2] # gives > > the

Re: Strange problem with LDAP authentication backend

2009-08-12 Thread stupidgeek
David, you are a champ, thank you. I find it strange that this made the difference, since this line is in the docs: "The get_user method takes a user_id -- which could be a username, database ID or whatever -- and returns a User object." But, making the change to user_id worked just fine. For

Re: Need help with filter, limit and order_by query

2009-08-12 Thread Alex Gaynor
On Wed, Aug 12, 2009 at 11:49 AM, cerberos wrote: > > Say there are 10 records, I want records 3 & 4 in descending order. > > q1 = ModelName.objects.order_by('id').filter(id__gte=3)[:2] # gives > the records I want but in ascending order > q2 =

Need help with filter, limit and order_by query

2009-08-12 Thread cerberos
Say there are 10 records, I want records 3 & 4 in descending order. q1 = ModelName.objects.order_by('id').filter(id__gte=3)[:2] # gives the records I want but in ascending order q2 = ModelName.objects.order_by('-id').filter(id__gte=3)[:2] # gives the last 2 records (9 & 10) in correct order q3 =

Re: Location of Change User admin template

2009-08-12 Thread bfrederi
I think you are right that a ModelAdmin definition must exist for it. But I have been digging for it and can't seem to find it. I am seeking to place a button on that page that will allow the user to update the permissions the user can have. I have a function written in my model that creates

Re: django-tinymce not appearing in admin

2009-08-12 Thread Karen Tracey
On Wed, Aug 12, 2009 at 12:05 PM, diogobaeder wrote: > > Oops, sorry... it's version 1.1 final. > > I'll try to create the Media subclass with the media, then, although > it's not specified in the django-tinymce use documentation. > > About dpaste, I'm confused, because in

Re: Strange problem with LDAP authentication backend

2009-08-12 Thread David De La Harpe Golden
stupidgeek wrote: > def get_user(self, username): > try: >user = User.objects.get(username=username) >print user >return user > except User.DoesNotExist: > return None > Note part of the auth backend protocol AFAICS involves

Re: is Django a good choice for a LAN app?

2009-08-12 Thread snfctech
Thanks for all of the good feedback! At the very least I am enthusiastic about the health of this list! ;-) @Philippe: By mid-size I mean ~70 people in a retail business (~$500K/ sales/week). Sounds like the community feels Django is a good choice for my type of project. Thanks! On Aug 12,

Re: Ticket #7539 (ON DELETE suppor) in Django 1.2?

2009-08-12 Thread Michael Glassford
Sorry, please ignore this post: it was supposed to go to the django developers group. Mike Michael Glassford wrote: > http://code.djangoproject.com/ticket/7539 suggests a way to add On > Delete and On Update support to Django foreign key fields, and includes > a patch that implements the

Re: Strange problem with LDAP authentication backend

2009-08-12 Thread stupidgeek
Hi Peter, Thanks for your input, but I am afraid to say that you are indeed wrong =( Ha. The user that I am trying to login as (me) has superuser premissions; by no errors, I mean that I get a plain login form - no red box telling me something went wrong. Thanks again for the input, and I'll

Re: django-tinymce not appearing in admin

2009-08-12 Thread diogobaeder
Oops, sorry... it's version 1.1 final. I'll try to create the Media subclass with the media, then, although it's not specified in the django-tinymce use documentation. About dpaste, I'm confused, because in another post I pasted exception content and someone advised me to use dpaste to make the

Ticket #7539 (ON DELETE suppor) in Django 1.2?

2009-08-12 Thread Michael Glassford
http://code.djangoproject.com/ticket/7539 suggests a way to add On Delete and On Update support to Django foreign key fields, and includes a patch that implements the suggestions. At the time I submitted it, getting Django 1.1 out the door prevented it from being seriously considered, but now

Use unicode character as variable in template.

2009-08-12 Thread timesong
In Django template, there is a very nice feature, we can use unicode character variable in template, for example: {% for article in 文章列表 %} {{ article.title }} {% endfor %} In this way, if you didn't define 文章列表 in context, it'll raise an exception: Caught an exception while rendering: 'ascii'

override _display_login_form

2009-08-12 Thread Davo
Hi I am trying to override the _display_login_form from http://code.djangoproject.com/browser/django/trunk/django/contrib/admin/views/decorators.py So basicly I have the following code -- from django.http import

Strange problem with LDAP authentication backend

2009-08-12 Thread stupidgeek
Hi all, I'm having a strange problem. I wrote a basic LDAP backend, to authenticate users against our open directory server: from django.contrib.auth.models import User import ldap import ldap.sasl class LDAPBackend: def authenticate(self, username=None, password=None): if username

Re: Need for an internationalization/translation system not request-based

2009-08-12 Thread Andrea Zilio
I'm sorry, can you explain a little bit this problem? Or where I can get info about it? On Aug 12, 3:48 pm, Jarek Zgoda wrote: > Wiadomość napisana w dniu 2009-08-12, o godz. 13:00, przez Enrico   > Sartorello: > > > i'm facing a problem developing with Django a Web

Re: syncdb with ForeignKey to_field outputs statements in wrong order

2009-08-12 Thread physicsnick
Hmm. It seems to be database-specific. PostgreSQL and Oracle require that foreign key references be unique, while MySQL and SQLite do not (although for SQLite that's mainly due to it not actually implementing foreign key constraints). The MySQL documentation has this to say: >> Additionally,

Re: problem with the delete()

2009-08-12 Thread Karen Tracey
On Wed, Aug 12, 2009 at 10:44 AM, Lokesh wrote: > > Hi Karen, > > Provided the details below. > Here is the Traceback and Django version is 1.2 I assume you mean SVN trunk? 1.2 is in early "what might go in it" stage, it's far from being a released version. > > >

Re: DateInput widget, format attr & ugettext

2009-08-12 Thread carsten
Thanks, Malcolm! I filed the ugettext_lazy problem under #11701 and attached a patch that fixes it by using force_unicode() on the format in DateWidget. FWIW, users could also workaround this thing by using their forms __init__, like so: def __init__(self, *args, **kwargs):

Re: problem with the delete()

2009-08-12 Thread Lokesh
Hi Karen, Provided the details below. Here is the Traceback and Django version is 1.2 Traceback (most recent call last): File "", line 1, in File "c:\Python25\lib\site-packages\django\db\models\query.py", line 395, in delete object._collect_sub_objects(seen_objs) File

Re: Django aggregates and having

2009-08-12 Thread Alex Gaynor
On Wed, Aug 12, 2009 at 1:34 AM, lfrodrigues wrote: > > Sorry I didn't explain my self properly. > > I want this query: > SELECT (date_format(date, '%%U')) AS `d`, SUM > (`profile_scorehistory`.`points`) AS `l` FROM `profile_scorehistory` > GROUP BY date_format(date, '%%U')

Re: problem with the delete()

2009-08-12 Thread Karen Tracey
On Wed, Aug 12, 2009 at 9:58 AM, Lokesh wrote: > > Hi, > > Need help in understanding the relation between models and delete > operations. > Here is my model > > class UserBasicDetails(models.Model): >user_id = models.OneToOneField(User, primary_key=True, >

Re: IntegrityError!!!

2009-08-12 Thread Karen Tracey
On Wed, Aug 12, 2009 at 8:03 AM, rekha wrote: > > Hi all, > im a newbie, developing online address book application using django, > mod_python, apache2, postgresql. > > i have two tables in my database viz login_table and contact_table.. > login_table stores username

problem with the delete()

2009-08-12 Thread Lokesh
Hi, Need help in understanding the relation between models and delete operations. Here is my model class UserBasicDetails(models.Model): user_id = models.OneToOneField(User, primary_key=True, to_field='username', parent_link=True) place = models.CharField(null=False,

Re: password encryption not working...

2009-08-12 Thread Karen Tracey
On Wed, Aug 12, 2009 at 7:50 AM, rekha wrote: > > Hi all, > im a newbie, developing a django online address book application. > using mod_python, apache2, postgresql for database. > > i have two tables in my database viz login_table and contact_table.. > login_table

Re: Need for an internationalization/translation system not request-based

2009-08-12 Thread Jarek Zgoda
Wiadomość napisana w dniu 2009-08-12, o godz. 13:00, przez Enrico Sartorello: > i'm facing a problem developing with Django a Web Application: in > response to some events (for example, after an admin action) i need to > send emails to some users of my site. > > The problem arises when i want

DjangoCon '09 Schedule

2009-08-12 Thread Robert Lofthouse
Hi All, You can purchase tickets for the conference here - http://djangocon09.eventbrite.com We have released the DjangoCon Schedule at: http://www.djangocon.org/2009/conference/schedule/ and will be releasing more information over the next day or two. DjangoCon is on 8th - 12th September in

Re: Model example for simple family tree

2009-08-12 Thread sniper
It works!! Thanks On Aug 11, 7:44 pm, Mike Dewhirst wrote: > sniperwrote: > > Hi, > > I am new to django and wanted to try it out. > > > I would like to create a table for family tree > > where Relation is a many to many table which contains Profile ids > > > profile_id,

Re: Need for an internationalization/translation system not request-based

2009-08-12 Thread Torsten Bronger
Hallöchen! Enrico Sartorello writes: > [...] > > Roughly speaking i need (at least) a way to manually decide which > is the language to apply for translations. I had the same problem. My solution (not in Django) can be seen at

Quick Newbie Question - reverse ManyToMany in admin site

2009-08-12 Thread ben
Hi all, I've got a model with a plain many-to-many relationship (no intermediate model) and want to edit the relationships in the admin site. By default the multiple select box only appears on the admin page for the model that defined it, however I'd like to be able to modify the relationships

Re: Concurrent Web Access and Edits

2009-08-12 Thread Ben Moran
On Tue, Aug 11, 2009 at 10:14 PM, Doug Blank wrote: > New Django user here with a question about the client side: Is there > built-in support for dealing with concurrent edits? ... > Maybe you want the Django condition decorator, which lets you use HTTP headers to send

Need for an internationalization/translation system not request-based

2009-08-12 Thread Enrico Sartorello
Hi all, i'm facing a problem developing with Django a Web Application: in response to some events (for example, after an admin action) i need to send emails to some users of my site. The problem arises when i want these emails to be translated in any user-specific language: the Request object i

Re: Inheritance at runtime (per model instance)

2009-08-12 Thread Thomas Guettler
Hi Malcolm and others, Malcolm Tredinnick schrieb: > On Wed, 2009-08-12 at 11:39 +0200, Thomas Guettler wrote: >> Hi, >> >> I am writing a workflow engine. The base workflow is stored in the DB. >> But some code needs to written for most workflows. >> >> This means I need code for a model

Re: is Django a good choice for a LAN app?

2009-08-12 Thread Philippe Raoult
I don't know what you mean by mid-sized but I deployed exactly what you're describing in a 45-strong company. We have occasional browser incompatibilities with ajax but overall django was very much the right tool for the job. As a bonus the company's clients can now access a restricted part of

IntegrityError!!!

2009-08-12 Thread rekha
Hi all, im a newbie, developing online address book application using django, mod_python, apache2, postgresql. i have two tables in my database viz login_table and contact_table.. login_table stores username and password.. contact table stores first name, last name, phone number, email id..

AutoRefresh model field (filled in by a trigger)

2009-08-12 Thread Evgeny
Hi, I have some fields in a model which are filled in by before_insert trigger. Is there any right way to autorefresh them after the object is inserted, besides requesting a new instance of the object by model.objects.get() method? --~--~-~--~~~---~--~~ You

password encryption not working...

2009-08-12 Thread rekha
Hi all, im a newbie, developing a django online address book application. using mod_python, apache2, postgresql for database. i have two tables in my database viz login_table and contact_table.. login_table stores username and password.. contact table stores first name, last name, phone number,

Re: Concurrent Web Access and Edits

2009-08-12 Thread Russell Keith-Magee
On Tue, Aug 11, 2009 at 10:14 PM, Doug Blank wrote: > > New Django user here with a question about the client side: Is there > built-in support for dealing with concurrent edits? I'm not referring > to the database issues (locking, etc) but is there Django support for >

Re: inspectdb and postgresql schema

2009-08-12 Thread Russell Keith-Magee
On Wed, Aug 12, 2009 at 6:09 PM, Marek Pietrucha wrote: > > Thank you for the anwser :) > > It's not comforting but now I don't have to dig the whole google > achieve ;) > > In this case, how do I construct django models? I don't want to seem rude, but we provide an

Re: inspectdb and postgresql schema

2009-08-12 Thread Marek Pietrucha
Thank you for the anwser :) It's not comforting but now I don't have to dig the whole google achieve ;) In this case, how do I construct django models? best regards, Mark --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Re: Inheritance at runtime (per model instance)

2009-08-12 Thread Malcolm Tredinnick
On Wed, 2009-08-12 at 11:39 +0200, Thomas Guettler wrote: > Hi, > > I am writing a workflow engine. The base workflow is stored in the DB. > But some code needs to written for most workflows. > > This means I need code for a model instance (an not code per mode class). > > To make this most

Re: logic in templates

2009-08-12 Thread elminio
Thanks, And what if I want to use another thiord or maybe even fourth item customers sellers products Im new in python so thanks for help On Aug 12, 11:17 am, David Zhou wrote: > The easiest way is probably moving that list to the view.  For example > > customers =

Inheritance at runtime (per model instance)

2009-08-12 Thread Thomas Guettler
Hi, I am writing a workflow engine. The base workflow is stored in the DB. But some code needs to written for most workflows. This means I need code for a model instance (an not code per mode class). To make this most pythonic, how could this be done? My idea: since I want the workflow to be

Re: Ajax in Django

2009-08-12 Thread Jorge Bastida
I' currently working in/with Dajax. http://code.google.com/p/dajaxproject/ I hope it helps you. -- neo2001[at]gmail.com jorge[at]thecodefarm.com neo[at]art-xtreme.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Re: Ajax in Django

2009-08-12 Thread Malcolm Tredinnick
On Wed, 2009-08-12 at 11:47 +0300, Jani Tiainen wrote: > HB kirjoitti: > > Hey, > > Why Django doesn't provide integration with Ajax out of the box (like > > Rails and Wicket)? > > It all depends what you mean by "integration"? > > You can use (model)forms with Ajax, or use any other means if

Re: logic in templates

2009-08-12 Thread David Zhou
The easiest way is probably moving that list to the view. For example customers = Customer.objects... sellers = Seller.objects... filtered_list = [pair for pair in zip(sellers, customers) if pair[0].customer_id == pair[1].id] Then pass filtered_list into the template context. Inside the

Re: Deploying django on apache - cant access database

2009-08-12 Thread Graham Dumpleton
On Aug 12, 3:43 pm, consiglieri wrote: > Thanks Graham! > > The absolute path was the issue. Can't believe I couldnt find that > anywhere. > > As for the Alias, well i was just testing to make sure that wasnt an > issue.And its in the httpd.conf , for perl-cgi you need

logic in templates

2009-08-12 Thread elminio
Hello, Common task in template is doing for loop end inserting into html some elements. for example 1: {% for seller in sellers %} 2:{% for customer in customers %} 3:{% ifequal seller.customer_id customer.id %} 4:{{ seller.name }} {{ customer.name }} 5:{%

Re: Ajax in Django

2009-08-12 Thread Jani Tiainen
HB kirjoitti: > Hey, > Why Django doesn't provide integration with Ajax out of the box (like > Rails and Wicket)? It all depends what you mean by "integration"? You can use (model)forms with Ajax, or use any other means if you wish. Only thing that django doesn't provide is Ajax form rendering

Re: django 0.96.4 does not has django.utils._os

2009-08-12 Thread Russell Keith-Magee
On Wed, Aug 12, 2009 at 12:48 PM, dongua wrote: > after i download ] > http://code.djangoproject.com/browser/django/branches/0.96-bugfixes/django/utils/_os.py > and runserver: > > Development server is running at http://127.0.0.1:8000/ > Quit the server with CTRL-BREAK. >

Ajax in Django

2009-08-12 Thread HB
Hey, Why Django doesn't provide integration with Ajax out of the box (like Rails and Wicket)? Thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: dates with a different format in the db

2009-08-12 Thread Vokial
Thanks a lot! I'll try both the string filters and read carefully that part of the documentation.. eventually i'll try to create a custom subclass. Again you've been very helpful, thanks Malcolm! --~--~-~--~~~---~--~~ You received this message because you are

Re: dates with a different format in the db

2009-08-12 Thread Malcolm Tredinnick
On Wed, 2009-08-12 at 00:24 -0700, Vokial wrote: > You've been very helpful, thanks. > The problem here is that i have to use these fields as proper > DateFields because i have to do some operations with these dates, like > making monthly/daily reports, searching entries in a specific period > of

Re: translation issue

2009-08-12 Thread Torsten Bronger
Hallöchen! alecs writes: > Thanks :)) Sorry, a silly question :) Not at all. The sources of Gajim used to be full of such mistakes, and it was difficult to get the problem across. ;-) Tschö, Torsten. -- Torsten Bronger, aquisgrana, europa vetus Jabber ID:

Re: unique_together with None

2009-08-12 Thread Malcolm Tredinnick
On Tue, 2009-08-11 at 23:36 -0700, gentlestone wrote: > Thank you for the explanation. Seems to be the correct solution of the > problem (NULL, v1) != (NULL, v1) is overwrite the save method and > check for existence of (NULL, v1) before saving a new instance of > (NULL, v1). What I don't

Re: translation issue

2009-08-12 Thread alecs
Thanks :)) Sorry, a silly question :) --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send

Re: translation issue

2009-08-12 Thread Torsten Bronger
Hallöchen! alecs writes: > from django.utils.translation import ugettext as _ > raise forms.ValidationError(_('%(email)s is not a valid e-mail > address.' % {'email': email})) It must be raise forms.ValidationError(_('%(email)s is not a valid e-mail address.') % {'email': email}) Tschö,

translation issue

2009-08-12 Thread alecs
from django.utils.translation import ugettext as _ raise forms.ValidationError(_('%(email)s is not a valid e-mail address.' % {'email': email})) #: helpers.py:30 #, python-format msgid "%(email)s is not a valid e-mail address." msgstr "%(email)s не верный формат e-mail адреса." Everything

Re: dates with a different format in the db

2009-08-12 Thread Vokial
You've been very helpful, thanks. The problem here is that i have to use these fields as proper DateFields because i have to do some operations with these dates, like making monthly/daily reports, searching entries in a specific period of time and so on... I guess i have to convert these strings

Re: More Than Two Models With inlineformset_factory

2009-08-12 Thread Matthias Kestenholz
On Wed, Aug 12, 2009 at 12:51 AM, Geraldo wrote: > > Excellent, Matthias...  That should work nicely.  It does appear, > however, that there is no way to have more than 2 forms in a single > formset.  If inlineformset_factory had an append method things might > be a bit

Re: unique_together with None

2009-08-12 Thread gentlestone
Thank you for the explanation. Seems to be the correct solution of the problem (NULL, v1) != (NULL, v1) is overwrite the save method and check for existence of (NULL, v1) before saving a new instance of (NULL, v1). What I don't understand, why are the well-known databases so stupid and why they

Re: Django aggregates and having

2009-08-12 Thread lfrodrigues
Sorry I didn't explain my self properly. I want this query: SELECT (date_format(date, '%%U')) AS `d`, SUM (`profile_scorehistory`.`points`) AS `l` FROM `profile_scorehistory` GROUP BY date_format(date, '%%U') HAVING `d`= 2 How can I make it with ORM? The other one was the only similar query I