Re: very heavy problem with edit_inline

2008-06-22 Thread Alessandro Ronchi
2008/6/21, Scott Moonen <[EMAIL PROTECTED]>: > Yes, I think it is incorrect. It should be set on some field that the user > can type in and which must not be blank. Then, when that field is left > blank, the admin will actually delete the address. I recommend setting > core=True on the indirizzo

Re: very heavy problem with edit_inline

2008-06-22 Thread Karen Tracey
On Sun, Jun 22, 2008 at 3:32 AM, Alessandro Ronchi < [EMAIL PROTECTED]> wrote: > 2008/6/21, Scott Moonen <[EMAIL PROTECTED]>: > > Yes, I think it is incorrect. It should be set on some field that the > user > > can type in and which must not be blank. Then, when that field is left > > blank, the

Re: very heavy problem with edit_inline

2008-06-22 Thread Alessandro Ronchi
2008/6/22, Alessandro Ronchi <[EMAIL PROTECTED]>: > 2008/6/21, Scott Moonen <[EMAIL PROTECTED]>: > > > Yes, I think it is incorrect. It should be set on some field that the user > > can type in and which must not be blank. Then, when that field is left > > blank, the admin will actually delete

Re: very heavy problem with edit_inline

2008-06-22 Thread Alessandro Ronchi
2008/6/22, Karen Tracey <[EMAIL PROTECTED]>: > If all fields marked core are blanked, then the object is deleted. If you have a foreignkey with core=True, among others, it deletes also if another core field is not blank. I've tried also with my user: - - - - - user = models.ForeignKey(User, uniqu

Re: User Profile in Admin interface (using trunk)

2008-06-22 Thread Alessandro Ronchi
2008/6/21, ristretto <[EMAIL PROTECTED]>: > > Was there any solution to this? I'm looking through the tickets, > wiki, docs, web, and now the source trying to figure out how to get my > profile data saved along with a User in the admin. Anyone have that > working? My situation is the same a

has_perm() equivalent for group membership...

2008-06-22 Thread chefsmart
has_perm() checks whether a user has_certain_permission. Is there a similarly elegant way to check whether a user belongsTo_certain_group ? Thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group

Re: Extending the method that is called the first time a model is deployed.

2008-06-22 Thread mwebs
Hi, It seems as if these signals have to be used in management.py, but what I need is something I can use directly in my model code. Something like overloading a method. The fact that this should be happen in the model-class is very important. E.g I dont want every model to be registerd in my "me

Re: Extending the method that is called the first time a model is deployed.

2008-06-22 Thread James Bennett
On Sun, Jun 22, 2008 at 4:41 AM, mwebs <[EMAIL PROTECTED]> wrote: > It seems as if these signals have to be used in management.py, but > what I need is something I can use directly in my model code. > Something like overloading a method. The fact that this should be > happen in the model-class is

Re: Add db tables on-the-fly

