TransactionMiddleware and SessionMiddleware

2008-12-10 Thread Thomas Guettler
1. All DB changes are rolled back by TransactionMiddleware (proccess_exception()) 2. Debug-Response is returned. All middleware methods are called: SessionMiddleware.process_response() --> commit_unless_managed() --> session gets saved to DB, since the connection is no longer managed. Is th

Using Django authentication for phpBB

2008-12-10 Thread Giles Thomas
e) [2] so that other people can use it, but for anyone who's interested, I've described how it works in a blog post [3]. Any comments very welcome! Cheers, Giles [1] http://www.resolversystems.com/ [2] http://code.google.com/p/django-login-for-phpbb/ [3] http://www.gilesthomas.com/?p=

Re: Using Django authentication for phpBB

2008-12-11 Thread Giles Thomas
Hi all, All of the code to support Django logins for phpBB is now up available in a Google code project: http://code.google.com/p/django-login-for-phpbb/ Drop me a line if you find it useful or have any questions. Cheers, Giles Giles Thomas wrote: > Hi all, > > I've wri

auth: get_profile(): create if it does not exist.

2008-12-17 Thread Thomas Guettler
all fields of my profile model have default values, it could be created it on the fly. Since I don't want to run a modified django, I will use my own get_profile method. Does some know this problem? How do you solve this? Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E

Re: TimeSpan, Latitude, Longitude field classes for Models

2008-12-17 Thread Thomas Guettler
www.djangosnippets.org/snippets/1060/ You should look at the python documentation of datetime.timedelta, too. Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de --~--~-~--~~~---~--~~ You received this message beca

Re: auth: get_profile(): create if it does not exist.

2008-12-17 Thread Thomas Guettler
except SomeModel.DoesNotExist: ... or m, created = SomeModel.objects.get_or_create(pk=request.user) To my original question: Yes, I will use a signal handler to create the profiles. Thank you for your answers (Milian Andric). Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E

Re: Using Django authentication for phpBB

2008-12-29 Thread Giles Thomas
Grigory Fateyev wrote: > It was written for phpbb3? > Hi Grigory, Yes, it was. I have it running under one of the later phpBB 3 release candidates, but it should be fine with 3.0 final. Cheers, Giles -- Giles Thomas MD & CTO, Resolver Systems Ltd. giles.tho...@resolversyste

Re: Using Django authentication for phpBB

2008-12-29 Thread Giles Thomas
I don't think it would be easy to get it working for 2.0. However, I may well be wrong. Cheers, Giles -- Giles Thomas MD & CTO, Resolver Systems Ltd. giles.tho...@resolversystems.com +44 (0) 20 7253 6372 Try out Resolver One! <http://www.resolversystems.com/get-it/> 17a Cle

db_index name clashes with table name

2009-01-06 Thread Thomas Guettler
odels/fields/#db-index Thomas DB: Postgres 8.2 -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" gr

Re: Shouldn't get_profile() create the profile object?

2009-01-08 Thread Thomas Guettler
the handler, if created=True, create the associated user profile. + Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

post_syncdb signal: Called several times

2009-01-14 Thread Thomas Guettler
callback method the way, that it can be called several times (for example: check if change was already done before changing something) Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de --~--~-~--~~~---~--~~ You

Re: Getting a 'too many values to unpack' error

2009-01-14 Thread Thomas Guettler
7;]) & Q > (sandp__price__name__gte=request.GET['minprice'])) > styles = styles.select_related().filter(a) ### This is the > line that is giving me the error!! > > Whenever I do a search where the user enters a minimum price and > selects a sizeI get the error: &

Re: Transactions not working

2009-01-14 Thread Thomas Guettler
yourapp_yourmodel_id_seq ; Thomas thomasbecht...@googlemail.com schrieb: > Hi all, > > Problem: I want to use Transaction to save data to a postgresql-db. > Error: IntegrityError: doppelter Schlüsselwert (double keyvalue) > verletzt (harm) Unique-Constraint > ... -- Thomas Guettler,

Re: simple python question

