OT: Drawing lines in the browser

2009-08-18 Thread Thomas Guettler
Hi, this is offtopic: How can you draw lines in a (django) web application? I think you need to use flash or java to do it. I googled for it, but found only beta quality projects. Has anyone experience with this? Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli

Re: OT: Drawing lines in the browser

2009-08-19 Thread Thomas Guettler
Chris McCormick schrieb: > On Tue, Aug 18, 2009 at 07:40:00AM -0700, Ian McDowall wrote: >> On Aug 18, 8:53 am, Thomas Guettler wrote: >>> Hi, >>> >>> this is offtopic: How can you draw lines in a (django) web application? >>> >>> I think

Re: Error in setting up psycopg2

2009-08-19 Thread Thomas Guettler
quot;, line 9, in > process_request > [Wed Aug 19 11:00:26 2009] [error] [client 127.0.0.1] ImportError: No > module named db Here you will find your ImportError and sys.path. -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de --~--~-~--~~--

Re: Problem with "Cancel" button

2009-08-19 Thread Thomas Guettler
It is > > def cancel(request): > return render_to_response('cancel.html') I guess the error is in cancel.html. You need to post it here. HTH, Thomas Güttler -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de --~--~

Re: Check server type at runtime?

2009-08-19 Thread Thomas Guettler
Hi, AFAIK there is no such variable in settings.py. It would be nice to have it. In your company we use the variable STAGE. ringemup schrieb: > Is there any way to check at runtime whether Django is running on the > development server? > > Thanks! -- Thomas Guettler, http:

Re: Problem with Django/Jython and Postgres backend

2009-08-19 Thread Thomas Guettler
u...@host> find django/ -name '*.py'|xargs grep 'class DatabaseClient' django/db/backends/postgresql/client.py:class DatabaseClient(BaseDatabaseClient): ... Mine just inherits from BaseDatabaseClient. -- Thomas Guettler, h

Re: Django "freezing" after a few minutes?

2009-08-19 Thread Thomas Guettler
GINT (like ctrl-c) the the PID. In the stacktrace you can see where the python code was hanging (should be in apache error log). HTH, Thomas erikcw schrieb: > Hi, > > I'm running Django through mod_wsgi and Apache (2.2.8) on Ubuntu 8.04. > > I've been running Djan

Re: Django "freezing" after a few minutes?

2009-08-20 Thread Thomas Guettler
of which tcp/ip connections the process waits for in the system call select. You can write a simple script with python and psycopg2 (without django, just execute a simple SELECT statement) and check if you can still connect after the pages don't get through django anymore. Thomas -- Th

Re: Error in setting up psycopg2

2009-08-20 Thread Thomas Guettler
The important part: cannot import tz. Maybe you need to install it. I don't this module. Thomas Simon Lee schrieb: > Hi Thomas, > > Tried your method and modified /mysite3/apache/myapp.wsgi as followed: > > import os, sys > sys.path.append('/Users/myname&#

Re: Check server type at runtime?

2009-08-20 Thread Thomas Guettler
One question, three correct and differnt answers! You could have a look at sys.argv Thomas ringemup schrieb: > > Oh, I wasn't asking about what physical server or what host the site > is running on. I was hoping someone could tell me a way to determine > at runtime whether

Re: Error in setting up psycopg2

2009-08-20 Thread Thomas Guettler
Hi Simon, it could be a permission problem: in the code do something like assert False, os.getuid(). then on the shell, you need get this user: su - corresponding-user id # check if you have this UID #try to open the file: more /.../tz.py HTH, Thomas Simon Lee schrieb: > tz.py is in

Re: Error in setting up psycopg2

2009-08-23 Thread Thomas Guettler
/bin/false means he has no login-shell. Change this to /usr/bin/bash (or you preferred shell). If you get "permission denied" while accessing the python files as www you need to run "chmod -R a+rX /..." Thomas -- Thomas Gu

Re: Error in setting up psycopg2

2009-08-24 Thread Thomas Guettler
ore /Library/Frameworks/Python.framework/Versions/2.6/lib/ > python2.6/site-packages/psycopg2/tz.py > > I can read the file with more. Seems that there is no problem on > permission. Please advise. > -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettle

Re: Error in setting up psycopg2

2009-08-26 Thread Thomas Guettler
Simon Lee schrieb: > Hi Thomas, ... > > I did a search on the web but found only two links on similar error > without any solution. Does anyone know what caused "Symbol not found: > _PQbackendPID"? > Try to to install a new version von psycopg2, since it see

