Re: Filtering by returned name?

2008-07-16 Thread Matthias Kestenholz
On Wed, 2008-07-16 at 00:32 -0700, gnijholt wrote: > Hello Django-users, > > Say I have a model that returns its name like this: > > def __unicode__(self): > return str(self.distance_min) + "-" + str(self.distance_max) > > I want to filter this model based on those two values: > Distance.

Re: object is unindexable

2008-07-16 Thread Matthias Kestenholz
On Wed, 2008-07-16 at 02:59 -0700, laspal wrote: > Hi, > I am getting the error "object is unindexable" > > code : > company = Company.objects.get( id = companyid) > for ss in company.financials.all() : > ss[1].year > ss[1].revenue > > ss.year and ss.revenue gives me the correct

Re: Path Creation

2008-07-22 Thread Matthias Kestenholz
On Tue, 2008-07-22 at 11:02 +0200, Sthembile Ngidi wrote: > How do u create a path in python? http://www.google.com/search?q=python+create+path Second hit. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django

Re: how to save

2008-07-25 Thread Matthias Kestenholz
On Fri, 2008-07-25 at 04:45 -0700, Will Rocisky wrote: > I am new to django. > > while using > f = ContactForm() > > I cannot use f.save() > > how can I save f to db? ContactForm inherits forms.Form, doesn't it? Any reason you are not using modelforms[1]? Anyway, if the data in the form is va

Re: Comparison of objects

2008-07-25 Thread Matthias Kestenholz
On Fri, 2008-07-25 at 03:42 -0700, Ryan wrote: > thank you kenneth and jukien > > this is what I tried on the python prompt. I was not sure where to run > the snippet. > from django import template > register = template.Library() > @register.filter > def LT(value,arg): return value < arg > > But

Re: formatting queryset for tree view