2008-08-21 Thread Thomas Kerpe
results.append({'URL': '/feed/%s/show/%s' % (item.rss, item.rssfeed),}) On Thu, Aug 21, 2008 at 23:29, Bobby Roberts <[EMAIL PROTECTED]> wrote: > > hi. > > I'm trying to figure out how to dynamically replace things in a string > as follows: > > >results.append({'URL': '/feed/%s/show/%s' (%ite

Wiki/CMS app?

2008-08-26 Thread Thomas Guettler
ccess control is no issue for me. All users can edit everything. - liberal licence (at best BSD-like) - of course: Django based. is there already something like this? Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler

Re: Wiki/CMS app?

2008-08-27 Thread Thomas Guettler
that it's far from being mature or production ready, but is usable and > I'm actively working on it. (I only started development about 2 or 3 > weeks ago.) > > See http://launchpad.net/timiki for getting the code. It's only in a > bzr repository for now as it's not

Re: Wiki/CMS app?

2008-08-27 Thread Thomas Guettler
ed or hacked somehow. How can you upload files? Thomas Tim Kersten schrieb: > Yes, quite correct, it doesn't require a database. I wanted to keep > the requirements as minimal as possbile and thought it would be good > to let something designed for keeping revisions do the heavy lifting

Double Slash in URL

2008-09-08 Thread Thomas Guettler
7;^', include('myapp.urls')), }}} myapp.urls {{{ urlpatterns = patterns('', (r'^test/$', 'modwork.views.test.index'), }}} -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de --~--~-~--~~~---~--~--

Introducing django-cms

2008-09-08 Thread Thomas Steinacher
ge on http://django-cms.org/. There is also a demo site set up which allows you to play around with the admin interface. The software is still in development and we would appreciate any feedback and contributions. Greetings from Switzerland, Thomas Steinacher djangohosti

Re: Introducing django-cms

2008-09-08 Thread Thomas Steinacher
ntegration? Like integrating other applications (e.g. a gallery) into the CMS? We're still looking for a good solution to do that (e.g. by providing an API which allows to write a CMS plugin which would allow to integrate a third-party app directly into the CMS). Thomas Steinacher djangohostin

always rollback decorator

2008-09-09 Thread Thomas Guettler
soon is the commit_on_success decorator sends COMMIT. I guess I need to convert all commit_on_success decorators to a new commit_on_success_unless_inside_transaction decorator. Any idea how to solve this? Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-gue

Hierarchical Tagging

2008-09-09 Thread Thomas Guettler
Hi, django-tagging looks nice, but I need to have hierarchical tags: animal / bird / eagle Any idea: Hack/Update django-tagging, create own, use django-??? Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de

Re: When can you call urlresolvers.reverse()?

2008-09-09 Thread Thomas Guettler
erse(*args, **kwargs): return lazy_string(urlresolvers.reverse, *args, **kwargs) }}} from lazy import reverse instead of from django.core.urlresovlers import reverse HTH, Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-gue

Re: Persistent Global Imports