Re: How to check which form was submitted?

2009-08-27 Thread Thomas Guettler
> Post the part of your view that handles your forms. >> >> -- dz >> > > Nothing special > > if request.method == 'POST': > form = RegisterForm(request.POST) > if form.is_valid(): > pass > > And second one

Re: Many-to-many column admin interface

2009-08-27 Thread Thomas Guettler
) > > Now when i edit A in the admin interface everything is ok, i can select all > B instances A belongs to. > > What i need now is to be able to do the same thing from B's admin interface. > When i edit B i want to select all instances of A B belongs to. > > Is there a

Re: Many-to-many column admin interface

2009-08-30 Thread Thomas Guettler
not syncdb. > Its really simple, just 6 lines at all. -- 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&quo

Re: django & flex

2009-08-31 Thread Thomas Hill
sport protocol. I guess long story short, stick with JSON, REST, SOAP, etc... it will make future expansion easier (if you can see it going that route). -Thomas On Mon, Aug 31, 2009 at 11:32 AM, Randy Barlow wrote: > > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > solar decl

Re: model validation errors

2009-09-01 Thread Thomas Guettler
ound http://code.djangoproject.com/ticket/6845 with a patch to do > model validation (1 year ago) that looks > like what I need, but is it stable? -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de --~--~-~--~~~---~--~---

Re: Restricting database permissions

2009-09-07 Thread Thomas Guettler
a configuration file level so that upon running > syncb, the permissions are in place? > > Any pointers greatly appreciated. -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de --~--~-~--~~~---~--~~ You received this

Re: Django Project Management App

2009-09-11 Thread Thomas Guettler
ked > for django project management projects to use and/or contribute to, > but there doesn't seem to be any out there. > There is one. I searched for an alternative to trac some time ago. Basie can handle several SVN-Repositories (Trac does not) and uses django. But I had to tim

Re: Foreign keys in admin

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

Re: dynamic url pattern

2009-03-26 Thread Thomas Guettler
ject.database.reports.%s" % name, globals(), locals(), [name]) method=getattr(module, name) return method(request) -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de --~--~-~--~~~---~--~~ You received this message

Custom get_object_or_xxx?

2009-03-26 Thread Thomas Hill
Hey all, I'm trying to implement a function similar to get_object_or_404. I'm trying to check permissions for a user, and if those permissions are met, then I want them to be sent to a page explaining what's going on. I found the exception PermissionDenied, but I can't find a way to do a custom per

Re: Updating a model method

2009-03-30 Thread Thomas Guettler
you need to set maximum-requests=1. This will reload you code for every request. Of course the production server should have a different value. HTH, Thomas Miguel schrieb: > Hi all, > > I have a model where I have defined a method : > > def print_html(self): > [...] >

Re: Updating a model method

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

Re: Counting queries and query execution time

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

Re: Merging apps

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

Re: how to connect postgresql

2009-04-09 Thread Thomas Guettler
Hi, this is not a django or python problem. I guess you get more help from a java list. Maybe news:comp.lang.java is the right place. Thomas NK B schrieb: > hello friends > i'm work with django. but i create the reports in java > how to link java and postgres

Fieldlookup: NOT

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

Re: Fieldlookup: NOT

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

Cookie based Messages

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

Re: django CommaSeparatedStringField component

2009-05-05 Thread Thomas Guettler
Hi Joshua, I have coded this some time ago. I uploaded it to djangosnippets for you (and other people): http://www.djangosnippets.org/snippets/1491/ Thomas Joshua Partogi schrieb: > Dear all, > Does anybody know a good CommaSeparatedStringField for django? The one that > I expec

Re: What debugger do you use?

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

Re: model form validation always failing

2009-05-19 Thread Thomas Guettler
the admin > interface without any problems -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. T

Storing related models in cache?

2009-06-07 Thread Thomas Hill
Hey all, I'm trying to save on db queries in an online game I'm making, so I'm trying to save as many things in memcached as possible, and invalidating whenever the game state changes. So upon the first call, or after a game state change, I pull in my game model instance, and all of the related mod

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

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

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

2009-06-08 Thread Thomas Guettler
Chris Stoyles schrieb: > Hi Thomas, > > The reason I want to be able to rollback (but still commit by log entries) > is because it is sometimes valid for this particular view to throw an > exception and fail. If this happens, I need to rollback any model objects > that hav

Re: URL Patterns for URL Encoding Symbols

