how to make a field uneditable in admin site

2009-02-16 Thread guptha
hi , i need to know how to create a non editable field in admin site .I tried , one like below acct_number=models.CharField(max_lenght=100,editable=False) but it doesn't work please any other ideas, --~--~-~--~~~---~--~~ You received this message because you

Re: Disabling middleware for tests

2009-02-16 Thread stryderjzw
Ah yeah, of course I can put a print statement. Thanks Malcolm. Your many posts have helped me greatly in the past. Looks like it works with a new Django project. I am using Pinax and they alter the manage.py file slightly. Can't see why it's not working though. I guess I'll have to dig in

Re: how to use post_save signals

2009-02-16 Thread Malcolm Tredinnick
On Mon, 2009-02-16 at 22:38 -0800, gganesh wrote: > hi, > i wrote > def after_save(sender,instance,created,**kaw): > instance.acct_number ='RBSB' + str(instance.id) > instance.save() > > > post_save.connect(after_save,sender=Selector) > > > once when i save it gives out error like

Re: how to use post_save signals

2009-02-16 Thread gganesh
hi, i wrote def after_save(sender,instance,created,**kaw): instance.acct_number ='RBSB' + str(instance.id) instance.save() post_save.connect(after_save,sender=Selector) once when i save it gives out error like "maximum recursion depth exceeded in cmp "Exception I 'm

Re: template tag

2009-02-16 Thread xankya
Thank you very much Malcolm Tredinnick. That will definitely work for me. --~--~-~--~~~---~--~~ 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

Re: template tag

2009-02-16 Thread Malcolm Tredinnick
On Mon, 2009-02-16 at 21:49 -0800, xankya wrote: > hi, >i need to do the following kind of template logic. can i achieve > this using built in tags or i need to create custom tags? > > {% if user in voter_list %} > You have already voted. > {% else %} > Vote > {% endif %} You can't

Re: Organizing multiple django projects/apps on 1 server

2009-02-16 Thread Malcolm Tredinnick
On Mon, 2009-02-16 at 21:35 -0800, bbeaudreault wrote: > Hello all, > > I am pretty new to Django, and coming from a fairly "protective" > environment in terms of web development. My only experience in webdev > stems from my first job out of college, where I came into a very > complex/robust

template tag

2009-02-16 Thread xankya
hi, i need to do the following kind of template logic. can i achieve this using built in tags or i need to create custom tags? {% if user in voter_list %} You have already voted. {% else %} Vote {% endif %} --~--~-~--~~~---~--~~ You received this

Organizing multiple django projects/apps on 1 server

2009-02-16 Thread bbeaudreault
Hello all, I am pretty new to Django, and coming from a fairly "protective" environment in terms of web development. My only experience in webdev stems from my first job out of college, where I came into a very complex/robust system and did more tweaking/maintaining than creating. I am trying

Re: Changing an ImageField file without re-upload

2009-02-16 Thread Eric Abrahamsen
On Feb 17, 2009, at 5:17 AM, Carmelly wrote: > > My situation is this: I want to allow my users to upload multiple > userpics and then choose between them. So I have a Profile model with > an ImageField for the userpic. When users upload a file it is > displayed around the site as usual. When

Re: Incompatibility with FreeTDS/ODBC and Unicode on a MSSQL server?

2009-02-16 Thread kgingeri
I should add a couple more things here that may have a bearing on my problem... a) I am running Ubuntu Linux and b) I am accessing my data via a VPN connection c) I have done most of my installs via Synaptics but will try to redo some with compiling from source. If I answer my own question, I

Incompatibility with FreeTDS/ODBC and Unicode on a MSSQL server?

2009-02-16 Thread kgingeri
I am fairly new to Django and am working my way through the latest tutorial and get the error below. I have the latest dev for Django installed (I know cuz I started out with 0.96), the most recent FreeTDS, pyodbc and django-pyodbc. My isql and running all the api stuff works fine with my SQL

Re: Differen unicode behaviour between mac os x and linux