2008-06-22 Thread Christian Joergensen
MickaelC wrote: > Hi, > It is a method to add tables to a model without having to manually > launch the syncdb command in a shell? > > If yes > can you give me tips ? > else > :-( What problem are you trying to solve? This really doesn't sound like a common Django idiom. If you insist,

Re: Django on apache and mod_python.... and problems

2008-06-22 Thread foxbunny
On Jun 22, 5:59 am, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > I'm assuming you have papastudio.blog listed in INSTALLED_APPS? > > Does apache have read access to the whole tree under  /papastudio, including > blog?  It seems apache can read /papastudio, otherwise you'd get an > 'ImportError: No

Re: auth context processor setup

2008-06-22 Thread Vasiliy Gladkov
You have to enable auth middleware and application in settings.py - http://djangobook.com/en/1.0/chapter12/ Then you can use user specific variables in your templates - {{ user.username }}, {{ user.is_staff }} and so on On 22 июн, 14:43, mcordes <[EMAIL PROTECTED]> wrote: > Hello, > > Is there an

Re: Use values of Site module on templates [SOLVED]

2008-06-22 Thread Kless
At the end, I'll get these variables directly from the Site module. And to access to them, can be made using templatetags or context processors -that is better for this case-. * Templatetags --- from django import template from django.contrib.sites.models import Site register =

Add new context processors [Trick]

2008-06-22 Thread Kless
To add any new context processor, write this on your settings file: --- from django.conf.global_settings import TEMPLATE_CONTEXT_PROCESSORS TEMPLATE_CONTEXT_PROCESSORS = TEMPLATE_CONTEXT_PROCESSORS + \ ('project.app.context_processors.name',) --- So, neither

Having problems with regroup on datetime

2008-06-22 Thread Darthmahon
Hi, I am trying to group a list of events using the regroup template tag as such: {% regroup event_list by date as events %} {% for event in events %} {{ event.grouper.day }} {% for event in events.list %} {{ event.title }} {% endfor %} {% endfor %} Now, in my model for Events, I am using a da

Multiple fields without manytomanyfield?

2008-06-22 Thread Xan
Hi, Suposing you want a model A with several and indetermined number of integer fields. Is there any possibility of defining A without creating a Integer class and then add ManyToManyField(Integer) in class A? Thanks a lot! Xan. --~--~-~--~~~---~--~~ You received

Serving media from Django only in development [Trick]

2008-06-22 Thread Kless
urls.py - from django.conf import settings # Serves media content. WARNING!! Only for development uses. # On production use lighthttpd for media content. if settings.DEBUG: # Delete the first trailing slash, if any. if settings.MEDIA_URL.startswith('/'):

New site - any comments please on structure / bugs/ security holes etc etc.

2008-06-22 Thread Richard Green
Hi there - I've just put a noddy site together so that I could give myself a real goal for getting a django based site running. I've got a few bigger internet ideas but I thought I'd do something small to start with to test the feasility of writing it in django, before embarking on a route using t

Re: has_perm() equivalent for group membership...

2008-06-22 Thread Alessandro Ronchi
2008/6/22, chefsmart <[EMAIL PROTECTED]>: > > has_perm() checks whether a user has_certain_permission. Is there a > similarly elegant way to check whether a user > belongsTo_certain_group ? if certain_group in user.groups.all(): print "The user is in certain_group!" Maybe you can try also th

Re: help - limit_choices_to

2008-06-22 Thread M.Ganesh
Karen Tracey wrote: > On Sat, Jun 21, 2008 at 9:23 PM, M.Ganesh <[EMAIL PROTECTED] > > wrote: > > > Hi All, > > This question might have been answered so may times, but I am > unable to > glean the information I am looking for from the 260 odd entries tha

Re: TemplateDoesNotExist at /admin/

2008-06-22 Thread sggottlieb
I will do that. In the meantime, I wanted to add that to make the admin interface look pretty you need to copy the media directory as well. --Seth On Jun 21, 10:24 am, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > On Sat, Jun 21, 2008 at 9:22 AM, sggottlieb <[EMAIL PROTECTED]> wrote: > > Thanks K

display m2M in admin view in 0.96

2008-06-22 Thread bussiere maillist
how can i display object in a m2M field ? i've tried with the dem function but it didn't work regards Bussiere class Agent(models.Model): nom = models.CharField(maxlength=60) service = models.ForeignKey(Service) telephone = models.CharField(maxlength=60,blank=True,null=True) emai

Re: auth context processor setup

2008-06-22 Thread mcordes
I seem to already have the auth middleware enabled too. From what I'm seeing, generic views _do_ have the user object available in their templates. It's just my custom views that don't automatically have this. It's easy enough for me to pass in the request.user object from each of my templates, bu

Re: Having problems with regroup on datetime

2008-06-22 Thread Darthmahon
Not sure what happened, but I fixed this by doing this: {% regroup event_list by date.date as events %} {% for event in grouped %} {{ event.grouper|date:"l jS F" }} {% for event in events.list %} {{ event.title }} {% endfor %} {% endfor %} On Jun 22, 1:01 pm, Darthmahon <[EMAIL PROTECTED]> wrote

Re: Add db tables on-the-fly

2008-06-22 Thread MickaelC
It is not really a problem It's for a multi user app. For each new users, i create a serie table or all data in the same table? If it's easy to create table on-the-fly when a new user registers, i prefere. but I do not see how MickaelC (Désolé for my English) On 22 juin, 14:07, Christian Joerge

Re: Thanks!!!!!!!!!!!!!!!!!

2008-06-22 Thread Alex Morega
+1 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more op

Re: auth context processor setup

2008-06-22 Thread Vasiliy Gladkov
Maybe you forgot to use context_instance parameter in render() call? If you want to use context processors, it must look like return render_to_response('template.html', context, context_instance=RequestContext(request)) context_instance parameter passes contexts from processors to your templates

Re: very heavy problem with edit_inline

2008-06-22 Thread Alessandro Ronchi
Is it possible to add a link on my foreignkeys to edit the external reference? It's strange it's possible to add a new referenced object but not open an existing one and edit it. It should be very very useful. -- Alessandro Ronchi Skype: aronchi http://www.alessandroronchi.net SOASI Soc.Coop. -

Re: auth context processor setup

2008-06-22 Thread Nick Sandford
On Sun, Jun 22, 2008 at 10:20 PM, mcordes <[EMAIL PROTECTED]> wrote: > > I seem to already have the auth middleware enabled too. From what I'm > seeing, generic views _do_ have the user object available in their > templates. It's just my custom views that don't automatically have > this. It's easy

Re: auth context processor setup

2008-06-22 Thread mcordes
That was it. Thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTE

Re: Add db tables on-the-fly

2008-06-22 Thread Ned Batchelder
Creating a table per user is definitely going against the grain in a relational database world. You'll be much happier with one table to store the data across users, with a foreign key to the users table to keep everything straight. --Ned. http://nedbatchelder.com MickaelC wrote: > It is not

Re: display m2M in admin view in 0.96

2008-06-22 Thread Karen Tracey
On Sun, Jun 22, 2008 at 6:19 AM, bussiere maillist < [EMAIL PROTECTED]> wrote: > > how can i display object in a m2M field ? > i've tried with the dem function but it didn't work > > regards > Bussiere > > class Agent(models.Model): >nom = models.CharField(maxlength=60) >service = models.F

Re: Thanks!!!!!!!!!!!!!!!!!

2008-06-22 Thread Andre Meyer
me too: django is the best in design, features, documentation and community just awesome! --~--~-~--~~~---~--~~ 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@googl

How best to delete one of multiple records?

2008-06-22 Thread Kenneth McDonald
I have a list of records, and I'd like the user to be able to delete any given record by pressing a button. My current strategy is to have each record in its own form (so that pressing the submit button for that form would delete the record), and have each form contain a hidden field ident

gathering a group for a new web2 project

2008-06-22 Thread José Moreira
Hi all, i have a web2 project i'm working on, there's some stuff already done but i'm considering scratching up in django. i'm working alone and it would be great to gather up a team. anyone interest let me know. best of luck --~--~-~--~~~---~--~~ You received

Complex URLs and numerous GET variables

2008-06-22 Thread [EMAIL PROTECTED]
Hi I've got a bit of a problem as I'm now wishing to use more complex urls on my app and I'm not sure how to go about doing it the Django way. I've got an online store that can have filters placed on it like Price, Make, Category. Thing is when I wanted to use one of those it was simple: examp

Re: display m2M in admin view in 0.96

2008-06-22 Thread bussiere maillist
i will try tomorow thanks On Sun, Jun 22, 2008 at 6:42 PM, Karen Tracey <[EMAIL PROTECTED]> wrote: > On Sun, Jun 22, 2008 at 6:19 AM, bussiere maillist > <[EMAIL PROTECTED]> wrote: >> >> how can i display object in a m2M field ? >> i've tried with the dem function but it didn't work >> >> regards

EmailMultiAlternatives send error

2008-06-22 Thread MrJogo
I'm sending a user-submitted form using EmailMultiAlternatives. From my view, I'm calling a helper function in a different file (but in the same directory) to actually compose and send the email. When I send the message from this helper function (using msg.send()), I get a Server Error page. When,

Choosing between User.first_name/last_name & username

2008-06-22 Thread Stuart Grimshaw
As part of my sign up process, I don't require that people fill in their first/last name, and just choose to show the username if no name is entered. Unfortunatly, I've come across a bit of code that I can't do this in, which has got me thinking, I'm doing this all over the show, so there must be

User Templates

2008-06-22 Thread Dan
I am looking for a way to enable users to make template to control the presentation of reports that they would require. I am looking for the most flexible to them and most secure to me way to do this. I want to be careful since the data serve would come from my domain and thus be vulnerable to ori

Ticket: Doc error on reverse()

2008-06-22 Thread Aral Balkan
Sorry to send this to the list but I cannot post tickets on your ticket tracker (I keep getting Error 500: Ticket flagged as potential spam). Ticket I was trying to open follows: * * * The docs at http://www.djangoproject.com/documentation/url_dispatch/#reverse state that the reverse() function

Re: Ticket: Doc error on reverse()

2008-06-22 Thread [EMAIL PROTECTED]
There are 2 reverse() methods defined in that file, one of them is a method on the RegexURLResolver class which has the signature that you suggest, the other is the one imported with from django.core.urlresolvers import reverse, and it has that signature. On Jun 22, 4:31 pm, Aral Balkan <[EMAIL P

Re: Choosing between User.first_name/last_name & username

2008-06-22 Thread Nathaniel Whiteinge
Stuart Grimshaw wrote: > but it was throwing syntax errors on "player.player.first_name == '' ? > player.player.username : player.player.first_name)" It looks like you're trying to use a ternary operator here, but only Python 2.5 and later has one (and the syntax is different [2]). The good news

Re: GeoDjangoFriendly?

2008-06-22 Thread Tyler Erickson
After mulling over the pros and cons of Slicehost vs. Webfaction hosting for GeoDjango, I ended up going with Slicehost. I recorded the steps I used to setup GeoDjango on Slicehost in case anyone else wants to do the same... http://blog.tylerickson.net/2008/06/geodjango-on-slicehost-getting-star

media server implementation - context processor, custom template tag, or custom filter

2008-06-22 Thread alex
I already have {{ MEDIA_URL }} set in html, css, and js templates and that's working great. I would like to start setting far future caching headers on media files based on the git abbreviated commit hash for each file. i can think of three options for implementing this and would appreciate feedba

Help with mod_python and dynamic vhosts

2008-06-22 Thread Brian Ritchie
Hello all, My first post to this mailing list. I didn't see this in the archive. It this was covered before, sorry about that. I have a webserver (Ubuntu, Apache2) with dynaminc vhosts setup. I'm experimenting with django a bit and I tried to setup the byteflow blog by adding a subdomain of htt

Re: Choosing between User.first_name/last_name & username

2008-06-22 Thread Stuart Grimshaw
On Jun 22, 11:48 pm, Nathaniel Whiteinge <[EMAIL PROTECTED]> wrote: > Stuart Grimshaw wrote: > > but it was throwing syntax errors on "player.player.first_name == '' ? > > player.player.username : player.player.first_name)" > > It looks like you're trying to use a ternary operator here, but only >

Re: gathering a group for a new web2 project

2008-06-22 Thread Tye
More details? On Jun 22, 10:35 am, José Moreira <[EMAIL PROTECTED]> wrote: > Hi all, > > i have a web2 project i'm working on, there's some stuff already done > but i'm considering scratching up in django. > > i'm working alone and it would be great to gather up a team. > > anyone interest let me

dynamically filling ChoiceField

2008-06-22 Thread Calvin Dodge
I've been tearing out what little hair I have left trying to figure this out. How do I dynamically fill a ChoiceField by filtering on a value known to the URLView? Every "dynamic fill" example I've found assumes the form knows it all - I haven't seen anything which shows me how to pass that value

Re: dynamically filling ChoiceField

2008-06-22 Thread Rishabh Manocha
Some more details would be good, but off the top of my head, something like this might work: def my_view(request): form = MyForm() form.fields['mychoice'].choices = ((1,'ABC'),(2,'XYZ')) I havent' been able to test this out, so make sure you do before you using it. You can of-course do any

dynamic value of a ModelChoiceField

2008-06-22 Thread [EMAIL PROTECTED]
In a form, I have a field defined as ModelChoiceField class myForm(forms.Form) myfield = forms.ModelChoiceField(MyClass.objects.all()) myfield2 = forms.CharField() My problem is that I cant seem to dynamically set the value that the user selected for this field. When ever, user edits the reco

Re: dynamically filling ChoiceField

2008-06-22 Thread Calvin Dodge
On Jun 22, 8:08 pm, "Rishabh Manocha" <[EMAIL PROTECTED]> wrote: > Some more details would be good, but off the top of my head, something like > this might work: > > def my_view(request): >form = MyForm() >form.fields['mychoice'].choices = ((1,'ABC'),(2,'XYZ')) Thanks - that's exactly wha

Any suggestions on encryption methodology?

2008-06-22 Thread Tye
Say - for the sake of example - I'm accepting highly sensitive financial data through a form over SSL. Staff members need to retrieve that information at a later time. Meanwhile, I want that data to be encrypted while it's sitting in the database. What do you suggest? Sent from my iPhone -

custom form with admin look and feel

2008-06-22 Thread chefsmart
I'm using django svn trunk. I have created several custom forms that show up in the admin section of the website. However, these forms look nothing like the admin forms. I tried extending change_form.html template - unsuccessfully. Does anyone know what my template should contain to achieve admin

ordering in the ManyRelatedManager object

2008-06-22 Thread Bing
Hi, I have a general question regarding the ordering in the ManyRelatedManager object. For example, There are two classes in my model: one is called Book for books and another is Author for authors. A many-to-many field is defined in class Book authors = models.ManyToManyField(Author) In

Problem logging in to admin using Safari

2008-06-22 Thread Pieter Claerhout
Hi all, I've started playing with Django and stumbled upon a very strange problem. I've created a small test application with just a single app in there which renders some static HTML. I've also enabled the automatic admin side which seems to work just fine when I run the development server. I'

Manipulating URLs

2008-06-22 Thread shravster
Hi I am creating my first serious project with Django and looking for ways to play around with the urls. For instance lets say a user was sending a message to another user from (current url on the browser) "/ send_message/" and I want to redirect the user on posting the message to /sent_messages

Where does Python store library reference settings?

2008-06-22 Thread MongooseNX
I'm very new to python and have what I hope is a simple question for regular users of python. scenario: I use python scripting with ESRI software (ArcMap). Python 2.4 is installed when ArcMap is installed and using PythonWin I can access the ArcMap Geoprocessing libraries from ESRI. For me it

Passing a Custom Form to a Generic View

2008-06-22 Thread [EMAIL PROTECTED]
Sometimes I want to leverage a Generic List or Detail view (as well as their update/create counterparts) but have a small customization like a special widget I'd like used in the display. This leads me to a few questions: 1. Do the generic views utilize the new forms module? 2. Is there any way I