2009-06-11 Thread Thomas Sutton
locale. If UNICODE is > set, this will match the characters [0-9_] plus whatever is classified as > alphanumeric in the Unicode character properties database. You need to replace the `\w` with something that will match the characters you want. If you want everything that `\w`

Re: Determining the type of a form field within a template

2009-06-13 Thread Thomas Sutton
ndField? And it still doesn't contain anything that lets me determine the type of the original field (other than looking at the generated HTML and taking a guess)? Cheers, Thomas Sutton --~--~-~--~~~---~--~~ You received this message because you a

Re: Problem to deploy on production server

2009-06-15 Thread Thomas Guettler
Hi, do you use the cache module? Be sure, that both projects use different ones. Maybe you need to set SESSION_COOKIE_NAME if the domain name is the same. Do you use one database or two? (Is settings.DATABASE_NAME the same?) Thomas Francis schrieb: > Hi, > > I have completed one

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

2009-06-17 Thread Thomas Guettler
Hi, Does restarting apache or fast cgi server help? Do you access the page through a proxy? Thomas neri...@gmail.com schrieb: > Hello, > > I'm trying to make changes to views and forms but when I refresh the > browser to view/try the changes nothing seems to have changed

readonly forms

2009-09-14 Thread Thomas Guettler
get this in to django (or contrib). [1] http://www.djangosnippets.org/snippets/1682/ -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

Bug in inspectdb.py and changes in Firebird backend files?

2009-09-28 Thread Thomas Steinmaurer
n't know if anybody is interested in those changes. -- Best Regards, Thomas Steinmaurer LogManager Series - Logging/Auditing Suites supporting InterBase, Firebird, Advantage Database, MS SQL Server and NexusDB V2 Upscene Productions http://www.upscene.com My blog: http://blog.upscene.

Combined sort order in admin area?

2009-09-28 Thread Thomas Steinmaurer
Hello, is there a way to have a combined sort order in a list in the admin area? For example ascending order by one field and descending order by another field? Thanks, Thomas --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

Re: Bug in inspectdb.py and changes in Firebird backend files?

2009-09-28 Thread Thomas Steinmaurer
NG clause (Firebird 2.0 and higher) >> * Improved introspection support >> >> Don't know if anybody is interested in those changes. > > Firebird support isn't part of the Django core, so you'll need to take > this up with the maintainers of the Firebird ba

Re: Combined sort order in admin area?

2009-09-29 Thread Thomas Steinmaurer
roposes to > add this ability: > > http://code.djangoproject.com/ticket/11868 Thanks Karen. Good to see that there is probably something on its way. Thomas --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Re: database design

2009-09-30 Thread Thomas Guettler
reignKey(User, verbose_name=_("Customer"), > related_name=_("orders")) > status = models.ForeignKey("OrderStatus",related_name=_("orders")) > > and then i got Product, OrderDetail, ShippingAddress, Shipment etc... > ...

Re: database design

2009-09-30 Thread Thomas Guettler
mart wrote: > > On Sep 30, 2009, at 4:17 PM, Thomas Guettler wrote: > >> In OrderDetail you have a ForeignKey to Product. But you need to >> *copy* >> the price. Example: if someone orders something at day1 for 1 dollar, >> and you set the price on day2 t

Problem with list_filter

2009-10-06 Thread Thomas Steinmaurer
list_filter = ['model_version'] search_fields = ['database_instance_name'] admin.site.register(RelationalDatabase, RelationalDatabaseAdmin); then model_version gets displayed in the list, but although list_filter is present, a filter box isn't available in the admi

Re: Problem with list_filter (SOLVED)

2009-10-06 Thread Thomas Steinmaurer
Thomas Steinmaurer wrote: > Hello, > > I have the following model: > > class ModelVersion(models.Model): > model_version_id = models.AutoField(primary_key=True) > major_version = models.IntegerField(null=True, blank=True) > minor_version = models.Integ

Re: Archiving Model Instances?

2009-10-16 Thread Thomas Guettler
an > moving archived entries into another model (table)? … or a more common > solution? -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de --~--~-~--~~~---~--~~ You received this message because you are subscribed to

Re: Archiving Model Instances?

2009-10-16 Thread Thomas Guettler
I forgot to mention, that you can write a custom manager. This way FooModel.objects.all() only returns not archived instances. Thomas Guettler wrote: > Hi, > > If you use indices to access the models, you will see no noticable difference > in speed between 1,000 and 100,000 rows.

Re: Sharing data between two Django sites

