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

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.

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

Re: problem with request.GET.getlist['choices']

2007-10-29 Thread Matthias Kestenholz
On 29.10.2007, at 21:39, faypy wrote: > > what do u mean? > there is no pause in between... > He is saying that you should really, really take the time to learn python before trying to do anything with django. (Hint: you need getlist() , not getlist[] , but the fact you did not see this

Re: Chaining Filters for many-to-many

2007-10-29 Thread Matthias Kestenholz
Hi, On 29.10.2007, at 21:58, Kevin wrote: > > I'm trying to figure out how to chain filters for a many-to-many > relation ship that is evaluating to an empty set when it should not. I > basically have some a test with multiple dimms. I want to find a test > with both dimm "sizes" 1024 & 2048. >

Re: user registration problem

2007-10-30 Thread Matthias Kestenholz
On 30.10.2007, at 13:38, Gigs_ wrote: > > im getting this error all the time. > > IntegrityError at /accounts/register/ > column username is not unique > Request Method: POST > Request URL: http://localhost:8000/accounts/register/ > Exception Type: IntegrityError > Exception Value:

Re: Manipulating URLs

2008-06-23 Thread Matthias Kestenholz
On Mon, 2008-06-23 at 00:45 -0700, Tye wrote: > [...] > > def message_send(request) > # primary message_send logic goes here > # . . . > > if success: > return HttpResponseRedirect('/message/success/') > else: > if failed_this_way: > return

Re: How do I include a link in the emails that I send out?

2008-06-24 Thread Matthias Kestenholz
On Tue, 2008-06-24 at 06:45 -0700, Greg wrote: > Jonas, > I'm still confused on how to do it. Is it something like: > > send_mail('My Subject', Content_Type=html, message, '[EMAIL PROTECTED]', > ['[EMAIL PROTECTED]'], fail_silently=False) > > ?? > Uhm, no. Have you read the django

Re: Will Django be upgraded to Python 3.0 after the 1.0 release?

2008-06-24 Thread Matthias Kestenholz
Hi Ed, On Tue, 2008-06-24 at 09:55 -0400, Ed McCaffrey wrote: > Hello, > > My project consists of a couple of stand-alone applications that > gather and process the data that the eventual Django-powered site will > serve. I'm seeing at least 6-8 months until work on the site will > begin. > >

Re: How do I add the user ID to a template?

2008-06-24 Thread Matthias Kestenholz
On Tue, 2008-06-24 at 06:47 -0700, Huuuze wrote: > A n00b question for everyone: My base template has a "Welcome > " section in it. Currently, I'm adding the username (which > is coming from Django's auth/auth framework) to the template with the > following bit of code: > > {{

Re: django template rendering

2008-06-25 Thread Matthias Kestenholz
On Tue, 2008-06-24 at 22:10 -0700, Djangofan wrote: > When rendering a django template on an HTML page, I can use: > > Field Name: "myFieldName" > Value: {{ row.myFieldName }} > > and it works just fine. However, I can't find a way to make it work > with a dynamic variable for the field name:

Re: how to get form fields to show

2008-06-26 Thread Matthias Kestenholz
Hi, On Thu, 2008-06-26 at 07:30 -0700, Bobby Roberts wrote: > hey - > > got a quick question. I think i'm missing part of the puzzle here. > > I have a form set up in a forms.py file. In my template i have it > hand coded instead of using {{form.as_table}} because I want to be > very

Re: how to get form fields to show

2008-06-26 Thread Matthias Kestenholz
On Thu, 2008-06-26 at 08:01 -0700, Bobby Roberts wrote: > Hi Matthias - > > I changed my view name to DoPaymentDetailForm and still no luck. Does > something have to call this view or does Django just do it > automatically? > > I'm not sure what you are talking about. Django does nearly

Re: how to get form fields to show

2008-06-26 Thread Matthias Kestenholz
On Thu, 2008-06-26 at 08:10 -0700, Bobby Roberts wrote: > Hey - > > i've only included a single line in my urls file as follows: > > urlpatterns=patterns('django.views.generic.simple', > (r'step-1.html', 'direct_to_template', {'template': > 'step1.html'}), > > > This obviously calls my

Re: how to get form fields to show

2008-06-26 Thread Matthias Kestenholz
On Thu, 2008-06-26 at 08:19 -0700, Bobby Roberts wrote: > > But you should really start with the tutorial[1] or the Django Book[2]. > > The documentation for Django is really outstanding, you'll progress much > > faster if you do some more reading. > > > >

Re: Polymorphic model: many-to-many is not properly resolved

2008-07-01 Thread Matthias Kestenholz
On Tue, 2008-07-01 at 19:41 +0200, Torsten Bronger wrote: > Hallöchen! > > I use the current SVN version of Django. > > Consider the following models: > > class Process(models.Model): > ... > > class SpecialProcess(Process): > ... > > class Sample(models.Model): >

Re: Tutorial method was_published_today() - problem

2008-07-01 Thread Matthias Kestenholz
On Tue, 2008-07-01 at 12:18 -0700, [EMAIL PROTECTED] wrote: > Hello, > > I'm just going through this tutorial and the custom method > was_published_today() is not recognized as an attribute of Poll, > though it's defined in the model as follows: > > from django.db import models > import

Re: django.contrib.comments and "dynamic vars"

2008-07-07 Thread Matthias Kestenholz
On Mon, 2008-07-07 at 05:57 -0700, Aljosa Mohorovic wrote: > when using django.contrib.comments how can i use dynamic vars? > in current page context i have object_type="news.News" and > object_id="2" so i would like to do something like {% > get_comment_count for object_type object_id as

Re: django.contrib.comments and "dynamic vars"

2008-07-07 Thread Matthias Kestenholz
On Mon, 2008-07-07 at 15:08 +0200, Matthias Kestenholz wrote: > On Mon, 2008-07-07 at 05:57 -0700, Aljosa Mohorovic wrote: > > when using django.contrib.comments how can i use dynamic vars? > > in current page context i have object_type="news.News" and > > obje

Re: how to seperate view file into different files

2008-07-07 Thread Matthias Kestenholz
On Mon, 2008-07-07 at 06:00 -0700, laspal wrote: > Hi, > I have a app called crm in which I have (model.py, views.py , > forms.py, urls.py and __init__.py) > > Now the problem is my code has become too big to handle in 1 file. > So I wanted to know how can I separate my views.py into multiples

Re: Error in URL configuration

2008-07-07 Thread Matthias Kestenholz
On Mon, 2008-07-07 at 07:31 -0700, Leaf wrote: > I received an error when I tried to access my "Dj Styles" program over > the dev server. To make sure that my URLConf worked properly, I typed > in the address localhost:8000/styles/css/classic-b-and-w/, in an > attempt to get a View Does Not Exist

Re: Ajax in Django

2008-07-08 Thread Matthias Kestenholz
On Mon, 2008-07-07 at 21:50 -0700, bharathi wrote: > I am creating one Django application with jquery.. > In that Jquery function am using One Ajax script.. Django code cant > taken that ajax code... > > My code is: > > $(document).ready( > function () { >

Re: connection.queries - show improper SQL?

2008-07-08 Thread Matthias Kestenholz
2008/7/8 Peter <[EMAIL PROTECTED]>: > > When I look at generated sql from connection.queries, it doesn't show > any quotes around strings. > > For example: from django.db import connection from django.contrib.auth.models import User User.objects.filter(username="bob") > []

Re: Django + tiny_mce

2008-07-08 Thread Matthias Kestenholz
2008/7/8 LRP <[EMAIL PROTECTED]>: > > > Add a slash here: --~--~-~--~~~---~--~~ 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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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().

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

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

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

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

2009-05-12 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 >

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

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

Re: using modelformsets

2009-07-06 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

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

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

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

2009-07-18 Thread Matthias Kestenholz
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 K

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

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')),

Re: urls.py import() usage?

2009-07-23 Thread Matthias Kestenholz
On Thu, Jul 23, 2009 at 5:33 PM, Joshua Russo<josh.r.ru...@gmail.com> wrote: > On Thu, Jul 23, 2009 at 2:18 PM, Matthias Kestenholz > <matthias.kestenh...@gmail.com> wrote: >> >> On Thu, Jul 23, 2009 at 4:51 PM, Joshua Russo<josh.r.ru...@gmail.com> >>

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

Re: annotate() and subsets or related records

2009-08-04 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

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

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

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.

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

Re: More Than Two Models With inlineformset_factory

2009-08-12 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

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

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

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

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

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

Re: Raw Strings with Variables

2009-08-19 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',

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

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

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

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,

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

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

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 >

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

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

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

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

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

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

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

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 >

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

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

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

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

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

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

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

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

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/

  1   2   >