2008-09-10 Thread Thomas Guettler
my view files for > *every* request, which makes the application unusably slow. > Please post your wsgi configuration. Do you have something like maximum-requests=1? Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (

Re: get_absolute_url gotcha

2008-09-10 Thread Thomas Guettler
" does not necessarily mean what it says. The error message is > also displayed if there is an error in the the method. > -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de --~--~-~--~~~---~--~~ You rece

Re: Persistent Global Imports

2008-09-11 Thread Thomas Guettler
HI, Maybe your apache starts a new child for every request? ... -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Decoupling authorization from view

2008-09-11 Thread Thomas Guettler
ccess this view and a small middleware to render "403 forbidden" pages. Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de --~--~-~--~~~---~--~~ You received this message because you are subscribed

Re: ***SPAM*** A trick to force autoreloading, in case of changes in views.py

2008-09-12 Thread Thomas Guettler
Hi, I use apache mod_wsgi (WSGIDaemonProcess) and for development maximum-requests=1. This way I don't need to change any code for reloading: Just hit ctrl-r (reload in firefox). Thomas n00m schrieb: > 1. > Rename views.py to (say) views_base.py > > 2. > Create a new

Re: A trick to force autoreloading, in case of changes in views.py

2008-09-15 Thread Thomas Guettler
string to the subject. I just hit reply without removing it. Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups &qu

Re: basic http authentication in API

2008-09-15 Thread Thomas Guettler
mark schrieb: > Hi All, > > i'am writing API for a service and i want to use basic http > authentication for my service users. > > I use this: http://code.djangoproject.com/ticket/689 HTH, Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (

Admin: ManyToMany: SelectMultiple on both Admin Pages

2008-09-16 Thread Thomas Guettler
. Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, sen

Re: How to View Raw Generated SQL

2008-09-25 Thread Thomas Guettler
Hi, maybe the SQLLogMiddleware snippet helps you: http://www.djangosnippets.org/snippets/344/ Thomas Güttler Chris schrieb: > I'm trying to debug a usage of callproc, which doesn't return any rows > when used inside Django. Is there anyway to view the SQL and escaped >

Re: nested applications and syncdb question

2008-09-25 Thread Thomas Guettler
from myclass import MyClass file myclass.py: class MyClass(models.Model): class Meta: app_label='myapp' HTH, Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de --~--~-~--~~~---~--~~ You

AdminDateWidget outside admin

2008-09-26 Thread Thomas Guettler
After adding widgets.css it works. Is this a bug or an undocumented feature? Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

DateField range searches

2008-09-29 Thread Thomas Guettler
end)) Maybe this snippet helps someone. I guess it would be too much magic to change django, that range searches with dates values on datetime columns get automatically expanded. Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de --~--~-

Re: How to process 1 form data to another form??

2008-09-30 Thread Thomas Guettler
T parameter: http://.../myview?mail_id=1&mail_id=2 In myview: request.GET.getlist('mail_id') --> ['1', '2', ...] HTH, Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de --~--~-~--~~

reverse() outside HTTP-Context (SCRIPT_NAME)

2008-10-02 Thread Thomas Guettler
only returns '/myview/'. Is this a bug in the docs, code or in my brain? docs for reverse(): http://docs.djangoproject.com/en/dev/topics/http/urls/#reverse Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-gue

Re: reverse() outside HTTP-Context (SCRIPT_NAME)

