Re: Optimistic Locking

2008-01-31 Thread Thomas Guettler
check if the mtime has not changed. If it changed, you need reload the form (All previous form input must be reset, otherwise the user can't see what the other person has changed). HTH, Thomas --~--~-~--~~~---~--~~ You received this message because you are su

Re: Image upload in user's directory

2008-01-31 Thread Thomas Guettler
l files in default location. > > Is it possible ? Where does the variable 'user' come from? Maybe this patch does help you: http://code.djangoproject.com/ticket/5361 HTH, Thomas --~--~-~--~~~---~--~~ You received this message because you are subscribed

Re: url tag and reverse()

2008-01-31 Thread Thomas Guettler
current url conf (I've commented out everything else): > > url(r'^(johndoe|janedoe)/$', 'translator', name="translator"), > url(r'^(johndoe|janedoe)/(?P[\w\d-]+)/$', 'entry', > name="entry"), > Have you tried this: (?Pjoh

Re: how to make cron works

2008-02-15 Thread Thomas Guettler
On unix (at least linux) you can run a script with an empty environment like this: env -i path/to/script This way you can test on the shell what goes wrong. I do all the set up in .bashrc an and run the cron job like this: 0 * * * . $HOME/.bashrc; $HOME/.../script HTH, Thomas [EMAIL

Re: Problem with django.db.transaction.commit_manually

2008-02-18 Thread Thomas Guettler
Hi, You get this because the transaction is 'dirty' (some statement was executed, but there was no commit/rollback afterwards). I guess this happens in render_to_response in your example. > K' > finally: > if result['status'] == 'OK': > otherfile.test() > rese

LDAP Auth and Groups

2008-03-03 Thread Thomas Guettler
ser in the database. One way around it, would be to use strings instead of foreign keys But mainting a copy of the session module is no fun. Permission checking would have to be implemented, too. Does anyone know these problems? How did you solve them? Thomas [1] http://code.djangoproject.com/t

Re: Can't redirect using HttpResponseRedirect with a form in a template inclusion tag

2008-03-06 Thread Thomas Guettler
n with onclick="... location.href='...'" HTH, 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 us

Re: form.ChoiceField

2008-03-06 Thread Thomas Guettler
the admin interface. 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 pos

Re: Using primary key ID in file upload location?

2008-03-10 Thread Thomas Guettler
ments are files are in a special directory. path../OBJECT_ID/... The drawback is, that I can't use the admin interface for uploading images. But the benefit is, that I can add attachments by copying a file into this directory. HTH, Thomas -- T

Re: User created in postgresql is not found when Adding Data to the API.

2008-03-26 Thread Thomas Guettler
pwdtuple[0] DATABASE_USER = USER # password, host and port are empty }}} This way you need no password since the authentication is done via unix domain socket and your linux user id. HTH, Thomas Chirolo schrieb: > Hello to all. > I'm a newbie trying to learn Django. > I'm running D

Re: User created in postgresql is not found when Adding Data to the API.

2008-03-27 Thread Thomas Guettler
Chirolo schrieb: > Hi again. > I tried what Thomas suggested, but I still get the following error: > NameError: name 'pwdtuple' is not defined > > I am sorry, one line was missing: import os import pwd pwdtuple=pwd.getpwuid(os.getuid()) USER=pwdtuple[0] HOME=pwdtuple[

Re: Howto execute custom SQL from the command line

2008-03-27 Thread Thomas Guettler
tried using manage.py but I don't know the good options. > So I would like to do sth like : > ./manage.py action file.sql > That is what I was trying to do. > > You can do this (at least on unix like systems): echo 'SELECT * from app_mytable;' | ./manage.py dbs

Re: User created in postgresql is not found when Adding Data to the API.

2008-03-28 Thread Thomas Guettler
options: - drop the old DB or tables, and call syncdb. (Data gets lost) - Modify the database with "ALTER TABLE" For the second solution, you can call "./manage.py sqlall old.sql" before and "./manage.py sqlall new.sql" after the update. Then compare both files

Re: How to check the SQL that the Django ORM is executing?

2008-03-28 Thread Thomas Guettler
snippets.org/snippets/344/ -- 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: Adding an "invalid" choice to a ChoiceField?

2008-04-01 Thread Thomas Guettler
being valid > ('general', 'General enquiry'), > ('bug', 'Bug report'), > ('suggestion', 'Suggestion'), > ) > > class ContactForm(forms.Form): > topic = forms.ChoiceField(choices=TOPIC_CHOICES) > T

FYI: Random Newline in POST data

2008-04-02 Thread Thomas Guettler
: http://bugs.python.org/issue170 I post this here, in hope it safes time for other developers. Unfortunately there is no good fix (except patching python) found yet. Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de

Re: ***SPAM*** Re: Adding an "invalid" choice to a ChoiceField?

2008-04-02 Thread Thomas Guettler
7;m > not able to locate it anywhere. > > >> And required=False for the ChoiceField (which is the default). >> > > Are you sure? the newforms documentation [1] seems to indicate that > required=True is the default for all Fields. > Sorry, this was a typo.

Re: Serving binary files "through" django

2008-04-05 Thread Thomas Kerpe
relatively slow mod_python-apache. If you are using Apache or lighttpd as a frontend-proxy you can use a similar aproach with: X-Sendfile. Or you use Amazon s3 etc... Greets, Thomas Kerpe --~--~-~--~~~---~--~~ You received this message because you are subscribed to

Re: Serving binary files "through" django

2008-04-07 Thread Thomas Kerpe
setups the frontend-proxy also can handle the load-balancing stuff. //Thomas --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googleg

Re: paginator

2008-04-07 Thread Thomas Guettler
Horst Gutmann schrieb: > When you do the actual Paginator.page call the Paginator does nothing > more than you'd have with > Object.objects.[...].all()[lowerlimit:upperlimit]. > > And it does Object.objects.all().count() Which results in "SELECT COUNT(*) ..."

Re: How to check if instance with same values exists

2008-04-07 Thread Thomas Guettler
see 'Internal server error' in his browser. But I don't think you need introspection. Since you know the object at coding time, you don't need to check what kind of objects you are dealing with. Thomas -- Thomas Guettler, http://www.thomas

Re: ModelForms check if value has changed.

2008-04-07 Thread Thomas Guettler
t; > Is their a way to get the 'initial' value of the email formfield and > only perform a check if it has changed? > > I wrote a snippet which checks if a form has changed. Maybe it helps you: http://www.djangosnippets.org/snippets/621/ Thomas -- Thomas Guettler

Re: Making login work with every page.

2008-04-07 Thread Thomas Guettler
t some which are under /public/... Be sure, that you don't do infinite redirects: if not re.match(r'^/(login|logout|public/.*$', request.path) ... : ... return django.http.HttpResponseRedirect(login_url) -- Thomas Guettler, http://www.thomas-guettler

Intial Data from Script

2008-04-08 Thread Thomas Guettler
Hi, how can I insert initial data from a script? Static SQL files don't work for my case. Background: I need to load some SQL (tsearch2 (postgresql)) if the database version is smaller than 8.3 ... Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) t

Application specific settings

2008-04-08 Thread Thomas Guettler
Hi, what is the best way for application specific settings? Up to now I do it like this: {{{ # settings.py import APPNAME }}} APPNAME is a small python file where I store the values. Most of the time there are only some lines like this: var=value. Thomas -- Thomas Guettler, http

Re: Intial Data from Script

2008-04-09 Thread Thomas Guettler
se. I found this. The solution is post_syncdb signal: http://www.b-list.org/weblog/2007/nov/21/install-time/ Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de --~--~-~--~~~---~--~~ You received this message bec

Re: Search Frameworks

2008-04-15 Thread Thomas Guettler
, ... you need a way to convert them to unicode. HTH, Thomas Güttler [1]: http://www.postgresql.org/docs/current/interactive/datatype-textsearch.html -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de --~--~-~--~~~---~--~

One app installed several times

2008-04-15 Thread Thomas Guettler
'.' + view, args=args, kwargs=kwargs) except NoReverseMatch: return '' Any thoughts how to do this better? Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de --

Re: One app installed several times

2008-04-16 Thread Thomas Guettler
parts on two site. several projects which use one app: Several databases. Completely separated. my solution: One DB, several tables. Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de --~--~-~--~~~---~--~~ You r

Re: Enterprise applications with Django

2008-04-16 Thread Thomas Guettler
be), news sites, forums ... > I guess YouTube is highly concurrent, distributed ... I think you can create enterprise applications with django and python. What do you think is possible with Java, that you can't do with python? Thomas -- Thomas Guettler, http://www.thomas-guettler

Re: define special attributes with ModelForm

2008-04-21 Thread Thomas Guettler
def __init__(self, *args, **kwargs): super(TestForm, self).__init__(*args, **kwargs) self.fields['string'].widget.attrs['size']=64 }}} -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de --~--~-~--~~--

Re: Django Installation Questions on Ubuntu

2008-04-21 Thread Thomas Kerpe
> Hi khayman, Replace: SetEnv DJANGO_SETTINGS_MODULE settings.py With: SetEnv DJANGO_SETTINGS_MODULE projectname.settings //Thomas Am 21.04.2008 um 23:06 schrieb khayman: > > I have installed Apache, modpython and Django via apt-get. Apache and > modpython are working (I can

Re: Model Options for Admin Site

2008-04-21 Thread Thomas Kerpe
Hi James define a __str__ or better __unicode__ method within your model which returns the correct string. i.e. def __unicode__(self): return self.name //Thomas Am 21.04.2008 um 23:55 schrieb jwwest: > > Hey all, > > I'm not sure what I'm doing wrong in my model

Re: Model Options for Admin Site

2008-04-21 Thread Thomas Kerpe
James, have a look here: http://www.djangoproject.com/documentation/model-api/#list-display //Thomas Am 22.04.2008 um 00:07 schrieb jwwest: > > Wow, awesome. Thank you! > > On the same subject, is there a way to display more information on the > record in the listing rathe

Re: How to get ':' in address?

2008-04-22 Thread Thomas Guettler
AFAIK ':' is not allowed in a URL path. Nevertheless there is an open ticket about ':' in URLs: http://code.djangoproject.com/ticket/6621 Thomas Manuel Meyer schrieb: > Hey, > > I wonder how to get a ':' (btw: what's its name in english?) in my

Running Tests: Stop at first error

2008-04-23 Thread Thomas Guettler
Hi, if one unittest fails at the database level, often all following tests fail with this error: execute SQL failed: current transaction is aborted, commands ignored until end of transaction block Is there a way to stop after the first failing test? Thomas -- Thomas Guettler, http

Show diff between fresh and running database schema

2008-04-23 Thread Thomas Guettler
le for postgres, you would need something like for other DBs, too. 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 &

Re: Show diff between fresh and running database schema

2008-04-23 Thread Thomas Guettler
Malcolm Tredinnick schrieb: > On Wed, 2008-04-23 at 15:37 +0200, Thomas Guettler wrote: > >> Hi, >> >> has some one a script to show the difference between the >> running database and one which get created by syncdb? >> >> >> > This so

Re: is_valid() name change?

2008-04-25 Thread Thomas Guettler
gic, that cleaned_data is sometime available and sometimes not. The developer should get a better error message then 'AttributeError'. I wrote a ticket some time ago. If you care, please leave a comment: http://code.djangoproject.com/ticket/6675 Thomas -- Thomas Guettler, http://www.

Re: is_valid() name change?

2008-04-25 Thread Thomas Guettler
Malcolm Tredinnick schrieb: > On Fri, 2008-04-25 at 09:37 +0200, Thomas Guettler wrote: > [...] > > >> I wrote >> a ticket some time ago. If you care, please leave >> a comment: >> >> http://code.djangoproject.com/ticket/6675 >> >

Re: Full-text searching in postgres with qsrf

2008-05-13 Thread Thomas Guettler
s a column and not a table. According to http://www.djangoproject.com/documentation/db-api/ you need select_params select={ 'rank': "rank_cd(textsearchable, to_tsquery(%s), 32)", }, Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler

Re: dynamically filling ChoiceField

2008-06-23 Thread Thomas Guettler
; How do I dynamically fill a ChoiceField by filtering on a value known > to the URLView? Every "dynamic fill" example I've found assumes the > form knows it all - I haven't seen anything which shows me how to pass > that value from the view to the form. > >

Adding fields to form in form.clean()

2008-06-25 Thread Thomas Guettler
e the uncleaned request.POST or form.data. I guess I need to create two forms .. Any hints? Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de --~--~-~--~~~---~--~~ You received this message because you are subscribed t

Re: upload file to specific directory/id?

2008-06-25 Thread Thomas Guettler
files to the directiory .../ID/, without the need to update the database. If you need some data for every file in the database: Marty Alchin improved the current FileField a lot. I think it will get into django soon: http://code.djangoproject.com/ticket/5361 Support pluggable backend

Re: Adding fields to form in form.clean()

2008-06-25 Thread Thomas Guettler
Hi Malcolm and others, my first to create a child form failed, because motherform.cleaned_data does not exist, if a validation error occurred. Now I populate the childform during motherform.clean() and it works. Thank you very much for all your great work Malcolm! Thomas Malcolm Tredinnick

django-registration

2008-07-11 Thread thomas schreiber
Is there a reason emails aren't being sent when running this app on localhost? Is there more that needs to be done to get the email sending part working other then what is included with django- registration? I'll come back to it later today. Thanks, Tom --~--~-~--~~~-

Custom Widget

2007-05-08 Thread Thomas Rabaix
attrs=None): if value is None: value = '' final_attrs = self.build_attrs(attrs, name=name) return u'' % (flatatt(final_attrs), escape(value)) Thomas --~--~-~--~~~---~--~~ You received this message because yo

string to unicode Was: Issue with database Postgresql :(

2007-05-09 Thread Thomas Guettler
" # simple string ustr=s.decode("latin1") # string to unicode sutf8=ustr.encode("utf8") # back to simple string, utf8 format Thomas BTW, I modified base.py by looking at the unicode branch. Now my unicode problems are gone: --- tmp/django/trunk/django/d

widgets.py And unicode

2007-05-09 Thread Thomas Rabaix
), selected_html, escape(smart_unicode(option_label.__str__() output.append(u'') return u'\n'.join(output) is it a bug or am i doing something in the wrong way ? Thomas Rabaix --~--~-~--~~~---~--~~ You received this message becaus

Re: widgets.py And unicode

2007-05-10 Thread Thomas Rabaix
Malcolm Tredinnick wrote: > On Thu, 2007-05-10 at 01:45 +0200, Thomas Rabaix wrote: >> Hello, >> >> I have a newform object which I prepopulate some fields : >> >> form = MenuForm() >> >> tu = () >> for m in Menu.objects.all()

First impression of django

2007-05-11 Thread Thomas Guettler
e of all rows): {% for result in results %} {% for item in result %}{{ item }}{% endfor %} {% endfor %} How can you do the same with python code? Nevertheless I like django a lot. Maybe some parts can get fixed before 1.0. Thomas --~--~-~--~~~---~--~~ Y

Re: First impression of django

2007-05-11 Thread Thomas Guettler
PTION_WHEN_TEMPLATE_STRING_INVALID is not set, it should default to the value of DEBUG. Thomas --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us

Is it essential to run setup.py?

2007-05-22 Thread Thomas Ashelford
our or two!) Is there any kind soul who could explain what I can do to install 0.96 without root access? Cheers Thomas --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this gro

Re: Is it essential to run setup.py?

2007-05-22 Thread Thomas Ashelford
o install an official Django release! Previously I've worked with either dev releases (using svn), or pre-installed official releases (on WebFaction), so I haven't had to face this before. Thomas --~--~-~--~~~---~--~~ You received this message because you are

Re: Is it essential to run setup.py?

2007-05-23 Thread Thomas Ashelford
ath, too, right? Not stopping one directory > too soon?) You have given me a 'doh' moment. I should have figured that out for myself, but all this has given me a much better understanding of how Python path works - it was always one of those things I sort-