2009-10-27 Thread Thomas Guettler
essible (e.g. a CMS). > My problem is that certain data from the Intranet sites have to be > displayed on a publicly accessible site (e.g. a list of staff members > that is maintained on the Intranet). What's the cleanest approach to > solve this? The potential solutions I have

request.get_full_path() vs REQUEST_URI

2009-10-30 Thread Thomas Guettler
://docs.djangoproject.com/en/dev/ref/request-response/#django.http.HttpRequest.META http://docs.djangoproject.com/en/dev/ref/request-response/#django.http.HttpRequest.get_full_path -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de

Re: Darpa challenge

2009-10-30 Thread Thomas Guettler
st person to get the location of all 10 balloons and > submit them will be given $40k. What happens if fools start red balloons, just for fun? It will be hard to distinguish between the original and joke balloons. Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mai

Model instances used for class attributes

2009-12-07 Thread Thomas Guettler
perty does not work, since AFAIK properties only work for instances. Has someone a solution? 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&quo

Re: Model instances used for class attributes

2009-12-07 Thread Thomas Guettler
bruno desthuilliers wrote: > On 7 déc, 11:45, Thomas Guettler wrote: >> Hi, >> >> I have this code: >> >> from django.contrib.auth.models import Group >> >> class MyModel(models.Model): >> default_group=Group.objects.get(name='MyGrou

Re: Help with apache mod rewrite engine

2009-12-08 Thread Thomas Sutton
ted to /sees/comments and than be handled by the wsgi > file but the rewriting is not happening is it possible to rewrite url and > than route it through wsgi script > Something like this? RewriteEngine On RewriteBase / RewriteRule ^comments/ ^sees/comments/ Cheers, Thomas Sutton -- You

Django HTTPS and HTTP Sessions

2009-12-10 Thread Tony Thomas
Hi, I'm using Django 1.1.1 with the ssl redirect middleware. Sessions data (authentication etc.) created via HTTPS are not available in the HTTP portions of the site. What is the best way to make it available without having to make the entire site HTTPS? -- You received this message because yo

Re: How do you rollback a transaction outside the context of a request?

2010-04-15 Thread Thomas Guettler
ng like this, where you have no request. I explained it in my first post. 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

Re: readonly unittests for production site

2010-04-15 Thread Thomas Guettler
Benjamin Reitzammer wrote: > Hi Thomas, > how did you make sure, that the tests are read-only? Did you apply any > special measures/tricks (like using a special DJANGO_SETTINGS_MODULE, > that has read-ony access to the database), or are your tests read-only > by convention an

Re: How do you rollback a transaction outside the context of a request?

2010-04-15 Thread Thomas Guettler
Bill Freeman wrote: > How does this apply when there is no request? I'm not following you. I forgot to say, that I would create a temporary script file which uses the decorator commit_on_success instead of using "manage.py shell". Thomas -- Thomas Guettler, http://www.

Re: where I can find good django video tutorial?

2010-04-21 Thread Thomas Schreiber
Also there are the archives from the conferences. There is more to wade through to find introductory material, but the talks are excellent nonetheless: http://djangocon.blip.tv/posts?view=archive&nsfw=dc http://pycon.blip.tv/posts?view=archive&nsfw=dc Thomas On Tue, Apr 20, 2010 at 13:4

Models as remote API: High-level questions

2010-04-28 Thread Thomas Allen
it is configured to handle requests based on HTTP methods, with the idea of integrating with Rails' ActiveResource which sadly proved to be very buggy for me (so I'm happily back with good old Django). Thanks, Thomas -- You received this message because you are subscribed to the Google

Re: Models as remote API: High-level questions

2010-04-28 Thread Thomas Allen
That looks excellent, thank you. I like that it integrates with the admin, which means I can test the interaction with the remote app very easily. Of course I'm still interested in any other opinions :^) Thomas On Apr 28, 2:08 pm, Tom Evans wrote: > On Wed, Apr 28, 2010 at 6:37 PM

Template composition: Rendering based on permissions

2010-04-28 Thread Thomas Allen
rly, I would like to display links only if the user passes the view in question's @has_permission test. Thanks, 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...@googlegroups.

Re: Template composition: Rendering based on permissions

2010-04-28 Thread Thomas Allen
I think that template context processors are the answer to my first question. As for my second question, I could certainly check for permission membership in the provided PermWrapper, but I'm very interested in a way to check this based on the view permission requirement (implicitly). T

Template lookup order not behaving as expected