2008-10-02 Thread Thomas Guettler
k (and adds the http://servername/) should be callable within http context, too. I can live with the current algorithm. But maybe the documentation of reverse() could be enhanced. Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-gu

Problems with dumpdata/loaddata

2008-10-02 Thread Gary Thomas
I'm trying to use the admin interface to dump & restore my database, without much luck. I can dump the data fine, but I've had no success loading it back in. Could someone list the commands to do this? The actual commands is what I'm looking for (not present in the docs) - something that I can

Re: pdf file generated problem

2008-10-07 Thread Thomas Guettler
eption - Why do you use HttpResponse for the canvas? You could use cStringIO or a tempfile. - Please post the traceback, if you ask for help. It shows where the root of the problem is. Thomas laspal schrieb: > Hi, > I am trying to generate pdf file and send the generated file by mail > to

Re: SQL: Migration How To?

2008-10-07 Thread Thomas Guettler
diff orig.sql new.sql Now you need to now a little SQL to write the correct "ALTER TABLE ..." statements. But must of the time it is not that difficult. HTH, Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli

Re: pdf file generated problem

2008-10-07 Thread Thomas Guettler
Hi. what is "attach"? It is StringIO object. And these objects don't have a name attribute. try this: mail.attach('mypdfname.pdf', attach.get_value(), 'application/pdf') HTH, Thomas laspal schrieb: > ok I can use cStringIO for it but my r

Re: What happened to django.core.validators

2008-10-08 Thread Thomas Guettler
meppum schrieb: > Is there an equivalent? > > > This page explains form and field validation: http://docs.djangoproject.com/en/dev/ref/forms/validation/ HTH, Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-g

Re: test client post exception due to cStringIO

2008-10-09 Thread Thomas Guettler
means data should be a string. StringIO({1: 'one'}) does not fail. But I guess it will not bring the desired result. If you care, you could write a patch that includes assert isinstance(data, basestring), 'Need a string %r' % data before post_data = data. HTH, Thomas > H

Re: Learning Django

2008-10-10 Thread Thomas Guettler
first. If you have read and understood the python tutorial, you can ask yourself (or google) if you want to try postgres instead of mysql. If this is solved, install your favorite database and open your web browser: http://docs.djangoproject.com/en/dev/ HTH, Thomas -- Thomas Guettler, ht

Re: newbie question about breadcrumbs

2008-10-10 Thread Thomas Guettler
.org/snippets/1026/ Of course it only works for views that you created. It does not change the breadcrumbs of the admin page. Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de --~--~-~--~~~---~--~~ You received t

Re: Development server serves media from wrong directory

2008-10-10 Thread Thomas Guettler
Hi, > MEDIA_URL = 'D:/workspace/isiscore/media/ That's not a URL. A URL looks like 'http://myserver/' or '/media/' Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de --~--~-~--~~~-

Re: DB record retrieval from every N minutes

2008-10-15 Thread Thomas Guettler
ch result into SQL's BETWEEN: You can use datetime.timedelta(minutes=fudge_minutes) to compute the start and end times of your target time. http://docs.djangoproject.com/en/dev/ref/models/querysets/#range On unix you would set up a cron-job which gets called very N minutes. Does this help you

How to use class_prepared signal

2008-10-16 Thread Thomas Guettler
self and the entry in the permission table is not done yet..... Any suggestions? Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Goo

Re: maximum recursion depth exceeded ???

2008-10-20 Thread Thomas Guettler
; you call login() inside login(): > def login(request ,template_name): > ... > login(request, v) > I guess you mean user.login() HTH, Thomas -- Thomas Guettler, http://www.thom

Re: missing template for admin

2008-10-20 Thread Thomas Guettler
de. If you are on unix, go to /var/lib/apache2 and execute 'ls -ltr' (sort logfiles by date). There should be some error log file. Maybe this contains some more information. BTW, mod_wsgi is much better supported and easier to handle than mod_python. Thomas Güttler -- Thomas Guettl

session.save() after failed request

2009-01-16 Thread Thomas Guettler
_create_sql(sid)) [Fri Jan 16 11:16:57 2009] [error] [client 172.17.6.34] ProgrammingError: current transaction is aborted, commands ignored until end of transaction block Has someone a hint how to fix this? Thomas -- Thomas Guettler, http://www.

Re: Pre-filling form data without submission?

2009-01-20 Thread Thomas Guettler
pre-fill form data without the form > automatically calling submit on the form so that the validation > messages don't appear in the rendered template? > > > Hi, Check the docs for "initial". Thomas -- Thomas Guettler, http:

Re: Pre-filling form data without submission?

2009-01-20 Thread Thomas Guettler
Hi, at python level you can do it like this (untested): def myview(request, ...): form=MyForm(..., initial={'email': request.user.email}) or form.fields['email'].initial=request.user.email shogunm...@googlemail.com schrieb: > Hi Thomas, > > Thanks for your

Re: Performance using session, passing data from one request to another, use js or not? Best practice?

2009-01-22 Thread Thomas Guettler
url(qs) else: next='>' last='>>' if page.has_previous(): qs['page_number']=page_number-1 prev='<' % qs2url(qs) qs['page_number']=1 first='<<' % qs2url(qs) else:

Re: Performance using session, passing data from one request to another, use js or not? Best practice?

2009-01-25 Thread Thomas Guettler
Tim Daniel schrieb: > > On 22 ene, 16:17, Thomas Guettler wrote: > >> Tim Daniel schrieb:> I read something that it would be more >> >>> efficient to store only the query and doing pickle?? I don't know how >>> to do that, I've b

Re: Performance using session, passing data from one request to another, use js or not? Best practice?

2009-01-26 Thread Thomas Guettler
session) would be better for caching, since all users share one cache: example: if the first user calls this: http://.../myprojec/.../page_number=1&tag=abc and a other user calls the same URL, you could use a cache for the second request. Thomas -- Thomas Guettler, http://www.thom