FileField: id of row (like strftime)

2007-05-25 Thread Thomas Güttler
ct) This way all attachments of one MyObjects are in the same directory. This would be very nice. Thomas -- Thomas Güttler, http://www.tbz-pariv.de/ Bernsdorfer Str. 210-212, 09126 Chemnitz, Tel.: 0371/5347-917 TBZ-PARIV GmbH Geschäftsführer: Dr. Reiner Wohlgemuth Sitz der Gesellschaft

Re: Django multilingual app, urls

2007-05-25 Thread Thomas Rabaix
guage code. - find a way that the get_absolute_url return link with the correct language code Thomas Eugene Morozov wrote: > Hello, > I'm creating Django multilingual app using django-multilingual and > homebrew middleware. My middleware is similar to Django > LocaleMiddleware but

Re: FileField: id of row (like strftime)

2007-05-29 Thread Thomas Guettler
Am Freitag, 25. Mai 2007 10:51 schrieb Thomas Güttler: > Hi, > > the upload_to argument to FileField evals strftime formatting. > > I would like to have the ID of the belonging row. > > Example: One MyObject has N attachments. > > class Attachment(models.Model):

Re: Newforms / Validation / Uniqueness

2007-05-30 Thread Thomas Guettler
Am Dienstag, 29. Mai 2007 21:19 schrieb ringemup: > Hello -- > > I'm using a basic form_for_model() form object for a model that has a > unique=True constraint on a field other than the primary key. > > When validating submitted data, is there a reason the form check that > that constraint hasn't