2010-04-28 Thread Thomas Allen
, 'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware' ) TEMPLATE_DIRS = ( os.path.join(BASEDIR, 'templates') ) Thanks, Thomas -- You received this message because you are subscribed to the Google Groups

Re: Template lookup order not behaving as expected

2010-04-28 Thread Thomas Allen
e "ads" template precedes all others). I thought that an app's view would check its own templates directory before any others but I guess I was wrong...is there a way to override this default top-down lookup behavior? Or some way to specify my template with greater precision while keepin

manage.py runserver --adminmedia

2010-04-28 Thread Thomas Neumeier
Hi, I'm trying to install django-grappelli. the admin media is perfectly found, if I run the development server: "python manage.py runserver --adminmedia=/path/to/grappelli/media". i would like to make a change to settings.py so i can leave out the --adminmedia flag, when calling manage.py runs

manage.py runserver --adminmedia

2010-04-28 Thread Thomas Neumeier
issue? Thanks 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...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more opti

Re: Models as remote API: High-level questions

2010-04-28 Thread Thomas Allen
I'm sorry, I should've specified that I am using Django 1.1 (Django- ROA is compatible with 1.2 only according to its documentation). Thomas -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, sen

Re: Template lookup order not behaving as expected

2010-04-28 Thread Thomas Allen
.html'... Thanks! It looks like that is also how the popular open-source Django apps structure their templates. 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...@googlegroup

contrib.auth: Email address instead of username as identifier

2010-04-29 Thread Thomas Allen
mind a clean, acceptable way to do this would result in no username field at all in the User model. Thanks, 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...@googlegroups.com. To u

Decode a JSON object?

2010-05-03 Thread Thomas Allen
How can I parse a simple JSON object in Django? I would like to parse the response: {"totalspace": 243862.672,"freespace":94053.564} django.core.serializers.deserialize('json', packet) seems to have trouble parsing such a simple string. Thomas -- You receive

Re: Decode a JSON object?

2010-05-03 Thread Thomas Allen
Thanks, I poked around some more and simplejson.loads() was what I needed. 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...@googlegroups.com. To unsubscribe from this group, sen

Set field value for ChoiceField

2010-05-03 Thread Thomas Allen
rst_name, 'email': user.email, 'role': user.get_profile().role, 'client': user.get_profile().client.id }) I output the form with form.as_p, but the corresponding option is not selected. What do I need to do for it to be selected? Thomas -- You received this message because

Re: Set field value for ChoiceField

2010-05-03 Thread Thomas Allen
The field was being set correctly, but my template did not show this until now for some reason. Thomas On May 3, 5:34 pm, Thomas Allen wrote: > If I'm instantiating a form, how do I set a ChoiceField value in it? > > I have a form with an attribute "role" which I am

Admin pre-save hooks

2010-05-05 Thread Thomas Neumeier
This works perfectly. Now I want the Admin to react on this IntegrityError. This is no problem for Y, because i can override the AdminForm and throw a ValidationError in the clean_field method. But how can i make the admin of A react on the IntegrityError without touching As admin.py? Tha

Models: Dynamic field names for open content types

2010-05-07 Thread Thomas Allen
happen: 1. Get the base node data and include field data in the response 2. Build a new model and request the full model instance Altogether, I expect that to get pretty expensive in this application, but it will work as a last resort. I have two other ideas that I find more appealing: 1

Form validation strange behavior

2010-05-13 Thread Thomas Gautier
self._errors["date"] = self.error_class([msg]) del cleaned_data["date"] return cleaned_data Did I miss something for the correct processing of form validation? Or is it only a problem with Django's builtin server? Thanks in advance, Thomas Gautier

Change Default Permissions

2010-05-16 Thread Thomas Neumeier
Hi, i've got an app with one model. this model is filled with some data from a fixture. now i want to remove the add and delete permission for all present and future users for this specific model. the change perm should stay. how can i do this? Thanks PS: using django 1.1.1 -- You received thi

Cannot concatenate context list. Bizarre.

2010-05-18 Thread Thomas Allen
d. I have no idea why that is, because if I replace that line with: context['scripts'].extend(self.scripts) then the scripts are added to the end, and nothing is clobbered. The same goes for the equivalent: context['scripts'] += self.scripts This makes no sense to me. What'

Re: Cannot concatenate context list. Bizarre.

2010-05-18 Thread Thomas Allen
And the following ugly loop adds scripts as I hoped simple concatenation would: def render(self, context): for i in range(0, len(self.scripts)): context['scripts'].insert(i, self.scripts[i]) return '' Thomas On May 18, 2:31 pm, Thomas Allen wrote: > I would like