2009-02-16 Thread Malcolm Tredinnick
On Mon, 2009-02-16 at 19:03 -0800, Polat Tuzla wrote: > Thanks a lot for your reply Malcolm. > It's OK if I don't understand the reason of different behaviours, but > I must find a proper way of writing log files on the linux server. Aah, context certainly helps with understanding the broader

Re: Differen unicode behaviour between mac os x and linux

2009-02-16 Thread Polat Tuzla
Thanks a lot for your reply Malcolm. It's OK if I don't understand the reason of different behaviours, but I must find a proper way of writing log files on the linux server. I think I should have clarified some more facts about my setup. 1- On mac, django is running on dev mode, so stdout is the

Re: Disabling middleware for tests

2009-02-16 Thread Malcolm Tredinnick
On Mon, 2009-02-16 at 18:36 -0800, stryderjzw wrote: [...] > However, I'm running into the problem that I have no clue if manage.py > ever read my settings file correctly. The settings file is executable (well, importable) Python code, so put a print statement in there that will display

Re: Disabling middleware for tests

2009-02-16 Thread stryderjzw
Well, looking at Ticket 9172 (http://code.djangoproject.com/ticket/ 9172), we're supposed to be turning off the CSRF middleware during tests. I believe we can do that by writing another settings file, disabling the Csrf Middleware and using that settings file to run our tests, as per this

Re: Can I overwrite the ModelAdmin for User

2009-02-16 Thread Karen Tracey
On Mon, Feb 16, 2009 at 8:19 PM, Kevin Audleman wrote: > > Alex, > > I managed to get it to work, and the column is even sortable! Thanks > for your help. > > Here's my code for reference for anyone else who comes across this > post: > > class

Re: Differen unicode behaviour between mac os x and linux

2009-02-16 Thread Malcolm Tredinnick
On Mon, 2009-02-16 at 17:55 -0800, Polat Tuzla wrote: > Hi, > I've the same django app deployed to my local mac os x and linux > server. I print the username in my view function to the standart > output: > def my_view(request): > print request.user > > On mac it prints: > İşÖ >

Differen unicode behaviour between mac os x and linux

2009-02-16 Thread Polat Tuzla
Hi, I've the same django app deployed to my local mac os x and linux server. I print the username in my view function to the standart output: def my_view(request): print request.user On mac it prints: İşÖ which is what i expect. But on linux it prints:

Re: Changing an ImageField file without re-upload

2009-02-16 Thread James Mowery
I don't really understand your question (perhaps English isn't your first language), and I'm too tired to try to understand, but maybe one of the following will help: http://docs.djangoproject.com/en/dev/topics/db/models/#overriding-predefined-model-methods

Re: Can I overwrite the ModelAdmin for User

2009-02-16 Thread Kevin Audleman
Alex, I managed to get it to work, and the column is even sortable! Thanks for your help. Here's my code for reference for anyone else who comes across this post: class UserAdmin(admin.ModelAdmin): def display_profile_status(self, obj): profile = obj.myprofile_set.all() if

Re: Different ways of working against a SQLite3 dB

2009-02-16 Thread Karen Tracey
On Mon, Feb 16, 2009 at 3:53 PM, DaSa wrote: > > > Thx for your tips! > > I tried to update my Python version but it did not work. > Updating Python failed? Or changing to 2.6 did not affect your problem? > > Today I have my data in an Excel document, and I have a

Re: Can I overwrite the ModelAdmin for User

2009-02-16 Thread Alex Gaynor
On Mon, Feb 16, 2009 at 7:13 PM, Kevin Audleman wrote: > > Alex, > > I feel like I'm one step closer to getting this to work. From the > documentation you sent my way, it seems like what I would do would be > to create a method on the User object which will span the

Re: Can I overwrite the ModelAdmin for User

2009-02-16 Thread Kevin Audleman
Alex, I feel like I'm one step closer to getting this to work. From the documentation you sent my way, it seems like what I would do would be to create a method on the User object which will span the relationship and grab the value:, def get_payment_status(self): return

Re: Disabling middleware for tests

