Open ID & request.user.message_set.create

2009-10-25 Thread cerberos
request.user.message_set.create(message="Your playlist was added successfully.") The docs (http://docs.djangoproject.com/en/dev/topics/auth/#messages) say "Finally, note that this messages framework only works with users in the user database. To send messages to anonymous users, use the session f

Re: Django cookies

2009-10-25 Thread Rishabh Manocha
On Mon, Oct 26, 2009 at 9:37 AM, Jeffrey Taggarty wrote: > > Hello, > > I have a web site which shows different content based on a location > the visitor chooses. e.g: User enters in 55812 as the zip. I know what > city and area lat/long. that is and give them their content pertinent > to that are

ModelForm - how to post primary key to update existing record?

2009-10-25 Thread robinne
I am noticing that when I load an existing ModelForm into a template, and I save (POST), I can't seem to get the primary key back in order to update that specific record. I am starting to head down the path of formsets...but that is not what I need. I am updating one record only. Any help is appre

Re: My project is not detecting the geodjango application

2009-10-25 Thread Sahiti Polishetty
Ya.. I am sure that I have added it in INSTALLED_APPS and I rechecked it as well.. My problem is not yet solved.. On Mon, Oct 26, 2009 at 7:23 AM, Dhruv Adhia wrote: > The error means that are you sure you have added "world" in INSTALLED_APPS > which is in settings.py? > > Dhruv Adhia > http://w

Re: Behaviour of related objects

2009-10-25 Thread Preston Holmes
On Oct 25, 2:55 pm, Bojan Mihelac wrote: > Hi all, > > given an many_to_one doctests with Reporter/Article models, the > following example would fail with "IntegrityError: > many_to_one_article.reporter_id may not be NULL": > > >>> r = Reporter(first_name='John', last_name='Smith', > >>> email

Re: Definitive solution for foreignkey filtering in Admin

2009-10-25 Thread Matt Schinckel
On Oct 24, 5:14 am, Tim Valenta wrote: > I've been searching for a while on how to intercept querysets in > forms, to apply a custom filter to the choices on both foreignkey and > m2m widgets.  I'm surprised at how there are so many similar questions > out there, dating back to 2006. [snip] > T

changing how an admin form field is displayed (float to datetime)

2009-10-25 Thread Paul Smith
I've been trying to a modify an admin form so I have a slightly different user interface compared to the database model. The main problem is this; in the database model I store a start and end time as timestamps (a float holding seconds since 1/1/1970). But when the user wants to edit the times I

slow tests on 1.1.1 w/ sqlite

2009-10-25 Thread Phlip
Djangos: This is the "slow test" question, again. I have time tested with 1.0.3 and 1.1.1, and a batch of only like 20 tests takes a minute on both versions. Yes to sqlite3, in :memory:. The nature of the question is I'm an old-skool Pythonist but I wouldn't know where to start diagnosing this is

generic views 404 error

2009-10-25 Thread Ross
I just neared the end of the poll application and converted everything to generic views according to the tutorial. Once I started up the server though, I could only find my admin page. I tried using the newly named urls but I keep getting Page not Found 404 errors. Same thing happens when I type i

Re: My project is not detecting the geodjango application

2009-10-25 Thread Dhruv Adhia
The error means that are you sure you have added "world" in INSTALLED_APPS which is in settings.py? Dhruv Adhia http://www.thirdimension.com On Sun, Oct 25, 2009 at 10:35 AM, Sahiti Polishetty wrote: > Hello .. I want to have google maps in my application, so i created a > project and in that

Django cookies

2009-10-25 Thread Jeffrey Taggarty
Hello, I have a web site which shows different content based on a location the visitor chooses. e.g: User enters in 55812 as the zip. I know what city and area lat/long. that is and give them their content pertinent to that area. My question is how can I store this in a cookie so that when they r

Re: Passing Parameter to form in inlineformset_factory

2009-10-25 Thread Andew Gee
Thanks for the help. I did find this as a solution ad it seems to work Formset = inlineformset_factory(ModelA, ModelB form=MyForm) Formset.form = staticmethod(curry(MyForm, reaOnly=readOnlyvalue)) myFormset = Formset(request.Files, instance=modelAInst) Regards Andrew Andew Gee wrote: > Hi, > >

Re: Interesting code abstraction Challenge

2009-10-25 Thread Jason Beaudoin
Thanks for the thoughts Preston! > I think a base class with subclasses is the best approach. > > Define as much common behavior as possible, set up defaults for those > fields needed by your outbound API Indeed, thanks for the confirmation. I think it's time for experimentation! > How are yo

Re: [django-registration] urls in templates

2009-10-25 Thread Ethan Jucovy
Look in django-registration's registration/urls.py to find the names. IIRC it's like "auth_login" and "registration_register" (both with no parameters). egj On Sun, Oct 25, 2009 at 8:09 PM, Sławek Tuleja wrote: > > Hi > I am using django-registration. In my base.html file I have: > login > regi

[django-registration] urls in templates

2009-10-25 Thread Sławek Tuleja
Hi I am using django-registration. In my base.html file I have: login register How to avoid hardcoded urls? {% url ?:? %} greetings --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to th

Re: Model design

2009-10-25 Thread Caisys
Thanks but I am not very familiar with forms yet I barely managed to override the default form. However, I thought that its ok for the time being since places and subplaces are not changed frequently so i can live with it for the time being and move to more important parts until I am more familiar

Re: update() (for bulks) is a atomic operation?

2009-10-25 Thread Mikhail Korobov
Yes, it's a single query. Take a look at django-debug-toolbar. It can display all SQL queries that was executed during request/response so you'll always be sure what's going on. On 26 окт, 03:12, wancharle sebastiao quirino wrote: > Hello, > > I currently am using raw sql to make an atomic oper

update() (for bulks) is a atomic operation?

2009-10-25 Thread wancharle sebastiao quirino
Hello, I currently am using raw sql to make an atomic operation of the following : UPDATE table SET field1 = 0, flag = 'A' WHERE flag = 'I' Reading the documentation I realized I could do this: Table.objects.filter(flag='I').update(field1=0,flag='A') I want to make sure that this is a unique o

ManyToMany Manager

2009-10-25 Thread Steven Stelmach
Hi all, I'm working with a content model (say, for simplicity, that we have articles and images) that has a published status of either "Published" or "Draft". In the admin interface, I have a widget to associate images with articles as related content (a manytomany field). On my site, I currentl

Behaviour of related objects

2009-10-25 Thread Bojan Mihelac
Hi all, given an many_to_one doctests with Reporter/Article models, the following example would fail with "IntegrityError: many_to_one_article.reporter_id may not be NULL": >>> r = Reporter(first_name='John', last_name='Smith', email='j...@example.com') >>> a = Article(headline="This is a test",

ANN - Satchmo 0.9 Released

2009-10-25 Thread Chris Moffitt
I am very happy to announce that Satchmo 0.9 is now released. Satchmo is an ecommerce framework built on the Django framework. It is designed to be robust and full featured out of the box but allow developers flexibility to modify the store to fit your unique needs. This release is a major milest

How to import doctests?

2009-10-25 Thread toinbis
Hi everyone, i'm strugling to make $python manage.py test run my doctest. My folder/file strukture is as follows myproject/myapp/tests.py /my_tests/__init__.py /my_tests/unittst.py /my_tests/doctst.py I am successfully impo

My project is not detecting the geodjango application

2009-10-25 Thread Sahiti Polishetty
Hello .. I want to have google maps in my application, so i created a project and in that made an application to handle the maps and made the required changes in the settings.py for the above. But i am getting the following error when i am trying to issue the command "python manage.py sqlall world"

How to filter admin site so that you can select multiple values of a filter?

2009-10-25 Thread DiCoS
Hello. Since the application works only through the admin area of Realtors. I have a table and apartments linked to this table with a table areas. I have to organize the search for apartments in several areas. In order not to injure the hand of Realtors, a set of regions, separated by commas, deci

Defining a "list" field consisting of custom models

2009-10-25 Thread weblogger
Hi, With my project I'd like to create an industry-aimed application that offers the users to gain a quick and easy overview over different jobs. Therefore I've thought of three database models: 1) The basic Material model. This model consists of simple fields like the name of the material, its

Re: Model design

2009-10-25 Thread Vinicius Mendes | meiocodigo.com
On Oct 25, 4:53 am, Caisys wrote: > > Just override the form in the inlne admin. All you have to do is set a > > default in the field you want. > > I managed to do that but now all the extra fields have the default > text not just one. > What about overriding the formset? You override the __init

Re: Do reverse relations eventually kill performance?

2009-10-25 Thread Gerard
Hiya Tim, Thanx for the response. Thing is I already have queries running like this: Customer.objects.filter(user=request.user).order_by('company_name') The problem however is that I dont trust myself enough to never make a msitake to show the wrong data to the wrong user. All my models have a

Re: Do reverse relations eventually kill performance?

2009-10-25 Thread Tim Chase
Gerard wrote: > Hi all, > > I'm working on a safe way to get users to only see there own records. I've > been working on subclassing model.Manager and requiring a 'owner' parm for > filter() or otherwise returning an emtpy query set .. just to failsafe my > own view coding. > > Then I figured

Do reverse relations eventually kill performance?

2009-10-25 Thread Gerard
Hi all, I'm working on a safe way to get users to only see there own records. I've been working on subclassing model.Manager and requiring a 'owner' parm for filter() or otherwise returning an emtpy query set .. just to failsafe my own view coding. Then I figured I could get records in my vie

Re: Model design

2009-10-25 Thread Caisys
> Just override the form in the inlne admin. All you have to do is set a > default in the field you want. I managed to do that but now all the extra fields have the default text not just one. > In this case i prefer the approach of creating a "fake" field called > places, populated with the plac