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

2008-10-21 Thread Thomas Guettler
. But 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 -- Thoma

Re: www.djangosnippets.org is down now?

2008-10-22 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: 500 displayed instead of 404

2008-10-28 Thread Thomas Guettler
404 exception is raised, 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

Re: Django full text search best solution

2008-10-28 Thread Thomas Guettler
transaction, 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: 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

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:

Re: 500 displayed instead of 404

2008-10-29 Thread Thomas Guettler
mod_wsgi. 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 grou

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: Trying to avoid duplicate form posts/database inserts

2008-10-30 Thread Thomas Guettler
alue. 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-g

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

2008-10-30 Thread Thomas Guettler
return string for enc in encoding_guess_list: try: return string.decode(enc, errors) except UnicodeError, exc: continue raise UnicodeError('Failed to convert %r' % string) HTH, Thomas -- Thomas G

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,

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/

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: strptime() working in python, but not within django?

2008-11-04 Thread Thomas Guettler
atetime.strptime() 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-

Re: Newb help request about fields and and subfields

2008-11-05 Thread Thomas Guettler
ot easy. What kind 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:

cleaned_data of invalid forms

2008-11-05 Thread Thomas Guettler
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
h the professor about 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. > -- T

Re: apache authentication using Django on windows

2008-11-05 Thread Thomas Guettler
ect.settings > 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 &g

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 because you

Re: App initialized twice? plus, debugging tips.

2008-11-06 Thread Thomas Guettler
d this peace of 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:

sorting a list of model instances

2008-11-07 Thread Thomas Guettler
t set(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 becaus

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

Re: Change date format in admin

2008-11-11 Thread Thomas Guettler
if you 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: I18N not working

2008-11-25 Thread Thomas Guettler
have the LocaleMiddleware 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 subscr

Re: I18N not working

2008-11-25 Thread Thomas Guettler
USE_I18N 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-guett

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&foo=2" as query string? Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas

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 excepion w

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 this

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

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

Re: Using % with psycopg2

2008-12-02 Thread Thomas Guettler
aw, that the ticket still needs a testcase. 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 &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 > > > > >

Query API: get all users without a group

2008-12-02 Thread Thomas Guettler
"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: 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://ww

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 to create and send a pdf attachment

2008-12-03 Thread Thomas Guettler
omitted (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:/

Session based messages without touching DB

2008-12-05 Thread Thomas Guettler
ts.org/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 --~--~-~--~~~---~--~---

Re: how to do redirects with django?

2008-12-09 Thread Thomas Guettler
page() is have set > as: > > def 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 (*

cursor already closed

2008-12-10 Thread Thomas Guettler
_belegartrequiredgroup"."id", "foo_belegartrequiredgroup"."belegart_id", "foo_belegartrequiredgroup"."permission_id", "foo_belegartrequiredgroup"."group_id" FROM "foo_belegartrequiredgroup" WHERE ("foo_belegar

TransactionMiddleware and SessionMiddleware

2008-12-10 Thread Thomas Guettler
is a bug or am I missing something? I use django 1.0.2 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 "

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

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,

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
re so that progress can be viewed: > http://timikidemo.io41.com/ > > Tim ^,^ > > > -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de --~--~-~--~~~---~--~~ You received this message because you are subscribed to

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

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
delete or rename it). > > Now you can edit your views_base.py and see the changes in action, > without restarting Web Server (except of args of defs(request, args). > > > > -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de --~--~---

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
values sent from db cursor? I found > http://docs.djangoproject.com/en/dev/faq/models/#how-can-i-see-the-raw-sql-queries-django-is-running > by this doesn't show anything. When they say "just do this", are they > implying we should run that from a manage.py shell? >

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

Re: pdf file generated problem

2008-10-07 Thread Thomas Guettler
h.read(), attach.content_type) > mail.send() > except Exception, e: > raise ValueError, e > request.user.message_set.create(message="Mail sent successfully.") > return HttpResponseRedirect('../') > > The problem here is if I s

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
anvas(buffer) > pdf = buffer.getvalue() > buffer.close() > response.write(pdf) > - > attach = pdf > mail = EmailMessage(subject, message, sender,[send_to]) > mail.attach(attach.name, attach.read(), attach.content_type) >

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
>> cStringIO.StringIO(d) >>>> > Traceback (most recent call last): > File "", line 1, in > TypeError: expected read buffer, dict found > > My conclusion is that my client.py imports StringIO from cStringIO, > which doesn't accept a d

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
e displayed > in the form 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 --~--~-~--~~-

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

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

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
ate, this isn't an issue with 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

Re: traceback - no local variables

2009-03-12 Thread Thomas Guettler
y all the 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.

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
sions of the Python 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.th

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

  1   2   3   4   >