Re: how to avoid hardcoding of logfile path in logging.conf file

2009-01-27 Thread Thomas Guettler
ME'] or settings.FOO. I never used a logging.conf file. HTH, Thomas BTW: This is a pure python question. You get more and better answers on the newsgroup comp.lang.python. -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli

Re: Performance using session, passing data from one request to another, use js or not? Best practice?

2009-01-29 Thread Thomas Guettler
thanks again, > > URLs are beautiful if they don't change (you can bookmark them) or send as them link. Sessions get deleted sooner or later. Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de --~--~-~--~~~-

admin: list users of a group

2009-01-30 Thread Thomas Guettler
Hi, sometimes it would be nice to see all users of a group. I think it would be nice to have this in the admin page. Do other django users miss this, too? I know that it is very easy to write a view for this, but it would be even better if it is a part of the django admin. Thomas PS: Of

Re: How do I correctly format a Querydict derived list in a url?

2009-02-02 Thread Thomas Guettler
import urlencode to create the string after the question mark. BTW, I think urlencode has a bug: http://code.djangoproject.com/ticket/9089 Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de --~--~-~--~~~---~--~~ You

Re: Django Get/POST problem

2009-02-03 Thread Thomas Guettler
#x27;, > {'token':token, 'id':id}) > return render_to_response('html/404.html') > > Is there a neater way of doing this - rather than finding the request > type and behaving differently depending. > > I am d

Re: Some questions on using Django

2009-02-11 Thread Thomas Guettler
ons can be written in some hours if you are familiar with django. And very complex things can be done, too: Welcome to python and django Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de --~--~-~--~~~---~--~~

Formsets issue

2009-02-18 Thread Thomas Hill
Hey all, Been trying to display multiple form rows for a project lately, and I just wanted to confirm that I'm doing this right. I found a solution on http://www.pointy-stick.com/blog/2009/01/23/advanced-formset-usage-django/ , and I took what I needed from it (my code below), but I found th

Re: Formsets issue

2009-02-18 Thread Thomas Hill
Ah, yes, indeed. Will definately do that, thanks. Regarding the formset classes and form classes with their try/except lines, however, does that look "right"? On Wed, Feb 18, 2009 at 10:31 AM, Brian Rosner wrote: > > > On Feb 18, 2009, at 10:16 AM, Thomas Hill

Re: Formsets issue

2009-02-18 Thread Thomas Hill
Brilliant, thank you! I'll take care of this later tonight. Thanks again, Brian. On Wed, Feb 18, 2009 at 10:40 AM, Brian Rosner wrote: > > > On Feb 18, 2009, at 11:33 AM, Thomas Hill wrote: > > > Ah, yes, indeed. Will definately do that, thanks. Regarding the >

Search Professional Webdesign Company in Berlin (Germany)

2009-02-25 Thread Thomas Bechtold
Hi, i'm searching a webdesign company from berlin/germany which use django. Anybody here from Berlin? Cheers, Tom --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send e

cache backend file: No need for cull

2009-02-25 Thread Thomas Guettler
suggest that if you set max_entries to zero, _cull() is not called. Before I open a ticket, I ask for feedback. Anyone? Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de --~--~-~--~~~---~--~~ You received this

Re: Why serializing to JSON doesn't work?

2009-03-04 Thread Thomas Guettler
t encoder > encoder.JSONEncoder().encode(ret) Or this: >>> from django.utils import simplejson >>> simplejson.dumps(...) But unfortunately this does not encode datetime objects. Thomas -- Thomas Guettler, http://www.thomas-g

Re: Getting stuck in transactions

2009-03-12 Thread Thomas Guettler
cript with a wrapper which has the commit_on_success decorator. If you use unix, start the script with "strace -f" to see in which system call the process stops. HTH, Thomas Tom Davis schrieb: > I have a command-line script that uses Django's ORM. For reasons > beyond

Re: traceback - no local variables