2008-07-27 Thread Matthias Kestenholz
On Fri, 2008-07-25 at 16:20 +0530, Leppy wrote: > Hi all, > > Here I have a model called Product. It has a self relationship as > shown below. > > class Product(models.Model): > > name = models.CharField(max_length = 200, blank = True) > > main_product = models.ForeignKey('self',

Re: Admin mass change screen

2008-08-18 Thread Matthias Kestenholz
Hi, I don't know about the mass change screen, haven't thought too much about that yet. But maybe I've got something for you if you want to reorder items using a drag-n-drop interface. On Sun, Aug 17, 2008 at 8:38 PM, varikin <[EMAIL PROTECTED]> wrote: > > I am looking to do something very simil

Re: ifequal doesn't evaluate expressions

2008-08-19 Thread Matthias Kestenholz
On Mon, Aug 18, 2008 at 11:05 PM, zdmytriv <[EMAIL PROTECTED]> wrote: > >> That's one good reason why it's not needed in core. If you need it and >> you understand the trade-offs and consequences, you can implement it >> immediately with no break in the flow. Django's supported third-party >> temp

Re: Invalid block tag: 'autoescape'

2008-08-19 Thread Matthias Kestenholz
On Tue, Aug 19, 2008 at 1:13 PM, tom17 <[EMAIL PROTECTED]> wrote: > > I developed something using the trunk, now we have a change in the > requirement and we need to use the 0.96 version as the hosting service > provider supports only the stable version. I know I have to change a > lot of things,

Re: user defined ordering + admin?

2008-08-21 Thread Matthias Kestenholz
Hi, On Thu, Aug 21, 2008 at 12:40 AM, Bram de Jong <[EMAIL PROTECTED]> wrote: > > Hello All, > > > Has anyone done any work on letting the user define a custom sort > order for objects in "nfa"? > I.e. for example extending a base-class that has a single "order" > integer field and up() and down(

Re: Slash appended for URLs ending in .html?

2008-08-22 Thread Matthias Kestenholz
Hi, On Fri, Aug 22, 2008 at 10:14 AM, janedenone <[EMAIL PROTECTED]> wrote: > > Hi there, > > I installed the current development version of Django about two weeks > ago. APPEND_SLASH is set to true, and it appends a slash to all URLs, > even the ones ending in .html. Is that a known bug? > It's

Re: how to get {% url %} working with {% blocktrans %}?

2008-08-30 Thread Matthias Kestenholz
On Fri, Aug 29, 2008 at 10:55 PM, Martin Diers <[EMAIL PROTECTED]> wrote: > > There is a currently a discussion an even newer discussion on Dev, > where Jacob has proposed a new syntax, and has a patch that would > allow this: > > {% url django-admindocs-docroot as docroot %} > > Then docroot bec

Re: Getting things into entries

2008-08-30 Thread Matthias Kestenholz
On Fri, Aug 29, 2008 at 11:22 PM, Martin Diers <[EMAIL PROTECTED]> wrote: > > On Aug 29, 2008, at 2:22 PM, Benjamin Buch wrote: > >> >> Clumsy subject, I know... >> >> I know there was a recent discussion about this, but I lost it, so >> sorry for asking again. >> So here's the question: >> >> How

Re: define "_default_manager" and the admin-interface

2008-09-01 Thread Matthias Kestenholz
On Fri, Aug 29, 2008 at 7:59 AM, Brot <[EMAIL PROTECTED]> wrote: > > Hello, > > At the moment I am reading the "Practical Django Projects" - Book > written by James Bennett. > On page 120 there is a admonition about using Default Managers. Above > this paragraph there is the explanation about the

Re: Accessing meta class info from my views.py

2008-09-03 Thread Matthias Kestenholz
On Wed, Sep 3, 2008 at 3:32 PM, krylatij <[EMAIL PROTECTED]> wrote: > > try this: >>>get_models(arteak.management.models)[0]._meta.verbose_name_plural() > This won't work since the __proxy__ object does not have a call method. The __proxy__ object gets evaluated to a string when you try to inser

Re: error when using User.get_profile()

2008-09-08 Thread Matthias Kestenholz
Hi, On Mon, Sep 8, 2008 at 12:42 PM, sveri <[EMAIL PROTECTED]> wrote: > > Hi, > > i am using Django 1.0 and try to extent the usermodel, which works so > far > for adding new users. > > But when i want to retrieve a user profile i get a weird error: > > user = get_object_or_404(User, id=9) > user

Re: Django-mptt admin

2008-09-08 Thread Matthias Kestenholz
Hi, On Mon, Sep 8, 2008 at 4:09 PM, Erik Allik <[EMAIL PROTECTED]> wrote: > > Hi, > > Does anyone have actual working code for administering models that use > django-mptt? It'd be nice if the code was free, but if it's not, maybe > we can work something out. > I've implemented a drag-drop interf

Re: help using django templates for site translation

2008-09-11 Thread Matthias Kestenholz
Hi, On Thu, Sep 11, 2008 at 9:41 AM, msagas <[EMAIL PROTECTED]> wrote: > > Hello everyone :) > > A newbie here ! coming from PHP and trying to learn django... i bought > the Apress Definitive Guide to Django book.. and im stuck in chapter > 4... in the template stuff... i do understand the thing

Re: Restricting views

2008-09-11 Thread Matthias Kestenholz
On Thu, Sep 11, 2008 at 5:22 PM, ek_wals <[EMAIL PROTECTED]> wrote: > > > And I can see exactly how to do it -- > copy contrib/admin/views/decorators.py:staff_member _required and > change > 'request.user.is_staff' to 'request.user.is_superuser' > > Sure seems repetitive (non-DRY) (wet?) > Its

Re: Restricting views

2008-09-11 Thread Matthias Kestenholz
On Thu, Sep 11, 2008 at 6:00 PM, ek_wals <[EMAIL PROTECTED]> wrote: > > What then is the point of 'is_superuser' or superuser's in general? > > Looking through the Django code, it seems that the only use for > superusers is that a superuser is automatically a moderator. > > Could be so much more.

Re: flatpage -- content type?

2008-09-13 Thread Matthias Kestenholz
On Sat, Sep 13, 2008 at 9:33 PM, shaunc <[EMAIL PROTECTED]> wrote: > > Hello, > > Does anyone know how to set the content type when serving a page via > FlatPages? > You have to write your own middleware or view function. This is easy enough since you can copy the flatpages view and middleware co

Re: flatpage -- content type?

2008-09-13 Thread Matthias Kestenholz
On Sat, Sep 13, 2008 at 11:12 PM, shaunc <[EMAIL PROTECTED]> wrote: > > umm... but that's not exactly according to "D.R.Y." :) -- but thanks. > It's good to try to follow DRY, but it's not the solution for everything. Django is a tool box, not a CMS with everything included. Sometimes it's better

Re: Template problem with dates(field, kind, order='ASC')

2008-09-13 Thread Matthias Kestenholz
On Sat, Sep 13, 2008 at 11:49 PM, djandrow <[EMAIL PROTECTED]> wrote: > > This is probably really really obvious. I have the following statement > in my views.py: > > archive_list = Entry.objects.dates('entry_date', 'month', > order='DESC') > > then I have; > > {% for archive in archive_list %} >

Re: Template Inheritance Question

2008-09-19 Thread Matthias Kestenholz
On Sat, Sep 20, 2008 at 12:08 AM, David Durham, Jr. <[EMAIL PROTECTED]> wrote: > > On Fri, Sep 19, 2008 at 4:07 PM, djandrow <[EMAIL PROTECTED]> wrote: >> >> I have a template, text that extend a template base. >> >> In my text template I have; >> >> {% extends 'base.html' %} >> >> {% block conten

Re: Sending HTML email

2008-09-23 Thread Matthias Kestenholz
On Tue, Sep 23, 2008 at 7:38 PM, Berco Beute <[EMAIL PROTECTED]> wrote: > > Currently I'm sending plain text mails using: > > ### > from django.core.mail import EmailMessage > email = EmailMessage('hi', 'howdy', host, to) > email.send() > ### > > But now I want to use HTML in the body of the email

Re: get children of children

2008-09-24 Thread Matthias Kestenholz
On Wed, Sep 24, 2008 at 9:25 AM, Evgeny <[EMAIL PROTECTED]> wrote: > > Hi, > There's an object hierarchy: A references B, B references C. > "references" means foreign key. > Is there a nice Django way to select all C objects which are > grandchilds of given A with one query? Somethink like > > sel

Re: Equivalent of find_or_create_by in Django

2009-02-17 Thread Matthias Kestenholz
Hey, On Tue, Feb 17, 2009 at 2:33 PM, Anders wrote: > > Hi. > > I do a lot of csv-import of data and have previously been using Ruby > on Rails. And the only thing I miss about Rails (apart from database > migration) is the find_or_create_by methods. > > Are there any similar methods in Django?

Re: Securely storing passwords

2009-02-24 Thread Matthias Kestenholz
Hi, On Tue, Feb 24, 2009 at 12:49 PM, LaundroMat wrote: > > Hi - > > I'm working on a small django app that allows users to interact with > other websites where they have an account. Ofcourse, using this app > means providing your username and password for the other website. > > What are the mos

Django MPTT Admin

2009-02-26 Thread Matthias Kestenholz
Hey, A topic which comes up on this list from time to time is an automatic admin interface for django-mptt. I'd like to advertise a piece of code we have written at our company a little bit, and I'd also like to invite everyone to give comments and feedbacks. I do have many more ideas floating ar

Re: Translation question : some strings not translated

2009-07-02 Thread Matthias Kestenholz
Hi, 2009/7/2 François Verbeek : > Mmm to make the problem easier to deal with I wrote a very very small > app with just 1 view and a very basic template : > from django.http import HttpResponse > from django.utils.translation import ugettext as _ > from django.shortcuts import render_to_response,

Re: using modelformsets

2009-07-05 Thread Matthias Kestenholz
Hi, On Sun, Jul 5, 2009 at 11:42 PM, Eric Abrahamsen wrote: > > I'm somehow failing to use modelformsets, this is the relevant view > and error traceback: > > http://dpaste.org/evHq/ > > I'm validating a whole bunch of forms at the same time, but I don't > see how that could cause the formset fai

Re: Cached forms when changing language- Is this a bug?

2009-07-17 Thread Matthias Kestenholz
Hi, On Fri, Jul 17, 2009 at 9:14 AM, Adrián Ribao wrote: > > Hello everybody, > > I have an multi language site with a form in the home. If I change the > language of the site everything changes but the form takes a few > minutes before I see it in the right language. > > If I reload the server t

Re: Current user in model.save() context

2009-07-18 Thread Matthias Kestenholz
On Fri, Jul 17, 2009 at 4:24 PM, Bartłomiej Górny wrote: > > Phil wrote: >> Hi Josh, >> >> unfortunately it seems that there is no way to do so. As you've >> noticed that correctly you can use request (request.user) in any place >> but model save. > > Yes, I bumped into the same problem and came t

Re: pre-fetch one-to-many and many-to-many relationships

2009-07-18 Thread Matthias Kestenholz
example. It wont work for django.contrib.comments though, since the comments model uses generic relations, and I've not implemented prefetching for those yet. Matthias Maybe it will inspire someone to create > Miriam > > > > -- Matthias Kestenholz Konzept & Programmierung

Re: Current user in model.save() context

2009-07-20 Thread Matthias Kestenholz
On Mon, Jul 20, 2009 at 9:26 AM, Bartłomiej Górny wrote: > [...] >> there is a cookbook recipe for achieving this sort of thing: >> >> http://code.djangoproject.com/wiki/CookBookThreadlocalsAndUser > > Yep, that's exactly what I did :) > >> >> That's deep in the category of 'give them rope to hang

Re: urls.py import() usage?

2009-07-23 Thread Matthias Kestenholz
On Thu, Jul 23, 2009 at 4:51 PM, Joshua Russo wrote: > > Is there any difference between using import() versus not in the url > pattern list? >    (r'^accounts/login/$', 'django.contrib.auth.views.login'), >    (r'^admin/doc/', include('django.contrib.admindocs.urls')), Are you asking about impor

Re: urls.py import() usage?

2009-07-23 Thread Matthias Kestenholz
On Thu, Jul 23, 2009 at 5:33 PM, Joshua Russo wrote: > On Thu, Jul 23, 2009 at 2:18 PM, Matthias Kestenholz > wrote: >> >> On Thu, Jul 23, 2009 at 4:51 PM, Joshua Russo >> wrote: >> > >> > Is there any difference between using import() versus no

Re: view/form with fields from multiple models

2009-07-23 Thread Matthias Kestenholz
On Fri, Jul 24, 2009 at 5:32 AM, sico wrote: > > Hi, > > I want to be able to edit fields from several different models on the > same form/view. > > The models are related one-to-one... can they be defined as "Inline" > forms in the admin system??  The documentation doesn't make any > mention of u

Re: cross-referencing design question

2009-07-23 Thread Matthias Kestenholz
7;ve only got these two foreign keys, it might be better to use a many to many field that references the same model ( ManyToManyField('self') ) Plus, you should use unicode(), not str() inside __unicode__ -- str() will bail if clien

Re: view/form with fields from multiple models

2009-07-24 Thread Matthias Kestenholz
On Fri, Jul 24, 2009 at 10:46 AM, Benjamin Wohlwend wrote: > > On Jul 24, 10:37 am, Benjamin  Wohlwend wrote: > >> >> if all(f.is_valid() for f in (form1, form2, form3)): >>     # ok, save >> > > Oops, forgot to mention that I had to implement my own version of all > (), which doesn't short cut:

Re: annotate() and subsets or related records

2009-08-03 Thread Matthias Kestenholz
On Mon, Aug 3, 2009 at 11:17 PM, Javier Guerra wrote: > > Hi all, > > > I've just upgraded to 1.1 (congrats everybody!), and want to put the > aggregation/annotation features to use.  but it doesn't seem to be a > way to annotate the records with counts of different subsets of > related records. >

Re: Javascript with built-in templates tags

2009-08-08 Thread Matthias Kestenholz
On Sat, Aug 8, 2009 at 6:34 PM, WilsonOfCanada wrote: > > I am not sure; I am just trying to pass the variable from the > dictionary using render_to_response to a javascript function.  The > function is stored as a .js file.  This is a part of the code I am > using it for: > > {{ selectCity|safe }

Re: javascript variable in url resolver template tag

2009-08-09 Thread Matthias Kestenholz
On Sun, Aug 9, 2009 at 5:43 PM, Sven Richter wrote: > Hi all, > > i wanted to know if it is possible to pass a Javascript variable to > the url template tag? > > Like: > > ... >

Re: django-cms-2.0 problem

2009-08-10 Thread Matthias Kestenholz
On Tue, Aug 11, 2009 at 1:01 AM, odonnell wrote: > > I'll try starting with the example project this time, maybe something > in there is different than starting a project with django-admin.py > startproject. > The standard django project skeleton does not have django.core.context_processors.reque

Re: is Django a good choice for a LAN app?

2009-08-11 Thread Matthias Kestenholz
On Tue, Aug 11, 2009 at 10:00 PM, Peterle wrote: > > Perhaps Zope-Plone is more suitable for that purpose. Perhaps not. Do you have anything to back this statement? (I'm not saying it's untrue, I'm just trying to point out that this contribution wasn't particularly helpful. A bit more on topic:

Re: More Than Two Models With inlineformset_factory

2009-08-11 Thread Matthias Kestenholz
On Tue, Aug 11, 2009 at 10:04 PM, Geraldo wrote: > > Hi, > > I'm new to Django and am putting together a page for my new site.  I > want to be able to edit data that is contained in 3 models, organized > as follows: > Parent >  --> Child 1 (always one to one) >  --> Child 2 (one or more) > > I und

Re: More Than Two Models With inlineformset_factory

2009-08-11 Thread Matthias Kestenholz
On Wed, Aug 12, 2009 at 12:51 AM, Geraldo wrote: > > Excellent, Matthias...  That should work nicely.  It does appear, > however, that there is no way to have more than 2 forms in a single > formset.  If inlineformset_factory had an append method things might > be a bit cleaner. > I presume you m

Re: More Than Two Models With inlineformset_factory

2009-08-12 Thread Matthias Kestenholz
On Wed, Aug 12, 2009 at 7:36 PM, Geraldo wrote: > > No, I mean two or more different forms.  I'd like Parent, Child1 AND > Child2 all in the same formset.  What you've suggested though, should > get me where I want to go. > Well, you can easily show the input fields from Formset1 and Formset2 int

Re: Psyco

2009-08-13 Thread Matthias Kestenholz
On Thu, Aug 13, 2009 at 5:35 PM, Jonas Obrist wrote: > > Torsten Bronger wrote: >> Hallöchen! >> >> Jonas Obrist writes: >> >> >>> Is anyone using psyco in django? Does it work and is it useful (as >>> in: do you get great speed improvements)? >>> >> >> I've once seen a benchmark indicating consid

Re: Django, CMS, CSS newbie question

2009-08-13 Thread Matthias Kestenholz
On Thu, Aug 13, 2009 at 11:55 PM, eldonp2 wrote: > > Thanks. > > I've gone through the book and done the tutorial on djangoproject.com > > Basically, my qyestion is still not answered - how do I start with a > CSS template and bring Django and Django-CMS in afterward? The problem > is with learnin

Re: Master / Slave Database Replication Scenario

2009-08-16 Thread Matthias Kestenholz
On Sun, Aug 16, 2009 at 11:44 AM, Haes wrote: > > Hi, > > we are using master / slave database replication, no partitioning, > just replicating the complete database to several slaves for > performance reasons. This is making some problems with a newly > developed Django project, which makes use o

Re: Admin dashboard : hide and merge modules

2009-08-17 Thread Matthias Kestenholz
On Tue, Aug 18, 2009 at 6:10 AM, JF Simon wrote: > > Hi men, > > I'm using Django + Grappelli and I'd like to know if there is a simple I don't know about grappelli, but I'd expect it to be at least as configurable as the standard django admin interface. > way to make some improvements to the d

Re: Raw Strings with Variables

2009-08-18 Thread Matthias Kestenholz
On Wed, Aug 19, 2009 at 2:51 AM, WilsonOfCanada wrote: > > However, when I send the list over as a dictionary for HTML: > > d["places"] = arrPlaces > > return render_to_response('rentSearch.html', d) > > the HTML using Django has: > > {{ places }} but returns ['C:\\moo', 'C:\\supermoo'] > And wha

Re: Dynamically add a line to an inlineformset

2009-08-20 Thread Matthias Kestenholz
On Thu, Aug 20, 2009 at 7:27 AM, Andew Gee wrote: > > Does anyone know how to add a new line to anlineformset dynamically? I > have a page that contains an inlineformset and I need to be able to > click a button and add a new line which will then be saved when the > form is submitted, is that poss

Re: Template Filters

2009-08-20 Thread Matthias Kestenholz
On Thu, Aug 20, 2009 at 4:11 AM, WilsonOfCanada wrote: > > Hellos, > > I was wondering if there is a filter that can remove these '\' that > python added when strings are appended to a list or dictionary.  I > cannot use cut because I still need one of the '\' > > ex.  C:\\moo > > Code: > > arrPla

Re: how to return an html snippet using ajax $.post()?

2009-08-20 Thread Matthias Kestenholz
On Thu, Aug 20, 2009 at 11:34 PM, Margie Roginski wrote: > > Could someone give me a hand with a very simple ajax problem?  I want > to post some data and have the server just return a small snippet of > html, which I then want to insert into my dom at a particular id. > > Let's say the html snipp

Re: how to return an html snippet using ajax $.post()?

2009-08-20 Thread Matthias Kestenholz
On Thu, Aug 20, 2009 at 11:53 PM, Margie wrote: > > Ah - thank you!  Yes, sorry, in the process of my debugging the issue > and trying to simplify it, I unintentionally introduced even more > errors, and then when posting it, even more!  But you somehow despite > that, managed to identify my real

Re: How to run a static html page as a section of django website?

2009-08-20 Thread Matthias Kestenholz
On Thu, Aug 20, 2009 at 10:42 PM, Bins wrote: > > I've a django powered blog, say http://example.com. I desire to make a > section http://example.com/htmlpage/ and run a simple static html page > at the url. > > How to I do it? > > I tried putting my file folder into my /django/website on webserve

Re: Dynamically add a line to an inlineformset

2009-08-22 Thread Matthias Kestenholz
On Sat, Aug 22, 2009 at 7:53 AM, Andew Gee wrote: > > Thank you for your help. > > I have managed to get the inlineforms to reproduce on my page, however > when I submit the form the extra inlines are ignored. I have printed > the formset when it hits the view and the new lines that I have added >

Re: From a relative noob

2009-08-22 Thread Matthias Kestenholz
Robb, On Sat, Aug 22, 2009 at 6:06 PM, Robb Bossley wrote: > In the course of writing this program, I have run into a challenge with > regard to the way that things are retrieved and displayed.  The problem is > as follows: > > #"var3" is passed in from the following > def Someprog(request, var1,

Re: Image Location

2009-08-23 Thread Matthias Kestenholz
On Sun, Aug 23, 2009 at 3:54 PM, When ideas fail wrote: > > Hello, i'm having a problem getting images to display so I was > wondering if someone would be kind enough to help? > > I have my settings.py set up as follows (content is the folder where > my static images are stored): > > MEDIA_ROOT =

Re: Documenting Django with sphinx: autodoc doesn't pick up field definitions

2009-08-25 Thread Matthias Kestenholz
On Tue, Aug 25, 2009 at 4:44 PM, Benjamin Wohlwend wrote: > > Hi, > > I'm trying to generate documentation for my django project with sphinx > [1] and autodoc[2]. It's mostly working, but I can't get sphinx to > pick up my model field definitions (with the exception of related > fields like m2m o

Re: Closures, Django Request Object, Django architecture

2009-08-25 Thread Matthias Kestenholz
On Tue, Aug 25, 2009 at 7:32 PM, Dennis wrote: > > I seem to need the Django HttpRequest object in functions that are > called by view functions. > I could pass the request, but I'm thinking of trying to create a > closure in middleware so that > I can access the request object (and maybe other ob

Re: Closures, Django Request Object, Django architecture

2009-08-25 Thread Matthias Kestenholz
On Tue, Aug 25, 2009 at 8:35 PM, Dennis Fogg wrote: > PS: more succinctly: status notifications can happen in many places and > passing the session to all these places just for the status notification > does not make the code any clearer.  Thus, I just want to access the session > as a global vari

Re: redirect in django

2009-08-27 Thread Matthias Kestenholz
On Thu, Aug 27, 2009 at 12:38 PM, ankit rai wrote: > Nobody knows the answer to this question i think so > Did you really expect an answer within an hour of sending the email to the list? A little bit of patience would really be in order here. If you need answers _fast_, IRC would be a better me

Re: Execute code after sending a http response?

2009-08-28 Thread Matthias Kestenholz
On Fri, Aug 28, 2009 at 8:10 AM, Shadow wrote: > > Hi, > > Is it possible to execute code after sending the actual http response? > > For my website, users can optionally give an email address, and if > they do, the site sends a confirmation email. But I was thinking it's > more logical to spend t

Re: need help: unique_together in both directions

2009-08-29 Thread Matthias Kestenholz
On Sat, Aug 29, 2009 at 7:51 PM, ckar...@googlemail.com wrote: > > Really no ideas? > > Chris > Is there any way you could define a stable ordering for the SinglePoint model? You could ensure that the "smaller" SinglePoint gets stored in p1 and the "bigger" SinglePoint in p2 in a custom save meth

Re: Django POST data errors

2009-08-31 Thread Matthias Kestenholz
On Mon, Aug 31, 2009 at 3:12 AM, Greg wrote: > > Hi all, > > I have a large-ish form (40-odd fields) on a pretty busy site, and I'm > constantly getting "ManagementForm data is missing or has been > tampered with" or "IOError: request data read error" errors. I can't > reproduce it, and it always

Re: Custom form validation request or user-based

2009-08-31 Thread Matthias Kestenholz
On Fri, Aug 28, 2009 at 10:34 AM, Enrico Sartorello wrote: > Hi, > i'm developing a Django application where i need to differentiate the > validation of an admin-site model form between different users: some user > must respect some particular restrictions (imposed via "clean_*" methods) > while o

Re: Custom form validation request or user-based

2009-09-02 Thread Matthias Kestenholz
On Wed, Sep 2, 2009 at 9:15 AM, Enrico Sartorello wrote: > Up. > Already? > On Tue, Sep 1, 2009 at 11:06 AM, Enrico Sartorello > wrote: >> >> Wait a moment: this solution doesn't solve my problem. >> Remember that the form I need has to be used on the admin site, so I can't >> deal with it dir

Re: Custom form validation request or user-based

2009-09-02 Thread Matthias Kestenholz
On Wed, Sep 2, 2009 at 10:38 AM, Enrico Sartorello wrote: >> if you need this only for the administration site you'd hvae other >> hooks that you could override. Either take a look at the documentation >> or at django/contrib/admin/options.py >> > > If you mean overriding the ModelAdmin.form objec

Re: Fieldlookup: NOT

2009-04-17 Thread Matthias Kestenholz
On Thu, Apr 16, 2009 at 3:56 PM, 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, now I need to use exclude() instead of filter(). > > I looked at the

Re: Query to retrieve users from a given group

2009-04-17 Thread Matthias Kestenholz
On Fri, Apr 17, 2009 at 3:18 PM, Daniel Roseman wrote: > > On Apr 17, 1:23 pm, Bastien wrote: >> Hi, >> >> I'm trying to retrieve a list of users belonging  to a given group but >> don't understand how to do it. It must be a sort of many to many query >> but I can't get it to work. >> >> I would

Re: i need a unlimited subcategories

2009-04-28 Thread Matthias Kestenholz
On Tue, Apr 28, 2009 at 3:09 PM, Alex Robbins wrote: > > For a real simple solution you might just set up a foreign key field > that points to the parent of any given category. (If you don't need > the extra features of those libraries, they might just make things > more complicated.) > > E.g. su

Re: Ajax and non-ajax forms.

2009-05-06 Thread Matthias Kestenholz
Hey, On Wed, May 6, 2009 at 3:27 PM, Chris Dew wrote: > > I'd like to develop a Django application with the following > properties: > > A page (list of items) will have a link to a page with a form to add a > new item. > > If there is no javascript, the link will take the user to the new page >

Re: Quoting in extra(select=...) expression

2009-05-11 Thread Matthias Kestenholz
Hey, On Mon, May 11, 2009 at 9:09 PM, lemming110 wrote: > > I am trying to use the select keyword in extra.  But I cannot properly > quote the the expression for postrgres.  I am using the > django.contrib.comments.  I started with this snippet > http://www.djangosnippets.org/snippets/1101/ whic

Re: Customizing extends template tag for mobile version of site

2009-06-06 Thread Matthias Kestenholz
On Fri, Jun 5, 2009 at 6:35 PM, Andrew Fong wrote: > > I was hoping someone could explain to me what the exact behavior would > be if the Extends Node in the template was not first. > > Here's my use-case scenario: I need to maintain separate mobile and > desktop templates for my site. I'm findin

Re: Django error

2009-09-20 Thread Matthias Kestenholz
On Sun, Sep 20, 2009 at 8:47 AM, zweb wrote: > > When I try to download a file through django in IE , I get > > [Sun Sep 20 05:34:20 2009] [error] [client 127.0.0.1]     response = > func(request, response), referer: http://www.com > [Sun Sep 20 05:34:20 2009] [error] [client 127.0.0.1]   Fil

Re: Recursion without breaking MVC!

2009-09-29 Thread Matthias Kestenholz
Hey, On Tue, Sep 29, 2009 at 12:50 AM, Nuno Machado wrote: > > Hi djangoers, > > I've a simple category Model: > > class Category(models.Model): >    name = models.CharField(max_length=63) >    children = models.ManyToManyField('self', symmetrical=False, > related_name='parent') > > I need to cr

Re: Creating dynamic models?

2009-11-26 Thread Matthias Kestenholz
On Thu, Nov 26, 2009 at 9:56 AM, Kevin Renskers wrote: > Just a small update: the DynamicModels way as described on the wiki > doesn't work (it also says that it only works in Django 0.96, so > yeah..). > > If anyone has any idea how to do this, I would be very thankful! > > > On Nov 24, 2:35 pm,

Re: Open source CMS (if based on Django better)

2010-05-06 Thread Matthias Kestenholz
On Wed, May 5, 2010 at 9:52 PM, Jonatan.mv wrote: > What would be you recommended CMS?. Could you please give some reasons > (pro and cons)?. > > I'm investigating on these: > > - PyLucid v0.8.x stable, v0.9 alpha > - FeinCMS v1.1.0 stable > - django-simplecms > - django-cms-2.0 2.0.2 stable , 2.1

Re: QuerySet Behaviour Question (Django 1.1)

2010-06-29 Thread Matthias Kestenholz
Hi On Mon, Jun 28, 2010 at 4:37 PM, Jeff wrote: > Hi, > > I have a question concerning some queryset behaviour in Django 1.1. > > In this example, I have an article model that can contain 1 or more > authors who are users registered through Django's auth system. > > I get the following output whe

Re: Filter based on result of model method

2010-07-07 Thread Matthias Kestenholz
On Sat, Jul 3, 2010 at 7:20 PM, Wiiboy wrote: > Is there a way to filter based on the result of a model instance > method? > > I've got a Permission model with a one-to-one relationship with an > Article.  The Permission model stores the different groups that the > Article author said could read t

Re: What's the best way to develop an app that is similar the django admin?

2010-09-22 Thread Matthias Kestenholz
On Mon, Sep 20, 2010 at 3:13 PM, Federico Capoano wrote: > Hi all, > > I try to explain it clearly. > > I have to develop an application that will implement similar > functionality and look of the django admin, but in the frontend. > > So this application will have files management, clients manage

Re: Saving several copies of an object

2010-01-05 Thread Matthias Kestenholz
2010/1/5 Tomasz Zieliński : > > > On 5 Sty, 18:16, pjmorse wrote: >> >> This is done by looping over the list of languages and saving a >> NewsTrans in each language. The source language is marked as already >> translated, the other two are not (that is, they still need >> translating). >> >> The

Re: Dealing with polyhierarchical data

2010-01-28 Thread Matthias Kestenholz
Hi On Wed, Jan 27, 2010 at 11:29 PM, Olivier Guilyardi wrote: > Hi, > > I'm working with a polyhierarchical thesaurus, and trying to handle that in > Django. By polyhierarchical, I mean : nodes can have both multiple parents and > children. > > Actually, this is a geographical thesaurus, and yes

Re: Website themes in django

2010-02-03 Thread Matthias Kestenholz
On Wed, Feb 3, 2010 at 7:46 AM, Waqqas Jabbar wrote: > Hi, > > I am thinking of making a "theme" application. The idea is to change the > theme of the site easily from a list of available them (like in gmail). > The theme selection can be based on > - User (every user can choose her own theme) > -

Re: 'template_key' that is missing from the form

2010-04-03 Thread Matthias Kestenholz
Hi Egon On Sat, Apr 3, 2010 at 12:35 PM, Egon Frerich wrote: > -BEGIN PGP SIGNED MESSAGE- > [...] > > Exception Type: ImproperlyConfigured at / > Exception Value: 'PageAdmin.fieldsets[1][1]['fields']' refers to field > 'template_key' that is missing from the form. > > > Any hints? > Thi

Re: django-paypal

2010-04-06 Thread Matthias Kestenholz
On Tue, Apr 6, 2010 at 8:05 PM, Ramdas S wrote: > Hi, > > I am trying to use using django-paypal. Everything works fine, expect that > the IPN doesn't reach the site. > > I followed the code a per instructions in the > http://github.com/johnboxall/django-paypal > > I am able to send and receive mo

Re: django-paypal

2010-04-06 Thread Matthias Kestenholz
On Tue, Apr 6, 2010 at 8:12 PM, Ramdas S wrote: > > Hey Thanks! > > Should I exempt all the views > I don't know django-paypal that well, but you should only exempt those which are supposed to receive POST requests from external domains (paypal) and which are secured against CSRF attacks in some

Re: Multi-table inheritance, post_save and fixtures

2010-04-08 Thread Matthias Kestenholz
On Thu, Apr 8, 2010 at 1:04 PM, Phui Hock wrote: > Given the following block of code: > --- models.py --- > from django.db import models > from django.db.models.signals import post_save > > class Animal(models.Model): >    category = models.CharField(max_length=20) > > class Dog(Animal): >    colo

Re: Serving binary files "through" django

2008-04-05 Thread Matthias Kestenholz
On Sat, 2008-04-05 at 20:19 +0100, Tim Sawyer wrote: > Hi Folks, > > I'd like to have a site that gives away and sells PDFs, and tracks downloads > of those PDFs. For example, I'd like to know the IP address/useragent of who > downloaded the free files, and I'd like to record the same plus th

Re: Changing admin index

2008-04-22 Thread Matthias Kestenholz
Hi, On Tue, 2008-04-22 at 11:37 -0700, dimrub wrote: > The most obvious way would be to override the corresponding template > to include only a specific list of apps. > > On Apr 22, 8:22 pm, "Monica Leko" <[EMAIL PROTECTED]> wrote: > > Hi > > > > Can I somehow exclude sites and auth from admin i

Re: django thumbnail

2008-04-22 Thread Matthias Kestenholz
Hi, On Tue, 2008-04-22 at 22:41 +0200, Alessandro wrote: > I'm trying to use sorl.thumbnail with the latest django trunk. > > It gives me this error. Any hints? > Other options to make automatic thumbnails? > > TemplateSyntaxError at / > 'thumbnail' is not a valid tag library: Could not load te

Re: Zero padding an intger in templates

2008-04-24 Thread Matthias Kestenholz
Hi, On Thu, 2008-04-24 at 09:13 +0200, Matias Surdi wrote: > Hi. > > Which is the correct way to zero-pad an integer in templates? is there > any filter? > Yes: http://www.djangoproject.com/documentation/templates/#stringformat -- http://spinlock.ch/blog/ --~--~-~--~~-

Re: Page-trees in admin system

2008-04-28 Thread Matthias Kestenholz
Hi, On Mon, 2008-04-28 at 12:19 -0700, Rodrigo Culagovski wrote: > Matthias, > > that looks like what I'm looking for. Does it work in trunk? > > thanks! > > Rodrigo I've just made an update to trunk locally and it seems to work, yeah. django-mptt does not seem to have a problem with the qs-r

Re: A twist on cross importing models

2008-05-08 Thread Matthias Kestenholz
Hey, I might have some ideas now. I have not understood the problem earlier. On Wed, 2008-05-07 at 12:52 +0200, Christopher Mutel wrote: > Hello all- > > I have tried a couple of tips found on the list to solve my problem > with circular model imports, but with no lucks. Here is my basic > sche

Re: A twist on cross importing models

2008-05-08 Thread Matthias Kestenholz
On Thu, 2008-05-08 at 16:29 +0200, Christian Joergensen wrote: > Matthias Kestenholz wrote: > > I can think of two methods of loading Variable inside your calculate > > function: > > > > - Write the import statement in the function instead of writing it at > > th

Re: Multiplechoicefield 1 value

2008-05-09 Thread Matthias Kestenholz
On Fri, 2008-05-09 at 15:26 +0100, Ben Eliott wrote: > Hi, Can anyone please advise on why a multiplechoicefield might be > returning only 1 value (the last value)? Or maybe i'm not accessing it > correctly...? > Many Thanks! > Ben How are you accessing the value? Are you using request.POST.get()

Re: Forward model references

2008-05-09 Thread Matthias Kestenholz
Hi, On Fri, 2008-05-09 at 10:47 -0700, Chris Farley wrote: > I'm trying to model our customers in a Django application, but I'm > encountering a problem: > > Customers can have many CustAddresses > One CustAddress is the Customer's primary billing address > One CustAddress is the Customer's prim

  1   2   >