Re: working with shp files and geodjango

2008-12-24 Thread Milan Andric
I kind of figured this one out... the source spatial relation was in SRID 3084 format "North_American_Datum_1983". So if i set that in the model as an attribute then I can use the transform method to tranform to WGS84 or srid 4326, the default. poly = models.GeometryField(srid=3084) #

Executing logic for each object in object_list

2008-12-24 Thread Roy
Is it possible? Or I need to page my queryset in the wrapper function and do it there? (it seems not DRY to simply copy-paste the pagination logic from object_list) Basically I have several object_list wrappers for a particlar model, and I want to add logging logic every time a specific instance

Putting external web service accesses into models.py?

2008-12-24 Thread Jeff Hammerbacher
Hey, I'm building a web applications that pulls all of its data from an external web service rather than from a managed database. The documentation for the model layer in Django seems to assume you're retrieving application information from a database. Can anyone point me to a resource that

working with shp files and geodjango

2008-12-24 Thread Milan Andric
Hello, I'm playing around with geodjango and this is a GIS question but I'm starting my quest for an answer by asking here. So have a shp file I'm using from the city of chicago: http://egov.cityofchicago.org/webportal/COCWebPortal/COC_ATTACH/CitywideWardsMap2008.zip There is a wards.shp file

Fastest way to import datas into a database

2008-12-24 Thread bsergean
Hi all, I'm populating my database manually using a script that create ORM objects and save them... I have a lot of datas and it's fairly slow. I'm wondering what is the best way to speed this up. >From >http://docs.djangoproject.com/en/dev/howto/initial-data/#howto-initial-data I see there

RadioSelect widget CHECKED code attached

2008-12-24 Thread zunzun
Below is code subclassing the RadioSelect forms widget and associated renderer, this allows radio button selection at runtime in a view. I intend to keep some user selections in session data, and this way the users don't have to keep making the same radio button choices over and over. For

Adding 'Select Any' to selects generated for forms

2008-12-24 Thread phoebebright
I want to have a popups in a search form that have an additional item 'Select Any'. Having trawled the internet I can't find any examples other than using jquery and I'm sure this must be possible in django. Any pointers very welcome. MODEL - simplified === TRANSMISSION_CHOICES = (

Re: Pagination Suggestions

2008-12-24 Thread kev
Ah ok :) Thx!! On Dec 24, 5:12 pm, Brian Neal wrote: > On Dec 24, 3:54 pm, kev wrote: > > > Hello, > > Im trying to create a digg type pagination. Is there a decent > > pagination app already out there that works for 1.0? I tried looking > > but havent

Re: Pagination Suggestions

2008-12-24 Thread Brian Neal
On Dec 24, 3:54 pm, kev wrote: > Hello, > Im trying to create a digg type pagination. Is there a decent > pagination app already out there that works for 1.0? I tried looking > but havent succeeded. > > Thanks, > Kev I'm using this. Works great!

Re: ViewDoesNotExist

2008-12-24 Thread Justin Myers
Well, it's saying it can't find a file named seoappsla/views.py. Does that file exist? Based on the example code within the URLconf, I'd guess you might want to try seoapp_sla.views.index and seoapp_sla.views.detail instead--but without knowing what files you have in what directories, it's hard

Pagination Suggestions

2008-12-24 Thread kev
Hello, Im trying to create a digg type pagination. Is there a decent pagination app already out there that works for 1.0? I tried looking but havent succeeded. Thanks, Kev --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Apache misconfiguration, i think

2008-12-24 Thread aperez199
Hi everyone, i have an application and i'm trying to run it on Apache. I have the following lines in httpd.conf SetHandler python-program PythonHandler django.core.handlers.modpython PythonPath "['/home/sla/'] + sys.path" SetEnv DJANGO_SETTINGS_MODULE seoapp_sla.settings

ViewDoesNotExist

2008-12-24 Thread aperez199
Hi everyone, i'm having a problem with an application i have migrated from a server to another. I got the settings right and all, but i get this error: Exception Type: ViewDoesNotExist Exception Value:Could not import seoappsla.views. Error was: No module named seoappsla.views I

Re: memory use in django database queries

2008-12-24 Thread garyrob
Or, if the issue is at least partly due to buffering for efficiency in communicating between django and the database engine, is there a way to choose to have smaller buffers? On Dec 24, 12:42 pm, garyrob wrote: > I am getting the impression that when I do a django database

how do i change the requiredness of fields in modelform?