2009-03-12 Thread Thomas Guettler
Hi, I attached a HandleExceptionMiddleware I use. You need to modify it to your needs. It attaches the html page of cgitb and the django debug page to the email. Thomas George Lund schrieb: > We have a live server crash issues for which we are receiving emails > from Django from our

Combine several Forms to one class

2009-03-12 Thread Thomas Guettler
ready something like this. Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to t

Re: [OFFTOPIC]: msiexec and Python 2.6.1 on Windows

2009-03-13 Thread Thomas Guettler
Hi, this does not answer your question, but some weeks ago I used py2exe and wix to create a msi. I have not used windows for years and py2exe and wix were new for me. But it took only some ours to get it working. HTH, Thomas cjl schrieb: > I am in the process of updating my little dja

on delete set null

2009-03-16 Thread Thomas Guettler
n would be this: subclass User and override delete() and use this class for as foreign key. But I would prefer a different solution. [1] http://code.djangoproject.com/ticket/7539 Add ON DELETE and ON UPDATE support to Django Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: gue

Re: Adding a field to a form during runtime

2009-03-18 Thread Thomas Guettler
Hi, your code looks correct. You can try to debug it. Maybe insert assert False, self.fields into __init__() Do the fields from the model exist? Thomas Marek W schrieb: > Hi, I would like to add a field to a form dynamically. I'm using Django > 1.0.2. > > Here's my

Re: Adding a field to a form during runtime

2009-03-19 Thread Thomas Guettler
ar_form(True) > (...) > > then on the page there aren't any fields, whether calling make_car_form with > extra=True or extra=False. -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de --~--~-~--~~~---~--~

request object needed in form methods

2009-03-19 Thread Thomas Guettler
(in a thread safe way) on module level? I recall that someone said this is not good. What are the pro and contra arguments? Most of the time I need request.user to hide some input fields. Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de

Re: request object needed in form methods

2009-03-19 Thread Thomas Guettler
s SubForm(form.Form): def clean(self): if threadlocal.request.user . threadlocal=threading.local() def view(request): threadlocal.request=request mform=MasterForm() }}} -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de --~--~-~-

Re: ModelChoiceField - large lookup tables

2009-03-24 Thread Thomas Guettler
hidden field with JS opener.document.getElementById(...); That's my way, I guess there exist better solutions. Thomas PNM schrieb: > Before I re-invent the wheel: is there any generally accepted or > recommended generic way to handle ModelChoiceFields with very large > datasets in D

Re: inconsistency between remove() and clear()?

2009-03-24 Thread Thomas Guettler
;t do this, since it does not have a reference to all affected objects. Thomas Margie schrieb: > It seems to me there is an inconsistency between clear() and remove > (). After a remove() I find that the related object set no longer > contains the specified object (as expected), and

Re: Reverse tag of safe

2009-03-24 Thread Thomas Guettler
Hi, google for "entity resolver python". I recall that I did something like this. You could ask on comp.lang.python, too. If you got it working in python you can create a template tag. Thomas Alessandro Ronchi schrieb: > I need to translate html entities on utf-8 characters

Re: Working With ModelForms

2009-03-24 Thread Thomas Guettler
do it like this: def view(request): if request.POST: data=request.POST else: data=None form=MyForm(data) Why do you access 'build_release' in POST? It would be better the create a Field for it and access form.cleaned_data['build_release'] HTH

Re: Django and PyAMF - RemotingError

2009-06-25 Thread Thomas Hill
IIRC, pyAMF tries to turn all python objects into amf related ones upon output. What you may be seeing here is that querysets aren't able to make it through this conversion. Check your apache error logs for the stacktrace, if you have one, or like Randy said, set Debug = True. On Thu, Jun 25, 2009

Re: Django 1.0.2 Thread safety

2009-06-29 Thread Thomas Guettler
Hi, I hit this bug some time ago, too. If you run SVN 1.0.X you get the bug fixes for free. Thomas Miles schrieb: > There should be a little warning in the 1.0.2 docs or on > http://code.djangoproject.com/wiki/DjangoSpecifications/Core/Threading > that it is *not* thread safe. >

How to build query