Re: Should file uploads work in 0.96 admin?

2007-06-01 Thread Thomas Guettler
Am Freitag, 1. Juni 2007 01:35 schrieb Andrew: > I'm just wondering my expectations are correct: > > Using 0.96, given a model with an ImageField, the admin interface > gives me (what looks to be) a file upload widget. > > I should be able to select a file from that widget, and once I save > the m

Re: subclassing flatpages model

2007-09-12 Thread Thomas Badran
I do exactly this by adding a template admin/flatpages/flatpage/change_form.html That simply looks like (your tiny_mce location may vary): {% extends "admin/change_form.html" %} {% block extrahead %}{{ block.super }} {% endblock %} Hope that helps Tom On Wed, 2007-09-12 at 17:02 +, M

Re: Decoupling templates

2007-09-12 Thread Thomas Badran
Personally, i have a templates directory in my app directory: project/templates project/blog/templates project/otherapp/templates etc. In my settings, i build the template dirs by definng all my dirs as relative paths, and doing some magic (hosted is worked out elsewhere, and is just the differen

Re: Decoupling templates

2007-09-12 Thread Thomas Badran
Better suggestion than mine, you learn something new every day .. I'm converting to using this now. Thanks Rajesh Tom On Wed, 2007-09-12 at 18:54 +, RajeshD wrote: > > > How can I decouple my templates to an app specific directoy? The way that my > > apps are self contained also regarding

tinymce popups in the admin interface

2007-09-13 Thread Thomas Badran
Any one have some nice css/theme for making tiny mce look like the rest of the admin interface. It integrates so nicely anyway, and would be awesome to have it look the same. Thanks Tom --~--~-~--~~~---~--~~ You received this message because you are subscribed t

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 100

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

2007-09-27 Thread Thomas Guettler
'module' object has no attribute 'models' > > > Am I missing something required in the environment when I do it > manually? Sometimes submodules are imported automatically, and sometimes not. I never used a line like this: import django.contrib.auth as

No tests for newforms

2007-10-04 Thread Thomas Güttler
Hi, I was told to include a test in my newforms patch: http://code.djangoproject.com/ticket/5335 I couldn't find any tests for newforms. Am I blind? Thomas -- Thomas Güttler, http://www.tbz-pariv.de/ Bernsdorfer Str. 210-212, 09126 Chemnitz, Tel.: 0371/5347-917 TBZ-PARIV

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

2007-10-05 Thread Thomas Guettler
> TypeError at /admin/plush/orders/ > float argument required How do you add a new record: admin interface, new-admin interface, custom code? In Python strings are not automatically converted to numbers. You need to be explicit: value=float("1.2") Thomas --~--~-~--~~-

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 children

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 s

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

2007-10-09 Thread Thomas Guettler
, too. But I need to modify a lot of import statements. 1. Is this usefull for all django users? Then I would write a patch. 2. How can you exchange the method without modifying django? Thomas --~--~-~--~~~---~--~~ You received this message because you are sub

form_for_model should return TextareaWidget

2007-10-10 Thread Thomas Guettler
args): kwargs["widget"]=forms.widgets.Textarea({"cols": kwargs.pop("cols"), "rows": kwargs.pop("rows")}) return super(self.__class__, self).__init__(*args, **kwargs) Thomas --~--~-~--~~~---~--~~

