Re: Adding an App to the Admin

2011-01-28 Thread Jonas Geiregat
Op 28-jan-2011, om 04:09 heeft Corey Richardson het volgende geschreven: > I'm following the tutorial at [1]. I'm trying to add the app to the > admin site. I've run manage.py syncdb, and I've restarted the dev > server. Any hints? The appropriate files that I was instructed to modify > can be se

abstract base class and overwriting save()

2011-01-28 Thread Jaroslav Dobrek
Hi, if I have got several models that have identical code, except for their save method, how can I use an abstract base class for them? Will I have to overwrite save() for each model? Or is there a generic way to define save(), i.e. a way that I have to use only once -- in the abstract base class?

Force locale in Template?

2011-01-28 Thread Ivo Brodien
I have an email template in more than one language, how can I force a value to be localized to a specific language? I saw the localize on/off filter tag, but that is not what I need. I need to do something like this, so I am independent of the current Language ot the user. {{ event.start_date

Re: abstract base class and overwriting save()

2011-01-28 Thread Daniel Roseman
On Friday, January 28, 2011 9:21:48 AM UTC, Jaroslav Dobrek wrote: > > Hi, > > if I have got several models that have identical code, except for > their save method, how can I use an abstract base class for them? Will > I have to overwrite save() for each model? Or is there a generic way > to d

Re: abstract base class and overwriting save()

2011-01-28 Thread Jaroslav Dobrek
> The whole point of subclassing is that subclasses inherit models from the > superclass. That's how the model save() method is definted in the first > place, if you don't override it. What exactly are you having problems with? It seems that my problems were due to another mistake of mine. I was t

Re: Django and Oracle XE - Empty models file

2011-01-28 Thread Nathan
Cheers for the reply. The database in question is a remote database. I presume by Django user that you're referring to the local user account? Otherwise the user credentials in settings should be adequate. I'm guessing the only resolution to this is to hand craft the models? -- You received t

RE: abstract base class and overwriting save()

2011-01-28 Thread Chris Matthews
The "save def save(self, *args, **kwargs):" should not have the leading save. Also, if you are making a car system then this structure seems more appropriate: class CarMake(models.Model): ... class Car(models.Model): make = models.ForeignKey(CarMaker) ... def save(self, *args, **kwargs

contrib.messages and HTML5 browsing context

2011-01-28 Thread Plovarna
Hello, I just read Messages documentation (http://docs.djangoproject.com/en/1.2/ref/contrib/messages/#behavior-of-parallel-requests), and in the "Behavior of parallel requests" section is this note: "...Note that this is typically not a problem in most applications and will become a non-issue i

Re: Error when subclassing models.ForeignKey field

2011-01-28 Thread roman
On 26 Jan., 18:33, Roman Klesel wrote: > Should I open a bug report? That's what I just did: http://code.djangoproject.com/ticket/15184 -- 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@google

Re: Django and Oracle XE - Empty models file

2011-01-28 Thread Jani Tiainen
On Friday 28 January 2011 11:45:48 Nathan wrote: > Cheers for the reply. The database in question is a remote database. I > presume by Django user that you're referring to the local user account? > Otherwise the user credentials in settings should be adequate. > > I'm guessing the only resolution

Re: Adding an App to the Admin

2011-01-28 Thread Corey Richardson
On 01/28/2011 03:43 AM, Jonas Geiregat wrote: > > Op 28-jan-2011, om 04:09 heeft Corey Richardson het volgende geschreven: > >> I'm following the tutorial at [1]. I'm trying to add the app to the >> admin site. I've run manage.py syncdb, and I've restarted the dev >> server. Any hints? The approp

Re: Adding an App to the Admin

2011-01-28 Thread Daniel Roseman
On Friday, January 28, 2011 3:09:34 AM UTC, kb1pkl wrote: > > I'm following the tutorial at [1]. I'm trying to add the app to the > admin site. I've run manage.py syncdb, and I've restarted the dev > server. Any hints? The appropriate files that I was instructed to modify > can be seen at [2]. Requ

Geodjango: ogrinspect on a Postgis layer?

2011-01-28 Thread Ryan Clark
I'm interested in using the ogrinspect command to help build a load.py file for bringing data from one PostGIS table (in a legacy db) into my Django project's db. What I can't seem to figure out is how to write the data source location for a PostGIS layer. Can it be done? I tried the following: og

Google maps

2011-01-28 Thread roy mukasa
Hey guys does anyone know how i can embed google maps into django? i am new to django but i am trying to develop an app in which i will embed a google map of a particular area. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this grou

first time deploying django on apache with mod_python on fedora 8

2011-01-28 Thread n0h8dy
Hi, I'm trying to get my first Django app up and running on amazon ec2 fedora 8 instance on apache with mod_python. I've got mod_python MySQL- python python-devel Django mysql-server installed. I've got the homepage to show up, but its a very simple view that just returns text. Anything more comp

How to format a datetime in a webpage?

2011-01-28 Thread Wayne Young
Hi all, I have come across an error when I tried to format a datetime in a webpage. This the part of webpage: {% for record in records.object_list %} {{record.ComplaintPhone}} {{record.CustomerName}} {{record.ComplaintTime|time:"Y-m-d H:i"}} {{record.Complai

Re: Adding an App to the Admin

2011-01-28 Thread Corey Richardson
On 01/28/2011 06:30 AM, Daniel Roseman wrote: > On Friday, January 28, 2011 3:09:34 AM UTC, kb1pkl wrote: >> >> I'm following the tutorial at [1]. I'm trying to add the app to the >> admin site. I've run manage.py syncdb, and I've restarted the dev >> server. Any hints? The appropriate files that I

Re: How to format a datetime in a webpage?

2011-01-28 Thread Jirka Vejrazka
>         {{record.ComplaintTime|time:"Y-m-d > H:i"}} >From the documentation: "The time filter will only accept parameters in the format string that relate to the time of day, not the date (for obvious reasons). If you need to format a date, use the date filter." So, you need to use:

Re: first time deploying django on apache with mod_python on fedora 8

2011-01-28 Thread ashwoods
is there any reason you are using mod_python instead of, say, wsgi? modpython is deprecated and there are "better" alternatives. id start with that. looking in apache logs to find out why you have the 500 error might help. (a hunch tells me it might be a python path error) ash On 28 Jan., 07:45,

Re: Google maps

2011-01-28 Thread Shawn Milochik
Just do a Google search for the Google Maps API. It's the same regardless of whether you're using Django or something else to generate the HTML pages. You mainly have to write JavaScript. Also, search github and bitbucket to see if someone's created and shared some code for Django to easily gen

Re: Google maps

2011-01-28 Thread Michael
You might take a look at https://launchpad.net/ubuntu-django-foundations/map It's a fairly new project, but is actively being developed. -- Michael On Thu, 2011-01-27 at 21:23 -0800, roy mukasa wrote: > Hey guys does anyone know how i can embed google maps into django? i > am new to django but

Re: Adding an App to the Admin

2011-01-28 Thread Jonas Geiregat
>> >> Are you logged in as a user with permission to change models in that app? It >> won't appear if not. I once changed my admin.py file and after reloading nothing had changed. What did solve this issue was restarting the server or hard refreshing the page (Shift + F5 or something like that

Re: admin won't load revisited

2011-01-28 Thread octopusgrabbus
After making this change, I got the admin interface's look and feel, and then put back the original and did not get the look and feel, When I put this change back ADMIN_MEDIA_PREFIX = BASE_URL + 'media/admin/', I no longer get the look and feel. I've cleared the cache and rebooted. It looks like th

Re: What is a good app to use for a portfolio or images and videos?

2011-01-28 Thread mongoose
I downloaded the new django-cms and it's quite a great package. It offers video and images plus many more plugins. It's overkill for a smaller portfolio site but it offers everything. Still just testing though, haven't had to edit much but think that when I need to change things then the hard times

Re: Screen Field Selected Data Lost When Submit Button clicked and screen error results

2011-01-28 Thread hank23
So in a case like this the value previously selected can't be put back out to the screen when the errors are displayed, to avoid the user having to reselect the same file again when he inputs the previously missing data? On Jan 27, 8:40 pm, Karen Tracey wrote: > On Thu, Jan 27, 2011 at 5:30 PM, h

Re: admin won't load revisited

2011-01-28 Thread octopusgrabbus
In addition, I can't get the built-in server to serve the admin's look and feel. I see that as a good thing, because clearly it's a wrong setting that affects both servers. Here are the settings again. # Main URL for the project BASE_URL = 'http://localhost:8002' # Absolute path to the directory

Re: admin won't load revisited

2011-01-28 Thread octopusgrabbus
I got the look and feel back by substituting this: # URL prefix for admin media -- CSS, JavaScript and images. ADMIN_MEDIA_PREFIX = BASE_URL + '/media/' and yet the other value did work ADMIN_MEDIA_PREFIX = BASE_URL + 'media/admin/' Oh, well. Thanks for the answers. On Jan 28, 10:04 am, octop

use variable that is bound at an object's creation time at the object's creation time

2011-01-28 Thread Santiago Caracol
Hello, my model Product has an attribute spelling_variants and a property variants: class Product(models.Model): canonical_name = models.CharField(max_length=200) spelling_variants = models.ManyToManyField(String, related_name="product spellings", blank=True) ... @property def var

Django cache created in one function not available to another?

2011-01-28 Thread Lance Vick
So I have a function that sets cache (and successfully outputs it): def push_cache: cache.set('foo_cache', 'FUBAR!!!') foodata = cache.get('foo_cache') print(foodata) # this works However when I try to access that cache from within a view and directly output it it returns None: def f

Re: account errors when create superuser on cygwin

2011-01-28 Thread Bill Freeman
Did you create a superuser when you originally ran syncdb? If so, you can work around the problem in the admin, logged in as that original superuser, making additional superuser through the web. Have you tried logging in as the "jack" user? The fact that the name is now already taken implies tha

Settings to Load CSS Files

2011-01-28 Thread octopusgrabbus
I am running Django 1.2.4 mod_wsgi. My admin site loads with its look and feel. I am trying to add css to my application, which works fine. I have looked through the docs, and cannot get a sample css file to load. I would appreciate some pointers to get this working. Here are the appropriate lines

Re: Possible bug in model validation

2011-01-28 Thread Miguel Araujo
Well, I'm just trying to figure out if this should be reported. Thanks, regards Miguel Araujo @maraujop 2011/1/22 Miguel Araujo > Hi everyone, > > I have a model A that has a overwritten save method that updates a model > B's field. Both (A & B) have model validation using full_clean met

Re: weird behavior in select_related

2011-01-28 Thread Miguel Araujo
Hi, Please anyone confirm if this is normal, so I can report it or not. Thanks, regards Miguel Araujo @maraujop 2011/1/22 Miguel Araujo > Hi everyone, > > I have been working on reducing DB queries in my project with great > results. But I have realized that select_related in one of my

Re: weird behavior in select_related

2011-01-28 Thread Daniel Roseman
On Saturday, January 22, 2011 1:38:22 PM UTC, maraujop wrote: > > Hi everyone, > > I have been working on reducing DB queries in my project with great > results. But I have realized that select_related in one of my models doesn't > preload all the ForeignKeys and OneToOneFields, it preloads 3 out

Re: use variable that is bound at an object's creation time at the object's creation time

2011-01-28 Thread bruno desthuilliers
On 28 jan, 16:46, Santiago Caracol wrote: (snip) > Caught TypeError while rendering: 'NoneType' object is not iterable > > I think the problem in these cases is that when Python tries to > execute self.variants() it does not yet have a value for > self.spelling_variants. Dont "think". You do h

request.POST parsing without form

2011-01-28 Thread taso
Hi, I am using django strictly as a backend for data processing. As such I am not using any forms or templates, just database tables as models. The page is js driven and POSTing data is causing me some issues. A user action triggers a POST that looks like: action "update" data{ "field1": 8,"

Re: request.POST parsing without form

2011-01-28 Thread Daniel Roseman
On Friday, January 28, 2011 7:05:21 PM UTC, taso wrote: > > Hi, > > I am using django strictly as a backend for data processing. As such I > am not using any forms or templates, just database tables as models. > The page is js driven and POSTing data is causing me some issues. > > A user action

Re: request.POST parsing without form

2011-01-28 Thread Matias Aguirre
Excerpts from taso's message of Fri Jan 28 17:05:21 -0200 2011: > Hi, Hi, > I am using django strictly as a backend for data processing. As such I > am not using any forms or templates, just database tables as models. > The page is js driven and POSTing data is causing me some issues. > > A user

Re: Invalidate cached copy when changes are made.

2011-01-28 Thread Pranav
Thanks for the reply Matias. I'll give signals a try but pagination is definitely a no go. I want to see all the members at a stretch. Isn't there a simple way to tell the django cache to get a new copy, if changes are made? I'm sure the admin or something must have something like what i want

Re: request.POST parsing without form

2011-01-28 Thread taso
On Jan 28, 11:15 am, Matias Aguirre wrote: > Excerpts from taso's message of Fri Jan 28 17:05:21 -0200 2011: > > A user action triggers a POST that looks like: > > > action "update" > > data    { "field1": 8,"id": 2 } > > (copied from firebug) > > So, it's a POST with an "action" fiend and a "dat

Word file Display and Save??

2011-01-28 Thread nicolas lubkov
Hello all, is there a way to display a word .doc in the user profile and let the users edit it and save it to keep in their profile.?? -- Saludos. Nicolas Lubkov Ing. Informatica de gestion -- You received this message because you are subscribed to the Google Groups "Django users" group. To p

ANN: Server upgrade on djangoproject.com

2011-01-28 Thread Jacob Kaplan-Moss
Hi folks -- I'm starting the switchover to the new djangoproject.com server right now. Might be around 5 mins of downtime or so. Jacob -- 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@googlegrou

Re: Is it possible to log a user into a subdomain, from another domain??

2011-01-28 Thread PeteDK
Thanks :) i used the idead behind remoteuserbackend and coded something similar :) thanks again! regards Pete -- 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 f

Re: ANN: Server upgrade on djangoproject.com

2011-01-28 Thread Jacob Kaplan-Moss
On Fri, Jan 28, 2011 at 3:33 PM, Jacob Kaplan-Moss wrote: > I'm starting the switchover to the new djangoproject.com server right > now. Might be around 5 mins of downtime or so. Migration should be complete now. I'm still cleaning up a few last-minute things, but if you notice anything wrong ple

Re: ANN: Server upgrade on djangoproject.com

2011-01-28 Thread Łukasz Rekucki
On 28 January 2011 21:33, Jacob Kaplan-Moss wrote: > Hi folks -- > > I'm starting the switchover to the new djangoproject.com server right > now. Might be around 5 mins of downtime or so. > > Jacob > Hurray for upgrading the Trac instance! Are there any additional Trac features planned ? (like th

Re: Custom ModelAdmin form for distinct logged users

2011-01-28 Thread Moya, Mario
2011/1/28 hollando Hi hollando, You can use proxy models. Refer to > > http://stackoverflow.com/questions/2223375/multiplue-modeladmins-views-for-same-model-in-django-admin > I can't set permissions for proxy models, i think because the table auth_permissions doesn't have the proxy records. Tha

standalone session checking

2011-01-28 Thread Brian Craft
I'm trying to implement a stand-alone python script to check a session cookie for group authorization. I cribbed from the auth and session middleware, so I could take the sessionid from the cookie, look up the session, look up the user, and get the list of groups. This all basically works, except

Re: Custom ModelAdmin form for distinct logged users

2011-01-28 Thread Daniel Roseman
On Friday, January 28, 2011 12:22:04 AM UTC, Mario8k wrote: > > Hello, > > How can I customize a form by the user who is logged in? > For example, if the user is_superuser(), i need to display the > standard admin form, but if the user is another one, show only some > fields and not all model f

Re: Adding an App to the Admin

2011-01-28 Thread Corey Richardson
On 01/28/2011 08:43 AM, Jonas Geiregat wrote: >>> >>> Are you logged in as a user with permission to change models in that app? >>> It >>> won't appear if not. > > I once changed my admin.py file and after reloading nothing had changed. > What did solve this issue was restarting the server or ha

Re: DB-Views or read-only tables in models

2011-01-28 Thread bvdb
Thanks for describing the four possible reactions. My main concern is organisation, alas I imagine a Django solution, not just one for me. So the model needs to know about the view, i.e. we'd need a read-only attribute in models.py table definitions, so that a) Developer sets the attribute manually

Are there any Django events we're missing on Lanyrd?

2011-01-28 Thread Simon Willison
Hi everyone, My main project at the moment is Lanyrd, the social conference directory. It's a site that helps you find conferences to attend or speak at, and that enables you to build a profile of talks you've given and events you've attended in the past. There's just one problem: right now we on

caching of Models (not the cache middleware)

2011-01-28 Thread Brian Craft
Digging into the problem I'm having with a standalone django script, the problem seems to be that django doesn't see updates to the database unless it writes to the database. In the following lines, ss = engine.SessionStore(session_id) session=ss.load() If session_id "abcd" has been added t

Re: caching of Models (not the cache middleware)

2011-01-28 Thread Karen Tracey
On Fri, Jan 28, 2011 at 9:45 PM, Brian Craft wrote: > Digging into the problem I'm having with a standalone django script, > the problem seems to be that django doesn't see updates to the > database unless it writes to the database. > Sounds a lot like: http://groups.google.com/group/django-users

Re: ANN: Server upgrade on djangoproject.com

2011-01-28 Thread Karen Tracey
On Fri, Jan 28, 2011 at 4:45 PM, Jacob Kaplan-Moss wrote: > On Fri, Jan 28, 2011 at 3:33 PM, Jacob Kaplan-Moss > wrote: > > I'm starting the switchover to the new djangoproject.com server right > > now. Might be around 5 mins of downtime or so. > > Migration should be complete now. I'm still clea

Re: caching of Models (not the cache middleware)

2011-01-28 Thread Brian Craft
Thank you! 'set transaction isolation level read committed' had no effect, but 'set autocommit=1' appears to fix it. I wondered if there was some more general way of doing this (I mean, besides passing in raw sql). Perhaps the set_autocommit() method in db.backends.creation? On Fri, Jan 28, 20

QUERYDICT immutable

2011-01-28 Thread sami nathan
HI I am NEWBIE i am trying to run an server and my POST request is from java api(client) and i cant able to see exact error in java api its just showing HTML request is not accepting in java b coz django giving me error iin html format but by some how i manage to print request.POST from my req