2009-02-16 Thread felix
ah ha. yes, I've wasted several hours over this issue. it took me a while to figure out that it was the CSRF middleware that was breaking the tests. both auth tests and actually every single one that tests the posting of forms. I didn't see it mention of this issue in either the CSRF docs or

Re: Can I overwrite the ModelAdmin for User

2009-02-16 Thread Alex Gaynor
On Mon, Feb 16, 2009 at 6:59 PM, Kevin Audleman wrote: > > Thanks! > > I've got my new User display going and another question has come up. > In the related MyProfile object, I've got a field called > payment_status. It's important for my client to be able to quickly >

Re: Can I overwrite the ModelAdmin for User

2009-02-16 Thread Kevin Audleman
Thanks! I've got my new User display going and another question has come up. In the related MyProfile object, I've got a field called payment_status. It's important for my client to be able to quickly view a list of users with a payment_status of 'Unpaid.' Is there a way to add a related field

Re: site.title does not show in child flatpages templates

2009-02-16 Thread Malcolm Tredinnick
On Mon, 2009-02-16 at 13:40 -0800, Manuel Ignacio wrote: > Hi, when i load my site i have the next code in my view: > > current_site = Site.objects.get_current() > def default_index(request): > return render_to_response('doorsFront/default_index.html', > {'current_site':current_site}) This

Re: Settings for an application - define as a model?

2009-02-16 Thread Alex Gaynor
On Mon, Feb 16, 2009 at 6:29 PM, Russell Keith-Magee wrote: > > On Tue, Feb 17, 2009 at 6:24 AM, Rob wrote: > > > > I'm writing a Django app to act as the front-end interface to a backup > > application, using MySQL as the database. I need to

Re: Can I overwrite the ModelAdmin for User

2009-02-16 Thread Alex Gaynor
On Mon, Feb 16, 2009 at 6:27 PM, Kevin Audleman wrote: > > I've created a custom profile per the instructions in chapter 12 of > the book to give my user's fields like address1, address2, etc. > Currently when I log in to the admin and want to update a user, I have > to

Re: Settings for an application - define as a model?

2009-02-16 Thread Russell Keith-Magee
On Tue, Feb 17, 2009 at 6:24 AM, Rob wrote: > > I'm writing a Django app to act as the front-end interface to a backup > application, using MySQL as the database. I need to store some > variables to act as the "global" settings specific to my app - like > UNIX backup

Can I overwrite the ModelAdmin for User

2009-02-16 Thread Kevin Audleman
I've created a custom profile per the instructions in chapter 12 of the book to give my user's fields like address1, address2, etc. Currently when I log in to the admin and want to update a user, I have to go to two separate pages: the User page to update core user fields, and the Profile page to

site.title does not show in child flatpages templates

2009-02-16 Thread Manuel Ignacio
Hi, when i load my site i have the next code in my view: current_site = Site.objects.get_current() def default_index(request): return render_to_response('doorsFront/default_index.html', {'current_site':current_site}) I load the site name in my template and i extend this template por

site.title does not show in child flatpages templates

2009-02-16 Thread Manuel Ignacio
Hi, when i load my site i have the next code in my view: current_site = Site.objects.get_current() def default_index(request): return render_to_response('doorsFront/default_index.html', {'current_site':current_site}) I load the site name in my template and i extend this template por

Re: mptt usage

2009-02-16 Thread Francis
Do you have any suggestion for a better alternative? On Feb 3, 3:58 pm, adelevie wrote: > mptta is slow as hell > > On Feb 3, 4:50 am, vicalloy wrote: > > > I thinkmptthave good doc.http://code.google.com/p/django-mptt/ > >mpttjust a set of function to

Settings for an application - define as a model?

2009-02-16 Thread Rob
I'm writing a Django app to act as the front-end interface to a backup application, using MySQL as the database. I need to store some variables to act as the "global" settings specific to my app - like UNIX backup location, etc. At present I have a model called Setting, with two fields - name

Changing an ImageField file without re-upload