2008-12-24 Thread JeeyoungKim
I have the following form: class UserInfoForm(forms.ModelForm): password_field = forms.CharField(label='Password', widget=forms.PasswordInput(render_value=False) password_repeat_field = forms.CharField(label='Password(repeat)', widget=forms.PasswordInput(render_value=False)) #Make

memory use in django database queries

2008-12-24 Thread garyrob
I am getting the impression that when I do a django database query that iterates through all the rows of the table, django stores every model instance in memory. For instance, just doing sumValues = 0 for someModel in SomeModel.objects.all(): sumValues += someModel.value print sumValues

basic User model usage

2008-12-24 Thread adrian
Is there a simple example anywhere for how to save data that is specific to an individual user, and how to access that data in a view? For example if each user owns a list of books, what does the BookList model look like exactly and what are the lines of code in the view that would set and read

Re: Model with 2 foreignkey to User

2008-12-24 Thread Tirta K. Untario
Very useful post, thank you :) --Tirta --- On Wed, 24/12/08, Matias Surdi wrote: > From: Matias Surdi > Subject: Re: Model with 2 foreignkey to User > To: django-users@googlegroups.com > Date: Wednesday, 24 December, 2008, 7:26 PM > Maybe this

Re: dynamically instantiate a model at run time

2008-12-24 Thread Jeff FW
I think you've got a small typo in the code there, that might be confusing to the OP--shouldn't the get_model() call have quotes around "tag"? Like so: model_class = get_model("test", "tag") -Jeff On Dec 23, 5:03 pm, bruno desthuilliers wrote: > On 23 déc,

posting data to url

2008-12-24 Thread Vicky
i used this code to send more than one data to url: http://local/www/app/data/id=1=django=23232 but is this the right pattern a url should look like? If not can anyone tell how can we send them? --~--~-~--~~~---~--~~ You received this message

Re: Model with 2 foreignkey to User

2008-12-24 Thread Matias Surdi
Maybe this helps: http://www.b-list.org/weblog/2008/dec/24/admin/ Tirta K. Untario wrote: > This is a continuation from my last question. > > created_by = models.ForeignKey(User) > > I want to automatically use current logged in user as value. Can I put the > code inside def

Re: saving unicode data in file

2008-12-24 Thread Matias Surdi
Finally I've solved it with smart_str function. Matias Surdi wrote: > Hi, I'm trying to save on a FileField some generated data (a text file > obtained from a template): > > The relevant code is: > > out = Template(open("/path/to/template").read()) > context =

Re: Slowness on a Mac with 10.5.6

2008-12-24 Thread bmclaughlin
Turns out it was having a router set-up incorrectly on the system which was making the retrieval of the images unpleasant. On Dec 23, 12:05 pm, bmclaughlin wrote: > Hello, > I am having slowness issues with my local set-up. > > My system was 10.4.x when django was

Re: Model with 2 foreignkey to User

2008-12-24 Thread Tirta K. Untario
This is a continuation from my last question. created_by = models.ForeignKey(User) I want to automatically use current logged in user as value. Can I put the code inside def save(self) for this model? I can't find anything about getting current user value from model. Thanks in advance.

Re: Model with 2 foreignkey to User

2008-12-24 Thread Tirta K. Untario
Understood, thanks Paul. I missed this section from documentation :) --Tirta -Original Message- From: Paul van der Linden Date: Wed, 24 Dec 2008 11:09:25 To: Subject: Re: Model with 2 foreignkey to User Hi, just do as the error is

Re: Model with 2 foreignkey to User

2008-12-24 Thread Paul van der Linden
Hi, just do as the error is telling you. created_by = models.ForeignKey(User, related_name='createdBy') assigned_to = models.ForeignKey(User, related_name='assignedBy') or something like that. That works. Tirta K. Untario wrote: > Hi all, > > I'm developing a simple todo list. I use

Re: I would like some feedback about address model snippet...

2008-12-24 Thread Kenneth Gonsalves
On Wednesday 24 Dec 2008 3:02:10 pm klein.steph...@gmail.com wrote: > I've write a address model snippet at : > > http://www.djangosnippets.org/snippets/1177/ > > I would like to know if you see some missing fields or mistake/ > misnamed fields ? why are you putting this in djangosnippets???

Model with 2 foreignkey to User

2008-12-24 Thread Tirta K. Untario
Hi all, I'm developing a simple todo list. I use Django Auth for handling authentication. This is my models.py from django.contrib.auth.models import User class Item(models.Model): project = models.ForeignKey(Project) category= models.ForeignKey(Category) title =

Re: I would like some feedback about address model snippet...

2008-12-24 Thread Ramdas S
Stephane, IMHO it will be better you use dpaste.com for such trivial examples where you require feedback. Djangosnippets shold be reserved for coding snippets that goes a bit beyond a model Ramdas On Wed, Dec 24, 2008 at 3:02 PM, klein.steph...@gmail.com < klein.steph...@gmail.com> wrote: > >

I would like some feedback about address model snippet...

2008-12-24 Thread klein.steph...@gmail.com
Hi, I've write a address model snippet at : http://www.djangosnippets.org/snippets/1177/ I would like to know if you see some missing fields or mistake/ misnamed fields ? Note : I'm french and I haven't international address system background. Thanks for your feedback. Regards, Stephane

Re: Dynamic age count

2008-12-24 Thread join.toget...@gmail.com
Look at the timesince filter in django's source for an example, as it does almost exactly what you're looking for. On Dec 23, 8:53 am, Alfonso wrote: > Hi, > > Trying to implement a very simple template tag that will output a > company's age.  So idea being if company