Inheritance at runtime (per model instance)

2009-08-12 Thread Thomas Guettler
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 subscribed to the Google

Re: Populating a form from the database

2009-08-05 Thread Thomas Guettler
a time-stamp and the request.user . > > But is there a way to open the form, looking to see if the user already > has entered some data, then populate the form with that data. But if the > user does not have a entry in the database, then presenting an empty form. ? -- Thomas Guettler,

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

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

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

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

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 schrieb

Re: Django 1.0.2 Thread safety

2009-06-30 Thread Thomas Guettler
ock the server. -- 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, send e

Re: changes to views and forms are not reflected in browser

2009-06-18 Thread Thomas Guettler
gt; normally do "touch dispatch.fcgi" which is working with templates and > urls but with views and forms I get nothing different. I tried other > browsers and cleared my cache as well. -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: g

Re: Problem to deploy on production server

2009-06-15 Thread Thomas Guettler
ables that wrongly display nothing are still empty. > > I tried to give each site a different site_id, but it doesn't help. > > Help would be very much appreciated, > > Thank you > > Francis -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) th

Re: Logging to Database while using @transaction.commit_manually decorator

2009-06-08 Thread Thomas Guettler
with the same database connetion will roll back, too. -- 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 us

Re: Logging to Database while using @transaction.commit_manually decorator

2009-06-08 Thread Thomas Guettler
not be > committed to the database? I am not getting any exceptions being > raised, the code executes as though it has all worked perfectly. -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de --~--~-~--~~~---~--~~ You

Re: model form validation always failing

2009-05-19 Thread Thomas Guettler
the admin > interface without any problems -- 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

Re: What debugger do you use?

2009-05-12 Thread Thomas Guettler
Hi, I use Emacs for editing and assert and logging for debugging. Joshua Russo schrieb: > I'm currently using Netbeans 6.5 with the Python plugin. I was just > wondering what everyone else is using because NB is a bit buggy with > the Python plugin at the moment. -- Thomas Guett

Re: django CommaSeparatedStringField component

2009-05-06 Thread Thomas Guettler
t is sort of like the CommanSeparatedIntegerField that comes with > django, but for String. > > Thank you very much in advance. > -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de --~--~-~--~~~---~--~~ You

Cookie based Messages

2009-04-22 Thread Thomas Guettler
for a single user. I created a cookie based middleware: http://www.djangosnippets.org/snippets/1459/ Happy Hacking, Thomas Güttler #4604 Session based Middleware: http://code.djangoproject.com/ticket/4604 -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de

Re: Fieldlookup: NOT

2009-04-17 Thread Thomas Guettler
Christian Joergensen schrieb: > Thomas Guettler wrote: >> Hi, >> >> >> For forms which display a list of results I use: >> form=QueryForm(request.GET) >> >> queryset=MyModel.objects.filter(**form.cleaned_data) >> >> But, n

Fieldlookup: NOT

2009-04-16 Thread Thomas Guettler
(). Wouldn't it be nice to have a "not" field lookup? Example: MyModel.objects.filter(field__not=...) MyModel.objects.filter(field__not__in=...) Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-gue

Re: how to connect postgresql