2009-07-02 Thread Thomas Bechtold
Hi, i use the django auth framework and have the following model: class Sensor(models.Model): """ auth_group = models.ForeignKey('auth.Group') identifier = models.CharField(help_text='identifier of the sensor', max_length=30, db_index=True) comment = models.TextField(help_text='

No serial primary key and admin interface

2009-07-23 Thread Thomas Guettler
" and inline) models have a slug field as primary key. Any change to get the admin interface working? I use the django svn 1_0_X branch Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de --~--~-~--~~~---~--~~

Re: No serial primary key and admin interface

2009-07-23 Thread Thomas Guettler
... replying to myself In django trunk this was fixed. http://code.djangoproject.com/ticket/10992 Still looking for a solution in 1_0_X. Unfortunately I don't get a stacktrace, but the inlines are just missing. TEMPLATE_STRING_IF_INVALID does not get used. Thomas Thomas Guettler sc

Re: No serial primary key and admin interface

2009-07-23 Thread Thomas Guettler
I am sorry for the noise: The slug primary key of the inline model needs to be displayed. Now it works. Nevertheless silently ignoring errors like admin does sometimes is bad. Thomas Guettler schrieb: > ... replying to myself > > In django trunk this was fixed. > http://code.djang

Missing Roles (group of groups)

2009-07-30 Thread Thomas Guettler
would be better. Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this g

Admin: raw-id: Link to edit page

2009-08-03 Thread Thomas Guettler
Hi, How can I display a link to the edit page of a foreign key? Example: class Place: city=models.ForeignKey(City) In the admin page of the place I want a link to the city admin page. Regards, Thomas Güttler -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli

Re: Admin: raw-id: Link to edit page

2009-08-03 Thread Thomas Guettler
Thank you Peter. But list_display does not get used on the edit page of an object. If you use raw_id the ID of the foreign key gets displayed right to the input field. It would be nice to make it a hyperlink. HTH, Thomas Peter Bengtsson schrieb: > > > On 3 Aug, 10:12, Thomas

Re: Populating a form from the database

2009-08-04 Thread Thomas Guettler
Hi, if you use ModelForm, the data from the database are the initial form data. If you create a new record with ModelForm, you could use the "initial" parameter to supply some default values. More can be found in the docs. Thomas Magnus Valle schrieb: > Short: > How do I

Date-based generic view not working

2009-08-07 Thread Thomas Jaggi
s? I'm sorry if there is too few information. Since I'm new to Django I probably don't know what basic information is needed to solve anything like this. Thanks, Thomas --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

Re: Date-based generic view not working

2009-08-07 Thread Thomas Jaggi
Well, after setting 'allow_future' to true everything works fine. Since the entries were created today I don't really get this. I'm using the 'pub_date' as 'date_field' and it's definitely NOT in the future... --~--~-~--~~~---~--~~ You received this message because

Duplicate results using ORd Q queries

2009-08-08 Thread Thomas Scrace
Hi all, In order to teach myself Django I am creating a simple film database project. My search code looks like this: results = Film.objects.filter( Q(title__icontains=q) | Q(director__name__icontains=q) |

Re: Date-based generic view not working

2009-08-11 Thread Thomas Jaggi
It was in fact the timezone. A few hours later it magically worked. ;) Thanks for your help! --~--~-~--~~~---~--~~ 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@goog

Inheritance at runtime (per model instance)

2009-08-12 Thread Thomas Guettler
ld be done with a custom manager. Does someone have a better approach, or feedback? Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de --~--~-~--~~~---~--~~ You received this message because you are subscribe

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. >> >

Re: Inheritance at runtime (per model instance)

2009-08-13 Thread Thomas Guettler
Hi Malcolm, Malcolm Tredinnick schrieb: > 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 >&g

Reloading a page with new data

2009-08-13 Thread Thomas Scrace
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi all, My app has a page where you can enter new data into the database through a form. All is working well, except that some of the fields require a choice from a drop down menu. If the choice for these fields the user wants is not already in the

<    1   2   3   4   5   6   7   8   9   10   >