2009-02-16 Thread Carmelly
My situation is this: I want to allow my users to upload multiple userpics and then choose between them. So I have a Profile model with an ImageField for the userpic. When users upload a file it is displayed around the site as usual. When they upload a new file, that file replaces their the

Re: Signals getting sent twice

2009-02-16 Thread stevedegrace
Figured it out myself... you have to set dispatch_uid for the connect methods. See modification below to the last three lines of my example above. It's still annoying that the overhead of module import is apparently being incurred twice, but at least things work the way you expect. Aside from

Re: Add views to admin interface

2009-02-16 Thread Robert
Well then, now I have added my custom view to admin interface by altering the template index.html. I added the following: Diagramm Chart wrote a view and put both together in url.py. The problem is, as thought before,

Re: Different ways of working against a SQLite3 dB

2009-02-16 Thread DaSa
Thx for your tips! I tried to update my Python version but it did not work. Today I have my data in an Excel document, and I have a script that parse the excel document and creates sql-commands that I paste in the SQL shell. But as you know I have the problem with swedish signs. I shall try

creating links from inline within admin

2009-02-16 Thread Mark (Nosrednakram)
Hello, models person organization fk relationship between person and organization, i.e. an organization consists of people. I would like to list the people using an inline form in admin with a like back to the person and have the person added to the organization in the person form. The

Re: Disabling middleware for tests

2009-02-16 Thread stryderjzw
This doesn't seem to be working for me. I created my own test_settings.py in the project root directory. I ran python manage.py test --settings=test_settings It runs as usual and CSRF still fails when I run tests. Anyone know what I might be doing wrong here? How can I tell that python

Re: cache.get_model() vs. models.get_model()

2009-02-16 Thread richleland
Ah I didn't realize - thanks for the quick response! On Feb 16, 3:14 pm, Alex Gaynor wrote: > On Mon, Feb 16, 2009 at 3:10 PM, richleland wrote: > > > Is there any advantage/disadvantage to using cache.get_model() vs. > > models.get_model() in an

Date Formating

2009-02-16 Thread ReneMarxis
Hello i am having some problems getting date-formating running ... here is some code-snippet i use in my app http://dpaste.com/121354/ The form shows up ok. If i enter valid data everything is ok. But if i enter invalid data or none the form will be empty. There is no validation error showing

Django Template Hyphenated Keys

2009-02-16 Thread bfrederi
I have a dictionary of dictionaries that I want to use in a template. Unfortunately some of the keys are hyphenated (I can't change it), so when I try to call them in the template using {{ dictionary.key- name }} it doesn't work: Could not parse the remainder: '-qualifiers' from

Re: cache.get_model() vs. models.get_model()

2009-02-16 Thread Alex Gaynor
On Mon, Feb 16, 2009 at 3:10 PM, richleland wrote: > > Is there any advantage/disadvantage to using cache.get_model() vs. > models.get_model() in an admin.py file? I'm assuming that > cache.get_model() provides quicker access, but just wanted to see if > there were any

cache.get_model() vs. models.get_model()

2009-02-16 Thread richleland
Is there any advantage/disadvantage to using cache.get_model() vs. models.get_model() in an admin.py file? I'm assuming that cache.get_model() provides quicker access, but just wanted to see if there were any drawbacks. A simple example of each usage is below: from django.contrib import admin

Re: Question about class variables

2009-02-16 Thread bruno desthuilliers
On 16 fév, 20:33, MV wrote: > Hi there, > > I have a question about class variables in Django. If I create a > custom field, e.g. > > class TinyMCEField(models.Field): > superadmin = False > def formfield(self, **kwargs): > if superadmin: >

Re: Context processor or make custom tag

2009-02-16 Thread basoko
After read you I've decided to do a tag, I think that it's the best way to do it. About the calls to the database I can that it's no problem because in the future I could use cache system so it's no problem. Thanks for your help and recommendations, it's been very good and I'm so happy with

Re: Question about class variables

2009-02-16 Thread Alex Gaynor
On Mon, Feb 16, 2009 at 2:33 PM, MV wrote: > > Hi there, > > I have a question about class variables in Django. If I create a > custom field, e.g. > > class TinyMCEField(models.Field): >superadmin = False >def formfield(self, **kwargs): >if superadmin: >

Question about class variables

2009-02-16 Thread MV
Hi there, I have a question about class variables in Django. If I create a custom field, e.g. class TinyMCEField(models.Field): superadmin = False def formfield(self, **kwargs): if superadmin: defaults = {'widget':TinyMCE(... blah blah blah})} else:

Re: BINARY columns

2009-02-16 Thread Alex Gaynor
On Mon, Feb 16, 2009 at 2:19 PM, Andy Dustman wrote: > > I'm working on a custom field type for Django which depends on being > able to save data in a BINARY column. (Not a big BLOB, just a couple > of bytes.) Unfortunately Django (trunk and probably 1.0) keeps trying > to

BINARY columns

2009-02-16 Thread Andy Dustman
I'm working on a custom field type for Django which depends on being able to save data in a BINARY column. (Not a big BLOB, just a couple of bytes.) Unfortunately Django (trunk and probably 1.0) keeps trying to turn it into unicode which fails. I'm now using patch.3.txt on

renaming file name after uploading at admin site

2009-02-16 Thread Mirat Can Bayrak
i wrote a save function like that class ProductAdmin(admin.ModelAdmin): def save_model(self, request, obj, form, change):

Re: order_by foreign key

2009-02-16 Thread Alex Gaynor
On Mon, Feb 16, 2009 at 1:52 PM, jeffhg58 wrote: > > I have seen other posts on this topic but it seems that it was on the > old trunk. I am using > Django version 1.1 and I am unable to sort by foreign key > > When I try and execute the following query > >

order_by foreign key

2009-02-16 Thread jeffhg58
I have seen other posts on this topic but it seems that it was on the old trunk. I am using Django version 1.1 and I am unable to sort by foreign key When I try and execute the following query Result.objects.select_related().order_by('StatusId.Status') I get 0 rows retrieved. Is that the

regex query search with [\w]

2009-02-16 Thread Stephen Sundell
I'm trying to do a query filter with a regex expression where I want to search for a word character. I'm using postgresql and if I do Blog.objects.filter(post__regex=r'[\w]'), django ends up using [\\w] in the query. I can't seem to get one backslash in the query. Is there some way to do this?

Re: Mutli-Assignable Models

2009-02-16 Thread Justin Lilly
Hi Peter, While your proposed solution would work for the prototyping example I've given, I have 3 more arching themes like Show and probably another 4-5 content types like photo and articles. The main idea here is to be able to select an arbitrary element, be it a photo, video, article, etc.

Re: mod_wsgi+apache2.2+django1+WindowsXP: can't serve images

2009-02-16 Thread Angel Cruz
Thank you Graham! All of my reference materials, including the Django book I am currently reading (mod_wsgi was toward the end of the book and I should have looked there first :>) ), has the "Alias" directive. Why I typed Match in there, I am now at a lost :>) Off I gothank you again! On

Re: Admin Change List Page - Can I have anonymous users view this table?

2009-02-16 Thread Bfox
Hi Alex- Thanks for the links. I am trying out django-tables, and it seems like it will work pretty good. It seems a little disappointing that there is the great admin table interface and someone has to build and maintain a separate module to implement something similar. I will also take a

Re: Any django users in Malaysia/Singapore

2009-02-16 Thread Azril Nazli
Any RoR die hard fan here :) On Feb 7, 11:24 pm, cheeming wrote: > I am using Django as well, for my startup. > Would be nice to have some get together or teh tarik sessions. > > On Jan 29, 1:45 pm, ycloh wrote: > > > Yeah, would have been nice if there

Re: Geodjango GPolygon

2009-02-16 Thread Adonis
Justin, So it would seem, Thank you very much for this notice. I reversed the Glatlng() and now it works just fine. regards, On Feb 16, 4:35 pm, Justin Bronn wrote: > > Im afraid that it does not change anything by leaving out the fromstr > > and wkt. > > It is a really

change template code