Re: form_for_model should return TextareaWidget

2007-10-10 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
llib.quote should return a 7 bit ascii string. Thomas --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe fr

Better FileField

2007-10-11 Thread Thomas Guettler
quote(). * The database should contain the unicode filename. Has someone the same problems? Has someone solved/coded this? Thomas PS: This patch only uses a better filename normalization: http://code.djangoproject.com/ticket/3119 The unicode name get&#

Re: Request data is lost between two views

2007-10-16 Thread Thomas Guettler
URL. This will redirect the webbrowser to the new URL with data. HTH, Thomas --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@go

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

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 i

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)']) &

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 inde

Re: Python 2.3 deployment

2007-10-19 Thread Thomas Guettler
.288045, min 0.00160483, max 0.99949 2000 times normalvariate HTH, Thomas --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-user

Get all related instances

2007-10-22 Thread Thomas Güttler
_object in meta.get_all_related_objects()+meta.get_all_related_many_to_many_objects(): attr = getattr(instance, related_object.get_accessor_name()) related.extend(attr.all()) return related -- Thomas Güttler, http://www.tbz-pariv.de/ Bernsdorfer Str. 210-212, 09126 Chemnitz, Tel.: 0371/5347

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 abou

Re: Avoid Unhandled exception page from flup

2007-10-23 Thread Thomas Guettler
ate or handle_500() should be called. Nevertheless sometime I got this, too. Mostly it was because the debug template did not handle unicode errors in all places. A patch to use errors="replace" in debug.py was commited some days ago. Thomas --~--~-~--~~~

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