reverse() with multiple possibilities: Is there a way to retrieve all?

2010-05-18 Thread Thomas Allen
If I have two URLs which resolve to the same view. Is there any way to get both? I rely on reverse() for some "active page" logic and the trouble is that it will only return a single URL, the first match it has encountered. Thomas -- You received this message because you are subscri

Re: Ordering a QuerySet by a Python property ?

2010-05-19 Thread Thomas Guettler
wiki.python.org/moin/HowTo/Sorting/ Your QuerySet gets a list during sorting. This means all items need to fit into the memory. -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de -- You received this message because you are subscribed to the Google

Line continuation in block tag?

2010-05-21 Thread Thomas Allen
Is that possible in a Django template? If my tag spans more than one line, it is rendered as plaintext. 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...@googlegroups.com. To u

Re: Line continuation in block tag?

2010-05-24 Thread Thomas Allen
Thomas Allen wrote: > Is that possible in a Django template? If my tag spans more than one > line, it is rendered as plaintext. Is this not possible? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send

Re: Django 1.2.1 install in Ubuntu 10.04 via Synaptic?

2010-06-01 Thread Thomas Schreiber
here is a getting started (good practices) guide to configuring a django production server. A little old now, but the fundamentals still apply. http://lethain.com/entry/2009/feb/13/the-django-and-ubuntu-intrepid-almanac/ On Tue, Jun 1, 2010 at 12:09, Patrice wrote: > On May 31, 5:35 pm, AD wrote

Re: DJango Deployment

2010-06-01 Thread Thomas Guettler
Hi, why do you use tomcat or mod_python? Please try mod_wsgi, if you use apache. Thomas PM wrote: > Hi , >I am new to Django. > >I have developed a tool using > Python CGI. I have been successfully deploying it using Apache Tom

Re: Getting Duplicate records with Q query

2010-06-03 Thread Thomas Guettler
, I have a simple search criteria that looks in both the > subject and body of the note for the same value. That query doesn't > return duplicates even if a note has the same value in both fields. > > notes = Note.objects.filter( Q(subject__icontains=q) | Q(body__icontains=q)) &g

form.as_p, as_table variation

2010-06-03 Thread Thomas Allen
good bit of _html_output's logic in such a template tag. 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...@googlegroups.com. To unsubscribe from this group, send email t

Re: form.as_p, as_table variation

2010-06-03 Thread Thomas Allen
), unicode(field) )) def select(name, field): return wrapper(name, field, 'select', ( label(name, field), unicode(field) )) Thomas -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, sen

Re: form.as_p, as_table variation

2010-06-03 Thread Thomas Allen
On Jun 3, 12:05 pm, Thomas Allen wrote: > I'm able to get pretty far with the template tag approach. The trouble > is that BoundForms offer no way to directly add attributes, which I > think can only be included when defining the form field in question. Actually if I bypass uni

Loading more than one templatetag library at a time

2010-06-07 Thread Thomas Allen
ter variables would clash. Is there some way to use a single template library to include many? Thanks, 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...@googlegroups.com. To unsu

Re: Loading more than one templatetag library at a time

2010-06-08 Thread Thomas Allen
Is there no way to use a single template library to include many? 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...@googlegroups.com. To unsubscribe from this group, send email

Re: Line continuation in block tag?

2010-06-14 Thread Thomas Allen
tagbody = ' '.join(self.nodelist[0].render(context).splitlines()) token = template.Token(template.TOKEN_BLOCK, tagbody) return '' Thomas Allen On May 24, 1:52 pm, Dennis Kaarsemaker wrote: > On ma, 2010-05-24 at 07:15 -0700, Thomas Allen wrote: > > > Thoma

Validation of dependent form fields

2010-06-14 Thread Thomas Allen
essible' ) try: urllib2.urlopen('%s%s?%s' % (loc, 'test/', urllib.urlencode({ KEY_PARAM: key }))) except urllib2.HTTPError: raise forms.ValidationError( 'The API location rejects this key.' ) return key

Re: Best practice for maintaining the "Django stack"

2010-08-13 Thread Thomas Guettler
d of error do you get? Please post the traceback. If you remove south from INSTALLED_APPS, you get no errors, but you can't use it. I don't want to miss it. It is a great tool. Thomas Oivvio Polite wrote: > I started playing around with Django sometime early 2009, did the > t

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