2009-02-16 Thread Akhmat Safrudin
hello... how changed template take effect after deployed with fastcgi ? thank's --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: LaTeX custom Field, png url

2009-02-16 Thread Alex Gaynor
On Mon, Feb 16, 2009 at 12:05 PM, alain31 wrote: > > What I understood reading custom-model-fields.html is that Field class > only handle one column in database > (db_type method returns a database type...). I first thought to > inherit from TextField and build the name of the

Re: LaTeX custom Field, png url

2009-02-16 Thread alain31
What I understood reading custom-model-fields.html is that Field class only handle one column in database (db_type method returns a database type...). I first thought to inherit from TextField and build the name of the png file using a hash from the LaTeX string (so no need to store it in the

Re: Custom template tags in admin with hacking to source?

2009-02-16 Thread Karen Tracey
On Mon, Feb 16, 2009 at 11:49 AM, Daniel Roseman < roseman.dan...@googlemail.com> wrote: > > On Feb 16, 4:23 pm, Ben Gerdemann wrote: > > Is it possible to add a custom template tag to the admin without > > modifying the Django source? I'd like to add a tag to display a > >

Access extra parameters in forms.py

2009-02-16 Thread peterandall
Hi all, I'm trying to access a list of users in forms.py I'm creating two lists and merging them in my view (new_bug) then passing them through when i create the form. I was going off answers on these two existing topics:

Re: Custom template tags in admin with hacking to source?

2009-02-16 Thread Daniel Roseman
On Feb 16, 4:23 pm, Ben Gerdemann wrote: > Is it possible to add a custom template tag to the admin without > modifying the Django source? I'd like to add a tag to display a > different submit_line, but the only way I can figure out how to do > this is by either adding one of

Re: LaTeX custom Field, png url

2009-02-16 Thread Alex Gaynor
On Mon, Feb 16, 2009 at 10:40 AM, alain31 wrote: > > Hello, > I plan to use django for some projects with heavy use of math formulas > and I would like to create a reusable custom field to store LaTeX > strings and to get a png image on disk after compilation. The usage > would

Re: Geodjango GPolygon

2009-02-16 Thread Justin Bronn
> Im afraid that it does not change anything by leaving out the fromstr > and wkt. > It is a really weird problem reversing the lat and lng like that... It's probably because your GEOS polygon has the order wrong to begin with. All spatial databases use (x, y) ordering -- in other words (lon,

Re: HttpResponse post

2009-02-16 Thread Antoni Aloy
2009/2/16 Mike : > > Hi all, > > I m not familiar with django and I have found several problems trying > to sent a httpresponse with post parameters. I would like to return an > httpresponse (or httpredirect) to a new url with the request > parameters via post. > > Could

LaTeX custom Field, png url

2009-02-16 Thread alain31
Hello, I plan to use django for some projects with heavy use of math formulas and I would like to create a reusable custom field to store LaTeX strings and to get a png image on disk after compilation. The usage would go like this : model: formula = LatexField() template to get the png:

HttpResponse post

2009-02-16 Thread Mike
Hi all, I m not familiar with django and I have found several problems trying to sent a httpresponse with post parameters. I would like to return an httpresponse (or httpredirect) to a new url with the request parameters via post. Could anybody help me? Thank you in advance, Miguel I have

Re: Geodjango GPolygon

2009-02-16 Thread Adonis
thank you Adam, Im afraid that it does not change anything by leaving out the fromstr and wkt. It is a really weird problem reversing the lat and lng like that... cheers, On Feb 16, 2:58 pm, Adam Fast wrote: > GPolygon is "designed" to take the geometry natively - no

Re: Keys composed of multiple fields

2009-02-16 Thread jfmxl
I see. Thank you. Alex Koshelev wrote: > Django doesn't suppurt multi-field PKs. Try to search this group for more > diussion. > > On Mon, Feb 16, 2009 at 12:43 PM, jfmxl wrote: > > > > > Hi again, > > > > How do I handle multifield keys? > > > > I have multifield primary keys

Re: Geodjango GPolygon

2009-02-16 Thread Adam Fast
GPolygon is "designed" to take the geometry natively - no fromstr() or .wkt necessary. Try GPolygon(polycoords_from_database.geometry) Adam 2009/2/16 Adonis : > > Hello, > > -being facing a non-givin-back-errors problem... > > view.py > > poly = GPolygon(fromstr >

Changing the reponse headers & Firefox

2009-02-16 Thread mermer
I am trying to change the Headers in the response. My frustration, is that I can change the ETAG header and it is returned by the browser at the next request but I can't seem to get the Cache Control or Expire header accepted by the browser Does anybody have a clue why? Is this a browser

Re: Admin hangs while updating a modified, repopulated model [update]

2009-02-16 Thread Karen Tracey
2009/2/16 haestan none > Sorry, it looks like I had a wrong assumption in my original question. The > server seems to hang as soon as I try to update a model with an URLField > that is set to 'http://localhost:8000' (this is where the built-in > webserver is running). > >

Re: Negative value in forms.Integerfield throws TypeError

2009-02-16 Thread Karen Tracey
On Mon, Feb 16, 2009 at 4:26 AM, coan wrote: > > I'm validating a form, and use forms.IntegerField(min_value=0,). > > If I submit a -1 value in that field, it throws a TypeError: not all > arguments converted during string formatting. > How come it doesn't raise a

Re: Trying to get data from template to view...

2009-02-16 Thread arbi
In fact I may have answered a bit quick. Your solution is great, BUT in my case, I have an additional pb : my js function calls a "call-back" function. I show you : function js_function(address){ geocoder.getLocations(address, js_function_call_back); // "getLocations" is a Google Maps API

Geodjango GPolygon

2009-02-16 Thread Adonis
Hello, -being facing a non-givin-back-errors problem... view.py poly = GPolygon(fromstr (polycoords_from_database.geometry.wkt),"#f33f00",3,1,"#008000",1) blah.html map.addOverlay(new {%block poly%}{%endblock%}) -the page source shows that the new GPolygon has a proper syntax BUT the new

Re: Form wizard back button

2009-02-16 Thread urukay
Maybe i don't have exact solution to your problem, because i've never user form wizard so far. I always create my own forms. During user's registraton process i save user.id in session and in every view i'm testing if this ID is in session (it menas, register process has not been finished) and

Django and php can they mix?

2009-02-16 Thread TimSSP
HI, I'm looking into using Django to redevelop a website to handle dynamic content and some social app functions. I am interested in knowing whether django can work alongside php, we built a modest database to work on news articles in php and are considering using facebook's api for an

Re: Trying to get data from template to view...

2009-02-16 Thread arbi
Thx nivhab, that's great :) On 15 fév, 20:56, nivhab wrote: > If you'd likeJavaScriptto calculate values before you submit the > form then do the following: > > 1. Add a "onSubmit" attribute on your "form" tag which calls a JS > function like: > > > 2. In the

Re: Keys composed of multiple fields

2009-02-16 Thread Alex Koshelev
Django doesn't suppurt multi-field PKs. Try to search this group for more diussion. On Mon, Feb 16, 2009 at 12:43 PM, jfmxl wrote: > > Hi again, > > How do I handle multifield keys? > > I have multifield primary keys which are in turn used as foreign keys > in other tables. > >

Re: Form wizard back button

2009-02-16 Thread alain D.
anyone? --~--~-~--~~~---~--~~ 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

Re: Automated Translation Management -- Surely someone has already done this?

2009-02-16 Thread ville
The django-rosetta app might help you: http://code.google.com/p/django-rosetta/ It allows easy online editing of the po/mo files. -ville On Feb 16, 9:47 am, DrMeers wrote: > I have developed a Django site for an open source project, with > contributors around the globe. > >

Re: Authentication/access check when serving static media thru Apache/nginx

2009-02-16 Thread Graham Dumpleton
On Feb 16, 9:53 pm, "proteus...@gmail.com" wrote: > The way to do this is by utilizing nginx as a reverse proxy for your > dynamic django (presumably apache) server and a peer media server > (presumably another nginx setup). Nginx has a great feature (as does > lighttpd)

Re: load huge dataset through fixtures

2009-02-16 Thread Russell Keith-Magee
On Mon, Feb 16, 2009 at 7:42 PM, Konstantin S wrote: > > Hello! > > I am trying to load really huge dataset (contains millions of records) > into database through fixtures and it seems that django loads entire > data into memory before commiting it into db so python process

Re: Authentication/access check when serving static media thru Apache/nginx

2009-02-16 Thread proteus...@gmail.com
The way to do this is by utilizing nginx as a reverse proxy for your dynamic django (presumably apache) server and a peer media server (presumably another nginx setup). Nginx has a great feature (as does lighttpd) where you can have your page request come into django and perform all the

load huge dataset through fixtures

2009-02-16 Thread Konstantin S
Hello! I am trying to load really huge dataset (contains millions of records) into database through fixtures and it seems that django loads entire data into memory before commiting it into db so python process dies out of memory. Am I right that the only possible solution in my case is not to

RE: Admin hangs while updating a modified, repopulated model [update]

2009-02-16 Thread haestan none
Sorry, it looks like I had a wrong assumption in my original question. The server seems to hang as soon as I try to update a model with an URLField that is set to 'http://localhost:8000' (this is where the built-in webserver is running). Is this a bug or can't Django validate an URLField to

Admin hangs while updating a modified, repopulated model

2009-02-16 Thread haestan none
Hi, I have a strange problem while editing a modified model in the admin. Whenever I change my models I usually issue the following commands to change the model and repopulate my data: # ./manage.py dumpdata --indent=4 redir > old_data.json -> do the model changes # ./manage.py reset redir #

Re: Authentication/access check when serving static media thru Apache/nginx

2009-02-16 Thread Ales Zoulek
You can write apache auth module in python, which is calling your external (django) code. It's not exactly Django issue. Maybe this blog post could help you http://www.thoughtspark.org/node/25 A. On Mon, Feb 16, 2009 at 10:44 AM, MrMuffin wrote: > > I`m using django

Re: Add views to admin interface

2009-02-16 Thread Ales Zoulek
> Once you have added a new HTML link to the template that will trigger > your view, you have to write a view for it. You add something to one of > your URL Conf files to catch the URL (do this *before* any admin > patterns are processed, so that your pattern is handled first) and send > it off

Authentication/access check when serving static media thru Apache/nginx

2009-02-16 Thread MrMuffin
I`m using django to develop something similar to flickr, a site for photo-sharing. Photos can be public, need authentication or be personal and not available for anyone but the owner. Serving static data using django is not optimal, but how can I control access like this when serving static media

Keys composed of multiple fields

2009-02-16 Thread jfmxl
Hi again, How do I handle multifield keys? I have multifield primary keys which are in turn used as foreign keys in other tables. My database backend is MySQL if that makes a difference. --~--~-~--~~~---~--~~ You received this message because you are subscribed

Re: InnoDB tables for MySQL

2009-02-16 Thread jfmxl
On Feb 16, 2:24 pm, Alex Gaynor wrote: > On Mon, Feb 16, 2009 at 1:37 AM, jfmxl wrote: > > > Hi, > > > I read through the tutorials and thank you very much! They are well > > designed and very helpful. > > > I noticed that the models' database definitions

Negative value in forms.Integerfield throws TypeError

2009-02-16 Thread coan
I'm validating a form, and use forms.IntegerField(min_value=0,). If I submit a -1 value in that field, it throws a TypeError: not all arguments converted during string formatting. How come it doesn't raise a forms.ValidationError, and how should I catch a negative value in this field?

Re: Supported Django version of Googale app engine

2009-02-16 Thread nivhab
Thanks! On Feb 16, 10:51 am, Jarek Zgoda wrote: > Wiadomość napisana w dniu 2009-02-16, o godz. 08:32, przez nivhab: > > > Does anyone know if Django 1.0 is already supported out-of-the-box on > > the Google app engine? > > Yes. It is not included, though. > >

  1   2   >