2007-10-25 Thread Thomas Guettler
pi docs is this > mentioned. > > Unless I'm misunderstanding it, evidently, Django is doing some magic > here for the user and it probably should be mentioned in the docs. Hi, most people read the tutorial before reading db-api. But you are right,

Re: how to append a array for JSON use,thanks!

2007-10-26 Thread Thomas Guettler
You want: '''{"version":...}''' this means you need to pass a dictionary to simplejson.dumps() mydict={"version":..., "markers": content, }... ..dumps(mydict) Am Freitag, 26. Oktober 2007 10:09 schrieb [EMAIL PROTECTED]: > i just want to use JSON in gmap, here is an alterative method for > UTF

Re: save() datefield

2007-10-26 Thread Thomas Guettler
% > int(karateka_id) ) > ## end views.py ## this looks very strange. I guess you are new to python programming. Some hints: - don't catch all exceptions ("except:") - keep only few (at best one line) between "try"

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

2007-10-29 Thread Thomas Guettler
ith newforms, you can put several forms between You need to pass the prefix parameter to the constructor. Validation is documented. Please ask again (here) if this does not help. Thomas --~--~-~--~~~---~--~~ You received this message because you are subscribed t

settings.py gets imported twice

2007-11-05 Thread Thomas Güttler
rt__(self.SETTINGS_MODULE, {}, {}, ['']) File "/localhome/user/myproject/settings.py", line 147, in ? This shnippet has a workaround: http://www.djangosnippets.org/snippets/16/ (I have not tested it yet) I think it would be better to avoid a second import. Any hints? Th

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 tw