2009-04-09 Thread Thomas Guettler
rgv) { > System.out.println("Checking if Driver is registered with > DriverManager."); > ... -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de --~--~-~--~~~---~--~~ You received this message because you

Re: Merging apps

2009-04-01 Thread Thomas Guettler
e in applications. A project is quite small. It is just a container and configuration for several applications. > Do I have to bite the bullet and merge the databases , views files, > settings etc etc? Does every project have its own user management? HTH, Thomas -- Thomas Guettler, http:

Re: Counting queries and query execution time

2009-03-31 Thread Thomas Guettler
s bad? I can > see it adding up on views with many queries, but that's my goal: > collect stats about actual production views where the query count/view > time/rendering time may vary from development. > > Or even better: does anyone have this written? I didn't see it on > django s

Re: Updating a model method

2009-03-31 Thread Thomas Guettler
Graham Dumpleton schrieb: > > > On Mar 31, 1:43 am, Thomas Guettler <h...@tbz-pariv.de> wrote: >> Hi, >> >> If you only change the method, but no model, you don't need to call 'syncdb'. >> >> If your webserver is configured correct, then you just

Re: Updating a model method

2009-03-30 Thread Thomas Guettler
gt; I have changed this method but no change is observed in the web page. It is > still working the old model method. > How can update this? > python manage.py sqlall > and > python manage.py syncdb > > doesn't seem to work. Could anybody help me? > > -- Thomas

Re: dynamic url pattern

2009-03-26 Thread Thomas Guettler
locals(), [name]) method=getattr(module, name) return method(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

Re: Foreign keys in admin

2009-03-26 Thread Thomas Guettler
in the admin gets too slow since this model tries to fill the SELECTs > with all the posible values and the MASTER table is BIG . > > Is there a way to make this faster ?? > > Thank you -- Thomas Guettler, http://www.thomas-guett

Re: Working With ModelForms

2009-03-24 Thread Thomas Guettler
render_to_response('bmi/newbuild.htm', -- 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.

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

2009-03-24 Thread Thomas Guettler
> >>>> book2.publisher > > > # after using remove() to remove book1, book1.publisher is empty >>>> pub.book_set.remove(book1) >>>> book1.publisher >>>> pub.book_set.all() > [] > > # Now book2 references pub. After using clear(), book2.pu

Re: Reverse tag of safe

2009-03-24 Thread Thomas Guettler
s, like to à > is there any template tag filter which can do that? > -- 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 &

Re: ModelChoiceField - large lookup tables

2009-03-24 Thread Thomas Guettler
- > and-select window). A ModelLookupField? > > This must be such a common scenario that I'd be interested in hearing > how other people solve it. I can't find anything in the documenation > on it. -- 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
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 --~--~-~--~~---

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: Adding a field to a form during runtime

2009-03-19 Thread Thomas Guettler
ether calling make_car_form with > extra=True or extra=False. -- 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 "Dj

Re: Adding a field to a form during runtime

2009-03-18 Thread Thomas Guettler
/www.b-list.org/weblog/2008/nov/09/dynamic-forms/. When I try to view > the page, when there's my own __init__ method in CarForm class, then the car > form doesn't contain any field. When i remove the __init__ method, > everything works correctly. How to add a field to a form during a

on delete set null

2009-03-16 Thread Thomas Guettler
tion 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: guettli

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

2009-03-13 Thread Thomas Guettler
Windows msi installer, for > example 2.5.4, I could run the following command from the windows cmd > prompt (or from inside my build script): > > msiexec /a C:\python-2.5.4.msi /qn TARGETDIR=C:\python ... -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail:

Combine several Forms to one class

2009-03-12 Thread Thomas Guettler
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 this g

Re: traceback - no local variables

2009-03-12 Thread Thomas Guettler
variables in the > email? > -- 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 t

Re: Getting stuck in transactions

2009-03-12 Thread Thomas Guettler
orphaned connections or > anything like that. The script loops through some files, parses them, > and makes ORM calls. Sooner or later, it stops looping and gets stuck > in a transaction and the only way to fix it is to terminate the script. --

Re: Why serializing to JSON doesn't work?

2009-03-04 Thread Thomas Guettler
> 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-guettler.de

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

Re: Some questions on using Django

2009-02-11 Thread Thomas Guettler
an 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 --~--~-~--~~~---~--~~ You

Re: Django Get/POST problem

2009-02-03 Thread Thomas Guettler
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 doing a similar thing for my update and it just seems off. > > Please help.

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

2009-02-02 Thread Thomas Guettler
r 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 received this message because you are subscribed

admin: list users of a group

2009-01-30 Thread Thomas Guettler
: Of course this would be nice for all N:M relations. -- 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&q

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

2009-01-29 Thread Thomas Guettler
in, > > 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 --~--~-~--~~~---~--~~ You

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

2009-01-27 Thread Thomas Guettler
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 (*) thoma

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

2009-01-26 Thread Thomas Guettler
tter for caching, since all users share one cache: example: if the first user calls this: http://.../myprojec/.../page_number=1=abc and a other user calls the same URL, you could use a cache for the second request. Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guett

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 <h...@tbz-pariv.de> 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 tha

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

2009-01-22 Thread Thomas Guettler
r']=page_number-1 prev='' % qs2url(qs) qs['page_number']=1 first='' % qs2url(qs) else: prev='' first='' first=mark_safe(first) prev=mark_safe(prev) next=mark_safe(next) last=mark_safe(last) -- Thomas Guettler, http://www.thomas-guet

Re: Pre-filling form data without submission?

2009-01-20 Thread Thomas Guettler
orm when they view the page. Since the form definition doesn't > have access to the request object, I presume this is not possible. > > -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de --~--~-~--~~~---~--~~ Y

Re: Pre-filling form data without submission?

2009-01-20 Thread Thomas Guettler
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://www.thomas-guettle

session.save() after failed request

2009-01-16 Thread Thomas Guettler
l(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.thomas-gue

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: Getting a 'too many values to unpack' error

2009-01-14 Thread Thomas Guettler
## 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: > > 'ValueError at /search/ too many values to unpack' > > The error comes from the line 'styles = styles.select_related().filter

post_syncdb signal: Called several times

2009-01-14 Thread Thomas Guettler
the 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: Shouldn't get_profile() create the profile object?

2009-01-08 Thread Thomas Guettler
in +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

db_index name clashes with table name

2009-01-06 Thread Thomas Guettler
/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" grou

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: TimeSpan, Latitude, Longitude field classes for Models

2008-12-17 Thread Thomas Guettler
ets.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 because you are sub

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

TransactionMiddleware and SessionMiddleware

2008-12-10 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, send email

cursor already closed

2008-12-10 Thread Thomas Guettler
uot;foo_belegartrequiredgroup"."permission_id", "foo_belegartrequiredgroup"."group_id" FROM "foo_belegartrequiredgroup" WHERE ("foo_belegartrequiredgroup"."belegart_id" = 1142 AND "foo_belegartrequiredgroup"."permi

Re: how to do redirects with django?

2008-12-09 Thread Thomas Guettler
f logbook_no_page(request): > > return HttpResponse(location='/foobar-page-55') > > > but that obviously doesn't work. How can I do this? > > -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de --~--~-~--~~--

Session based messages without touching DB

2008-12-05 Thread Thomas Guettler
g/snippets/1064/ The (flash) message is stored in a cookie. But I think the snippet is not thread safe. Has anyone a working example? Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de --~--~-~--~~~---~--~~ Yo

Re: How to create and send a pdf attachment

2008-12-03 Thread Thomas Guettler
ed (useful for multipart/alternative messages) and the mimetype is guessed, if not provided. If the first parameter is a MIMEBase subclass it is inserted directly into the resulting message attachments. """ -- Thomas Guettler, http://www.

Re: Query API: get all users without a group

2008-12-03 Thread Thomas Guettler
Filip Wasilewski schrieb: > On 2 Gru, 16:45, Thomas Guettler <[EMAIL PROTECTED]> wrote: > >> Hi, >> >> I want to get all objects where the corresponding many-to-many field is >> empty. >> >> Example: get all users without a group >> &

Re: How can I use more than 24 hours in TimeField?

2008-12-02 Thread Thomas Guettler
jango ORM, it will > report 'ValueError hour must be in 0..23'. > > I'm porting a old program that record rum times of the machines to > Django, so 24 hours is not enough for my new program. > > How can I resolve it ? > > -- Thomas Guettler, http://www.thomas-guettl

Query API: get all users without a group

2008-12-02 Thread Thomas Guettler
f", "auth_user"."is_active", "auth_user"."is_superuser", "auth_user"."last_login", "auth_user"."date_joined" FROM "auth_user" WHERE NOT ("auth_user"."id" IN (SELECT U1."user_id&quo

Re: Many-to-Many to exists table

2008-12-02 Thread Thomas Guettler
elate to this entity from any > other model. > > We can of cause create our own user authentication without embedded > user authentication in Django, but is this the best solution? > I hope you understand our problem. > > Thank you. > Regard > Nucles > > > > >

Re: Using % with psycopg2

2008-12-02 Thread Thomas Guettler
estcase. Can you write one? 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

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

order by ... nulls [first|last]

2008-11-26 Thread Thomas Guettler
Hi, I am missing order by nulls [first|last] Either I am blind, or it is not possible. Do other miss this, too? Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de --~--~-~--~~~---~--~~ You received

Re: debug view and list of GET or POST parameters

2008-11-25 Thread Thomas Guettler
Russell Keith-Magee schrieb: > On Tue, Nov 25, 2008 at 7:21 PM, Thomas Guettler <[EMAIL PROTECTED]> wrote: > >> Hi, >> >> If GET or POST contain a list, I only see the last value in the debug view. >> >> What do you see on an uncaught excepi

debug view and list of GET or POST parameters

2008-11-25 Thread Thomas Guettler
Hi, If GET or POST contain a list, I only see the last value in the debug view. What do you see on an uncaught excepion with e.g. "?foo=1=2" as query string? Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-gue

Re: I18N not working

2008-11-25 Thread Thomas Guettler
N only on systems with "C" and "pl_PL". > There is no need to use LocaleMiddleware if you do not want to change > translations (eg. depending on browser settings). > > -- Thomas Guettler, http://www.thomas-guettler.de/ E-

Re: I18N not working

2008-11-25 Thread Thomas Guettler
ocaleMiddleware installed. Maybe this setting is different on your server? Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de --~--~-~--~~~---~--~~ You received this message because you are subscribed to th

Re: Change date format in admin

2008-11-11 Thread Thomas Guettler
u use date objects (datetime.date.today()) in a template. You need to use the "date" or "time" filter. I think this is redundant. Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de --~--~-~--~~~---~--~~

Re: sorting a list of model instances

2008-11-07 Thread Thomas Guettler
Hi, > Although I would have to wonder why you're doing it this way, rather > than using the database to sort them? Since in my case it is easier. I need to filter out some item before. This calculation needs to be in python code. Thomas -- Thomas Guettler, http://www.thomas-guettler

sorting a list of model instances

2008-11-07 Thread Thomas Guettler
(view_groups)!=set(change_groups), (view_groups, change_groups) Is there a reason why this is this way? Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de --~--~-~--~~~---~--~~ You received this message because you

Re: App initialized twice? plus, debugging tips.

2008-11-06 Thread Thomas Guettler
code you can use the traceback module and print the stacktrace. Be sure that you access the module only in one way: e.g. always "myapp.modules". Not sometimes "myproj.myapp.modules". HTH Thomas -- Thomas Guettler, http://www.thomas-gu

Re: model inheritance - getting data from child objects

2008-11-06 Thread Thomas Guettler
; Thanks > Alistair > > [1] http://docs.djangoproject.com/en/dev/topics/db/models/#id6 > > > -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de --~--~-~--~~~---~--~~ You received this message bec

Re: apache authentication using Django on windows

2008-11-05 Thread Thomas Guettler
gs > PythonOption DJANGO_SETTINGS_MODULE testproject.settings > PythonAuthenHandler django.contrib.auth.handlers.modpython > > > However, it complains that it cannot find /dev/null. Is there > something I can use instead of /dev/null for use on windows? > > Thanks > >

Re: Newb help request about fields and and subfields

2008-11-05 Thread Thomas Guettler
that subject. > so, i think it would be more user friendly to have 3 > choicefields: the first one for the day of the week, > the second one for the "from time" field and the last one > for the "to time" field. > -- Thomas Guettler, http://ww

cleaned_data of invalid forms

2008-11-05 Thread Thomas Guettler
at forms/form.py ... def full_clean(). I could copy this method an write a utility function which only works for one field. But that is not a good solution. Do other people need this too? If yes, I could write a proposal with patch. HTH, Thomas -- Thomas Guettler, http://www.thomas-guettler.de

Re: Newb help request about fields and and subfields

2008-11-05 Thread Thomas Guettler
ind of data do you have? Why do you want it to split? Maybe you just need to write a own Widget which sublcasses from MultiWidget and override the render method? HTH Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) th

Re: strptime() working in python, but not within django?

2008-11-04 Thread Thomas Guettler
rptime() function. I've noticed > that this works correctly in python, but when i run it within a django > environment it doesn't seem to work. Example, in python: > > ... -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) th

Re: align a ModelForm

2008-11-03 Thread Thomas Guettler
m/en/dev/ref/contrib/admin/ http://groups.google.com/group/django-users/browse_thread/thread/536e86280059a1f9 HTH, Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de --~--~-~--~~~---~--~~ You received this message

Re: 302 status code in django test client

2008-10-30 Thread Thomas Guettler
ea on how I can test the > content of this page? > > 302 is redirect. There is no content. You hit this line: > return HttpResponseRedirect('/resultsdb/newresults') > -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: gu

Re: How to pass a special character in url

2008-10-30 Thread Thomas Guettler
For example, > > "http://127.0.0.1/sampleview/?obj=xxx; , but seems django cannot > handle such pattern. > > Does any one know this, or are there any relevant doc I can learn for > this. Your precious suggestion would be highly appreciated! > > -- Thomas Guettler, http:

Re: Migrating strings from MySQL latin1 to Postgres UTF-8

2008-10-30 Thread Thomas Guettler
st: try: return string.decode(enc, errors) except UnicodeError, exc: continue raise UnicodeError('Failed to convert %r' % string) HTH, Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thoma

Re: Trying to avoid duplicate form posts/database inserts

2008-10-30 Thread Thomas Guettler
lue. If I don't find > it, I insert the row along with the checksum. If I find it, I just > reject the insert and send the appropriate message to the response. This might be possible, but I would handle this outside the save method. Thomas -- Thomas Guettler, http://www.thomas-guettler.de

generic query builder

2008-10-29 Thread Thomas Guettler
, too. Not an easy task. Has some tried this already? 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 "D

Re: 500 displayed instead of 404

2008-10-29 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, send em

Re: Django full text search best solution

2008-10-29 Thread Thomas Guettler
cursor.execute(u'''UPDATE myapp_mymodel SET content=%s::tsvector where id=%s''', [tsvector, self.id]) The column "content" of type tsvector is created by a SQL snippet named mymodel.sql. HTH, Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: g

Re: looping to create an array of category breadcrumbs

2008-10-29 Thread Thomas Guettler
umb_list.append, but returns read-only error on 'list' > > any help would be apprec-ated. > > thank you > -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de --~--~-~--~~~---~--~~ You received this message b

Re: Django full text search best solution

2008-10-28 Thread Thomas Guettler
, I choose the full text index of postgres. I wrote an own to_tsvector method in python, instead of customizing the to_tsvector method of postgres. Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de --~--~-~--~~~---~--~-

Re: 500 displayed instead of 404

2008-10-28 Thread Thomas Guettler
sed, i.e. > why does Django use the 500 template in this case? > -- 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 &quo

Re: www.djangosnippets.org is down now?

2008-10-23 Thread Thomas Guettler
Gmail schrieb: > i found lots of snippets to download,but the server always says it is > down. > Hi, two days ago some snippets produced errors. But at least my snippets are working again. Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas

Re: Python on Windows re-using old .pyc files?

2008-10-21 Thread Thomas Guettler
the other are still alive and have the old code loaded. Maybe you could try mod_wsgi. It is much more flexible. See "Time to deprecate mod_python": http://groups.google.com/group/modwsgi/browse_thread/thread/95c5de2b996e2f49/fe4f823a391ad954 HTH, Thomas Güttler -- Thomas Guettler

Re: missing template for admin

2008-10-20 Thread Thomas Guettler
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 Guettler, http://www.thomas-gue

<    1   2   3   4   >