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

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

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,

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

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

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

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

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

PopUp instead of Select widget (newforms)

2007-07-30 Thread Thomas Guettler
Hi, I want to use a popUp instead of an select widget, since there will be too many entries (>10.000). It would be better to use a PopUp with a search form. Has anyone done something like this? I search some example code to learn from. Thomas

Re: Adding fields to form.clean_data

2007-07-30 Thread Thomas Guettler
Hi, if the fields will never be edited, you can use editable=False in your model. I do it like this: instance=formobj.save(commit=False) instance.attribute=... instance.save() BTW: the "commit" keywords does not mean database commit. If means, don't call save() of the instance. Am Montag,

Re: learning django's HttpRequest Object and Middleware

2007-07-31 Thread Thomas Guettler
Am Dienstag, 31. Juli 2007 11:26 schrieb james_027: > Hi, > > I want to make sure that my understanding is right. is middleware the > place where I can add more attribute to the HttpRequest Object and > manipulate the added attribte? > > Is this advisable? if Not where is the right place to do

duplicate SQL statements

2007-07-31 Thread Thomas Guettler
Hi, with SQLLogMiddleware (http://www.djangosnippets.org/snippets/344/) I see, that there are many statements executed twice in a single request. This links explains it: http://www.djangoproject.com/documentation/db-api/#caching-and-querysets How can I cache the result of

Re: understanding request.user

2007-08-01 Thread Thomas Guettler
Am Mittwoch, 1. August 2007 10:23 schrieb james_027: > hi, > > I am seeking some enlightenment as why the user (variable use to track > if the user is logged in or not) seems to be on the request level and > not on the session which is the practice of most or all of web > framework? If I am not

Re: UnicodeEncodeError

2007-08-01 Thread Thomas Guettler
Am Mittwoch, 1. August 2007 04:23 schrieb Alexandre Forget: > Hi, > > I am stuck with this error, does someone know what it mean? > I am using django svn and sqlite. > > This error happen when I try to delete an object with the admin > interface but it delete fine with the shell. > Hi, I

Re: How to get selected value set in newforms

2007-08-01 Thread Thomas Guettler
Am Mittwoch, 1. August 2007 15:58 schrieb jeffhg58: > In newforms when I use the choicefield, I haven't been able to figure > out how to set the value to say the third value in the drop down list. > I tried setting the initial=3 but that did not seem to work. > > Here is the definition of the

Re: Newforms w/ *dynamic* ChoiceField choices?

2007-08-03 Thread Thomas Guettler
Am Freitag, 3. August 2007 00:19 schrieb rskm1: > Newforms has a spiffy way to dynamically set the "initial" values of > fields, in the view code when the Form is constructed. > choosecolorform = ChooseColorForm(initial={'color': 'black'}) I think you only can set initial to a value, not to a

Re: Question about upload / FileField

2007-08-03 Thread Thomas Guettler
Am Freitag, 3. August 2007 15:34 schrieb ZhangshenPeng: > Question 1: > > When I removed "blank=True" from FileField ,then use below method > to upload file , but no matter whether your choosed file , the from > valid will report error "This field is required." All newforms Fields habe a

Re: full-text indexing

2007-08-07 Thread Thomas Guettler
Am Dienstag, 7. August 2007 12:02 schrieb Kai Kuehne: > http://www.rkblog.rk.edu.pl/w/p/django-lupy/ Hi, Does lupy support transactions? Do both (SQL und text database) syncronize their transactions (commit or rollback both)? Thomas --~--~-~--~~~---~--~~ You

Re: Unicode error

2007-08-23 Thread Thomas Guettler
Am Mittwoch, 22. August 2007 19:25 schrieb Sandro Fernandes: > Hi all , > > I runing Django from the trunk and getting the error bellow , this > happens when a data has accents like á é or ã > > > UnicodeDecodeError at /admin/frete/frete/ > If you use the current SVN version with includes this

Re: Flexible Models?

2007-08-24 Thread Thomas Guettler
Am Freitag, 24. August 2007 00:50 schrieb Nathaniel Martin: > I'm hoping that some of the django experts on this list can help me with a > problem I'm working on designing the architecture of a site I'm working on. > I want to have many objects that each belong to a category. Each category > has

Re: Starting up with django

2007-09-26 Thread Thomas Guettler
Am Mittwoch, 26. September 2007 12:09 schrieb [EMAIL PROTECTED]: > I'm a completely new user, I've a lot of experience in Delphi, C++ > programming, and some on Python, but now I 've the challenge to conver > entirely an application from Delphi to web. The application has in the > magnitude of

Re: ***SPAM*** Re: Deployment issues: ViewDoesNotExist error

2007-09-27 Thread Thomas Guettler
... > However, if I mimic the wsgi script as follows: > > cd /home/missed/django/projectsmt/ > python > > >>> import os, sys > >>> sys.path.insert(0, '/home/missed/django') > >>> sys.path.insert(0, '/home/missed/django/projectsmt') > >>> os.environ['DJANGO_SETTINGS_MODULE'] =

Re: Getting the Error 'TypeError, float argument required'

2007-10-05 Thread Thomas Guettler
Am Freitag, 5. Oktober 2007 09:21 schrieb Greg: > Hello, > I have the following field in my class > > amount = models.DecimalField("Order Amount", max_digits=6, > decimal_places=2) > > Whenever, I add a new record to this class I get the following error: > > TypeError at /admin/plush/orders/ >

Re: Query for cascading children to a parent

2007-10-08 Thread Thomas Guettler
Am Montag, 8. Oktober 2007 15:13 schrieb [EMAIL PROTECTED]: > In my model class I have: > > class Company(models.Model): > company_id = models.AutoField(primary_key=True) > parent_company = models.ForeignKey("self",null=True) > . > . > > > How would I query to get back all

Re: Get path translated

2007-10-09 Thread Thomas Guettler
Am Dienstag, 9. Oktober 2007 08:08 schrieb cschand: > Hi all > Can I get the path of the redirected/translated page Hi you, do you mean request.META.get("HTTP_REFERER")? Thomas --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

Modify Uset.get_profile(): Create new if it does not exist.

2007-10-09 Thread Thomas Guettler
Hi, I would like to modify User.get_profile(), that it creates a new profile, if does not exist. I don't want to modify the django source for me. One solution would be, to replace this method in a middleware for every request. But that's not a nice solution. Subclassing could be done, too. But

form_for_model should return TextareaWidget

2007-10-10 Thread Thomas Guettler
Hi, How can I get a TextareaWidget with form_for_model()? I have a solution, but it is too much code. You need to create an own DB-Field. Is there a better solution? models.py: text=dbfields.TextareaField(max_length=128, rows=4, cols=40, verbose_name="Text", blank=True) dbfields.py:

Re: form_for_model should return TextareaWidget

2007-10-11 Thread Thomas Guettler
Am Mittwoch, 10. Oktober 2007 15:09 schrieb Malcolm Tredinnick: > On Wed, 2007-10-10 at 14:51 +0200, Thomas Guettler wrote: > > Hi, > > > > How can I get a TextareaWidget with form_for_model()? > > > > I have a solution, but it is too much code. You need to creat

utils.text.urlquote returns unicode?

2007-10-11 Thread Thomas Guettler
Hi, I looked at the source of urlquote: utils/text.py: def urlquote(url, safe='/'): """ A version of Python's urllib.quote() function that can operate on unicode strings. The url is first UTF-8 encoded before quoting. The returned string can safely be used as part of an

Better FileField

2007-10-11 Thread Thomas Guettler
Hi, I like django, but not models.FileField. * I don't want to store the files in MEDIA_ROOT, since the access needs to go through django for authentication. * The containing directory should be given by the model of the FileField. Example: class MyFriend(models.Model):

Re: Request data is lost between two views

2007-10-16 Thread Thomas Guettler
Am Dienstag, 16. Oktober 2007 12:35 schrieb Divan Roulant: > Hello, > > I loose request data when I call a view with reverse from a previous > view. Here is what I do: >... return HttpResponseRedirect(reverse('my_second_view, > args=(request,))) > Is request data supposed to follow or is it

Re: select choices

2007-10-16 Thread Thomas Guettler
Am Montag, 15. Oktober 2007 22:11 schrieb onno: > Arn't stings slower against integers? Optimize later. You never know the bottleneck in advance. Thomas --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django

Re: ***SPAM*** Nested in statements

2007-10-16 Thread Thomas Guettler
Hi, you can use the extra() method of QuerySet: Example: Entry.objects.extra(where=['id IN (3, 4, 5, 20)']) http://www.djangoproject.com/documentation/db-api/#extra-select-none-where-none-params-none-tables-none Am Dienstag, 16. Oktober 2007 14:29 schrieb Rufman: > in SQL terms this is what

Re: Nested in statements

2007-10-16 Thread Thomas Guettler
Am Dienstag, 16. Oktober 2007 15:48 schrieb Jeremy Dunck: > On 10/16/07, Thomas Guettler <[EMAIL PROTECTED]> wrote: > > Hi, > > > > you can use the extra() method of QuerySet: > > > > Example: Entry.objects.extra(where=['id IN (3, 4, 5, 20)']) > > H

Re: Prevent setting a primary key (compound uniqueness)

2007-10-17 Thread Thomas Guettler
> Is there a way to tell django not to set a primary key on a table > (and then doing it with custom sql)? Hi, why can't you drop the created primary key in you custom sql (myapp/sql/mymodel.sql) , and then create your new combined index? Thomas

Re: Python 2.3 deployment

2007-10-19 Thread Thomas Guettler
> File > "/usr/lib/python2.3/site-packages/django/contrib/sessions/models.py", line > 19, in get_new_session_key session_key = md5.new("%s%s%s%s" % > (random.randint(0, sys.maxint - 1), os.getpid(), time.time(), > settings.SECRET_KEY)).hexdigest() > > AttributeError: 'module' object has no

Re: Get all related instances

2007-10-22 Thread Thomas Guettler
Hi Malcom and other, > That would seem to only account for things that are directly attached to > the current model, rather than more distant relations. Yes, but that's enough for me. > Have a look at what Model._collect_sub_objects() does -- or call it > directly -- to see how Django goes

Re: Avoid Unhandled exception page from flup

2007-10-24 Thread Thomas Guettler
Am Dienstag, 23. Oktober 2007 11:24 schrieb Rafal bluszcz Zawadzki: > Hello. I am trying to avoid default (below attached) default Unhandled ex. > pagtes served by flup. There should not be unhandled exceptions in flup. If there is an unhandled exception in django, either the debug template or

Re: crititcal tidbit of documentation missing (instance vs. class attributes)

2007-10-25 Thread Thomas Guettler
Am Donnerstag, 25. Oktober 2007 15:42 schrieb bramble: > It looks to me that even though you set up class attributes in your > models, when you *use* your models in your code, you access them as if > they were instance attributes. > > Nowhere in the tutorials or the model or db-api docs is this >

Re: save() datefield

2007-10-26 Thread Thomas Guettler
Am Freitag, 26. Oktober 2007 10:53 schrieb äL: > I use Django to manage addresses. To publish the data I have a list > and a detailed view. In the detail view I can change the name, > address, phone, etc. of the person. To do that I created an edit > form. > > Now, everythin is fine. Only if I

Re: object and related object on one form (newforms)

2007-10-29 Thread Thomas Guettler
Am Sonntag, 28. Oktober 2007 17:29 schrieb Rob Slotboom: > Can someone please explain to me how to create a form which provides > not only the fields for the object but also the fiels for a related > object (foreign key) and the best method to validate and save the > data? Hi, with newforms,

Re: settings.py gets imported twice

2007-11-05 Thread Thomas Guettler
Am Montag, 5. November 2007 10:55 schrieb Malcolm Tredinnick: > On Mon, 2007-11-05 at 10:46 +0100, Thomas Güttler wrote: > > Hi, > > > > settings.py gets imported twice. This is bad, if you want to > > set up the logging module, since you register the handler twice > > and you get all log

Re: settings.py gets imported twice

2007-11-06 Thread Thomas Guettler
Am Dienstag, 6. November 2007 07:00 schrieb Matti Haavikko: > Here's an alternative solution - it's based on the idea that the > handlers are added to the logger only once. (getLogger returns the same > logger instance each time). > > import logging > logger=logging.getLogger("dws") > if not

Re: newforms: how to validate form_for_model ?

2007-11-07 Thread Thomas Guettler
Am Mittwoch, 7. November 2007 12:02 schrieb parabol: > Hi, > I have a form class which is generated with form_for_model. How can I > write my custom validator? I think I should set a clean() method for > that class. Is it reasonable to say that; > > fom1.clean= def clean You could set the

Re: Start development: which branch?

2007-11-07 Thread Thomas Guettler
Am Mittwoch, 7. November 2007 12:25 schrieb Florian Lindner: > Hello, > I'm just about to start a project with Django (which will also be for > learning Django). > > Should I use trunk for development? Or is there any branch better for > development? (with regard to the introduction of newforms)

Re: name 'django' is not defined

2007-11-07 Thread Thomas Guettler
Am Mittwoch, 7. November 2007 15:41 schrieb Florian Lindner: > Hello, > I'm using Django trunk. > > After some weeks of paused development I started my app again today. But as > soon as I access the URL defined at the root urls.py: > > (r"^blog/", include("xgm.Blog.urls")), > > I get an error: >

Re: Circular dependencies problem

2007-11-13 Thread Thomas Guettler
Am Dienstag, 13. November 2007 09:08 schrieb Thomas Guettler: > Am Dienstag, 13. November 2007 03:35 schrieb [EMAIL PROTECTED]: > > Hello, > > > > i'm new to django so excuse if this is a really stupid question. > > > > I have these three apps with are

Re: Circular dependencies problem

2007-11-13 Thread Thomas Guettler
Am Dienstag, 13. November 2007 03:35 schrieb [EMAIL PROTECTED]: > Hello, > > i'm new to django so excuse if this is a really stupid question. > > I have these three apps with are inter dependable, how can I make this > work in Django maintaining all of this modules separate. Do you really need

Re: Circular dependencies problem

2007-11-13 Thread Thomas Guettler
Am Dienstag, 13. November 2007 12:00 schrieb [EMAIL PROTECTED]: > But then this N:M field would only be used some times... it doesn't > seam as a good way to do this. > > I could always create a big app with all the models but I would like > to be able have apps for each main class so my views.py

No need for FileField

2007-11-13 Thread Thomas Guettler
Hi, I have model Object and I want to store 0..N files for each. To keep the files together the files should be saved under a directory like this: .../objects/ID/ FileField does not support this. Now I found a simple solution, that I want to share. The solution is simple: I don't need

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

2008-09-30 Thread Thomas Guettler
T parameter: http://.../myview?mail_id=1_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 --~--~-~--~~~---~--~~ You received thi

reverse() outside HTTP-Context (SCRIPT_NAME)

2008-10-02 Thread Thomas Guettler
it. But it 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-guettler + de

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

2008-10-02 Thread Thomas Guettler
d 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-guettle

Re: pdf file generated problem

2008-10-07 Thread Thomas Guettler
> except Exception, e: > raise ValueError, e > request.user.message_set.create(message="Mail sent successfully.") > return HttpResponseRedirect('../') > > The problem here is if I say attach = response then I am getting error > 'HttpResponse'

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
buffer.close() > response.write(pdf) > - > attach = pdf > mail = EmailMessage(subject, message, sender,[send_to]) > mail.attach(attach.name, attach.read(), attach.content_type) > mail.send() > > this will give me error saying ob

Re: What happened to django.core.validators

2008-10-09 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
ypeError: expected read buffer, dict found > > My conclusion is that my client.py imports StringIO from cStringIO, > which doesn't accept a dict as content in its __init__ method. But I > can't be the only person using django to have cStringIO installed, > right? So someone would have

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 this m

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

Re: DB record retrieval from every N minutes

2008-10-15 Thread Thomas Guettler
delta(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? Thomas -- Thomas Guettler, http://www.thomas-guettler.de/

How to use class_prepared signal

2008-10-16 Thread Thomas Guettler
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 Google Groups "Django

Re: maximum recursion depth exceeded ???

2008-10-20 Thread Thomas Guettler
) inside login(): > def login(request ,template_name): > ... > login(request, v) > I guess you mean user.login() HTH, Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Ma

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

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

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

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

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

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

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

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

  1   2   3   4   >