Re: settings.py gets imported twice

2007-11-06 Thread Thomas Guettler
means the if-statement above will be false (and addHandler() would not be called), even on the first run. Thomas --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send e

Re: newforms: how to validate form_for_model ?

2007-11-07 Thread Thomas Guettler
ternate-base-class Thomas --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email t

Re: Start development: which branch?

2007-11-07 Thread Thomas Guettler
ntroduction of newforms) Hello, use trunk. At the moment there is no better branch. Thomas --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: name 'django' is not defined

2007-11-07 Thread Thomas Guettler
HONPATH 2. modify sys.path: sys.path.append('/yourpath') 3. Move the django directory (the one that contains e.g. 'newforms') to a place on your sys.path. Thomas --~--~-~--~~~---~--~~ You received this message because you are subscribed to t

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
depend on each other, I would not call each an application. All three together build an application. Thomas > > discussion: > from osite.user.models import User > from osite.multimedia.models import Multimedia > class Discussion(models.Model): > author = models.ForeignKey(U

Re: Circular dependencies problem

2007-11-13 Thread Thomas Guettler
eeded) user.py mm.py discussions.py HTH, Thomas --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To u

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 FileFiel

Testing forms

2007-11-16 Thread Thomas Guettler
t(url) first, parse the HTML and build the post dict from the input tags. Has some a better solution or hint? Thomas --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this gr

Re: Testing forms

2007-11-16 Thread Thomas Guettler
Responding to myself: I choosed solution 2 (parse HTML form) with the help of ClientForm: http://www.djangosnippets.org/snippets/467/ Comments welcome Am Freitag, 16. November 2007 13:03 schrieb Thomas Guettler: > Hi, > > my has a lot of input widgets which are build fro

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