Re: adding a summary field to a model

2010-08-19 Thread djnubbio
yes you are right. Howto? On 19 Ago, 17:47, Mathieu Leduc-Hamel wrote: > But by the way you field seem to be a sum of some others, maybe it should > not be a new field but just a new method returing the resulting calculation > depending of the attributes of your instance. No ? > > On Thu, Aug 19,

Re: adding a summary field to a model

2010-08-19 Thread djnubbio
in fact I DO NOT want denormilize On 19 Ago, 16:56, bruno desthuilliers wrote: > On 19 août, 16:25, Nick wrote: > > > You need to look at overriding the model's save method in order to add > > data from one field to another dynamically. > > Useless denormalization (until proved otherwise of cour

Re: adding a summary field to a model

2010-08-19 Thread djnubbio
Hu, denormalizing...it isn't best solution On 19 Ago, 16:25, Nick wrote: > You need to look at overriding the model's save method in order to add > data from one field to another dynamically. > > http://docs.djangoproject.com/en/dev/topics/db/models/#overriding-mod... > > On Aug 19, 2:03 am,

Re: adding a summary field to a model

2010-08-19 Thread djnubbio
tank very much, widoyo. It was what i was looking for...and It works. On 20 Ago, 00:32, widoyo wrote: > Try to add function 'quota_ore' below. > > On Aug 19, 3:03 am, djnubbio wrote:> Sorry for > wasting your preciuose time. I'm very newby in django. > > > I have de following > > > class Comme

Re: What's the best practice for initializing the state of the server?

2010-08-19 Thread Javier Guerra Giraldez
On Thu, Aug 19, 2010 at 9:45 PM, buddhasystem wrote: > Thank you! I actually had something less fancy in mind, like initializing > data structures (possibly from a file), when the server is starts. > Basically, looking for "init" handle. point is, in a 'shared nothing' architecture, you don't kno

Re: What's the best practice for initializing the state of the server?

2010-08-19 Thread buddhasystem
Thank you! I actually had something less fancy in mind, like initializing data structures (possibly from a file), when the server is starts. Basically, looking for "init" handle. hcarvalhoalves wrote: > > If it's loading data on model's tables, you can use fixtures: > > http://docs.djangoproj

Re: streaming out to a client using wsgi

2010-08-19 Thread hcarvalhoalves
Check this post: http://metalinguist.wordpress.com/2008/02/12/django-file-and-stream-serving-performance-gotcha/ On 19 ago, 15:27, "Henrik Genssen" wrote: > Hi, > > I read in the wsgi docs, that it is possible to stream data to a client e.g. > from a file stream like a pdf. > Can someone point

Re: How does Django handle auto-increment PK when a model is sharded horizontally into multiple databases?

2010-08-19 Thread Russell Keith-Magee
On Fri, Aug 20, 2010 at 9:57 AM, hcarvalhoalves wrote: > On 19 ago, 22:03, Russell Keith-Magee wrote: >> The instance will exist, but the author_id won't. Unless you are >> manually allocating the primary key, the primary key is allocated by >> the database at the time of object save, which means

Re: What's the best practice for initializing the state of the server?

2010-08-19 Thread hcarvalhoalves
If it's loading data on model's tables, you can use fixtures: http://docs.djangoproject.com/en/dev/howto/initial-data/ Because it's also possible to define SQL files to run on syncdb, you can also run SQL-specific tasks (like defining functions, full text search indexes, etc...). If the your oth

Re: How does Django handle auto-increment PK when a model is sharded horizontally into multiple databases?

2010-08-19 Thread hcarvalhoalves
On 19 ago, 22:03, Russell Keith-Magee wrote: > The instance will exist, but the author_id won't. Unless you are > manually allocating the primary key, the primary key is allocated by > the database at the time of object save, which means you won't be able > to determine the primary key until *afte

Re: How does Django handle auto-increment PK when a model is sharded horizontally into multiple databases?

2010-08-19 Thread Russell Keith-Magee
On Fri, Aug 20, 2010 at 6:48 AM, Andy wrote: > > > On Aug 19, 9:28 am, Russell Keith-Magee > wrote: > > >> You've got the right idea, but the implementation you provide probably >> won't be comprehensive enough in practice. The hint is any extra >> information that will help you determine the rig

What's the best practice for initializing the state of the server?

2010-08-19 Thread buddhasystem
I need to initialize a few data structures and potentially do other set-up as needed, only when the Django server comes up. What's the optimal way of doing that? -- View this message in context: http://old.nabble.com/What%27s-the-best-practice-for-initializing-the-state-of-the-server--tp2948784

Re: Bind variables in Oracle backend - how to use them?

2010-08-19 Thread Ian
On Aug 19, 11:58 am, Tim Sawyer wrote: > No, I don't think you're mistaken, especially if you want to use hints. > > I tried this code again today with the django database connection (using > 1.2 final), and it didn't work.  This only works with cx_Oracle connections. > > Seehttp://drumcoder.co.uk

Re: Using databrowse with a different ORM?

2010-08-19 Thread Brianna Laugher
On Aug 20, 3:39 am, James Chiang wrote: > Hi, > > I'm new to django too, but I was able to define models for a legacy > database and specifying the primary keys using "primary_key=True". > Our tables have composite PKs, so I just added that option for all the > columns that were appropriate.  I do

Re: How does Django handle auto-increment PK when a model is sharded horizontally into multiple databases?

2010-08-19 Thread Andy
On Aug 19, 9:28 am, Russell Keith-Magee wrote: > You've got the right idea, but the implementation you provide probably > won't be comprehensive enough in practice. The hint is any extra > information that will help you determine the right database to use; > there's no guarantee that the insta

Re: adding a summary field to a model

2010-08-19 Thread widoyo
Try to add function 'quota_ore' below. On Aug 19, 3:03 am, djnubbio wrote: > Sorry for wasting your preciuose time. I'm very newby in django. > > I have de following > > class Commessa(models.Model): >     commessa = models.CharField(max_length=20) >      quota_oraria=models.DecimalField(max_digi

[Really solved] Re: NoReverseMatch under mod_wsgi with custom admin.get_urls()

2010-08-19 Thread ringemup
Sorry for the spam, but just wanted to note that I'd solved the problem. I was using the wrong method of namespacing. The following worked properly: rev = reverse('staff_admin:account_wizard') I'm wondering if there's a better way to demonstrate the usage in the docs. On Aug 19, 4:48 pm, ringe

Re: NoReverseMatch under mod_wsgi with custom admin.get_urls()

2010-08-19 Thread ringemup
And on third review, it only solves the issue in the templates. In any view that is not an AdminSite method, this line throws a NoReverseMatch error: rev = reverse('account_wizard', current_app='staff_admin') On Aug 19, 4:39 pm, ringemup wrote: > Never mind, namespacing the reverse() calls and

[Solved] Re: NoReverseMatch under mod_wsgi with custom admin.get_urls()

2010-08-19 Thread ringemup
Never mind, namespacing the reverse() calls and {% url %} tags seems to have fixed things. On Aug 19, 4:32 pm, ringemup wrote: > I'm using a custom admin.get_urls() method.  It was working flawlessly > on the development server, but now under mod_wsgi I'm getting > NoReverseMatch errors almost an

NoReverseMatch under mod_wsgi with custom admin.get_urls()

2010-08-19 Thread ringemup
I'm using a custom admin.get_urls() method. It was working flawlessly on the development server, but now under mod_wsgi I'm getting NoReverseMatch errors almost anywhere I try to reverse the URL patterns it adds (but not everywhere). Here's the method: class CustomAdminSite(AdminSite):

Re: Fixtures for Groups and Permissions

2010-08-19 Thread ringemup
How would you implement that for a contrib app? Model inheritance? Proxy models? On Aug 19, 4:12 pm, Shawn Milochik wrote: > It sounds like a job for natural keys. > > http://docs.djangoproject.com/en/dev/releases/1.2-alpha-1/#natural-ke... > > Shawn -- You received this message because you a

Re: Fixtures for Groups and Permissions

2010-08-19 Thread Shawn Milochik
It sounds like a job for natural keys. http://docs.djangoproject.com/en/dev/releases/1.2-alpha-1/#natural-keys-in-fixtures Shawn -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com

Fixtures for Groups and Permissions

2010-08-19 Thread ringemup
Since permissions are created with different IDs each time you install a project with syncdb, it's not possible to use fixtures to freeze usergroup permission. Is there any way to export Groups with assigned permissions that can be easily imported as part of the installation process? Thanks --

admin login problems and 'ValidationError: [u'ManagementForm data is missing or has been tampered with'] '

2010-08-19 Thread bax...@gretschpages.com
I'm having a lot of staff users having login problems. Until today, it was only IE, but today I saw it happen to a user on FF as well. The basic flow is like this: They try to login to the admin. It appears to work. When they click anywhere, it goes back to the admin login. This repeats several ti

streaming out to a client using wsgi

2010-08-19 Thread Henrik Genssen
Hi, I read in the wsgi docs, that it is possible to stream data to a client e.g. from a file stream like a pdf. Can someone point me to an example for django? It does not make sens to put all outgoing data in a var in memory when I could do streaming... regards Henrik Henrik Genssen h...@mia

Re: Bind variables in Oracle backend - how to use them?

2010-08-19 Thread buddhasystem
Hello there, I'm 90% sure that you can't get the cx cursor out of Django connection. These are similar but different classes. I tried something like that. Thanks for pointing me to sqlalchemy. Ultimately, the queries I intend to run are so laden with hints and binds, that it's almost easier to do

Re: Displaying images

2010-08-19 Thread Greg Pelly
Are your settings properly set up? Can you confirm that you are able to print settings.MEDIA_URL in your view? MEDIA_URL defaults to the empty string, so that seems like the problem. Then, pass in the request context as I described previously. >From http://docs.djangoproject.com/en/dev/ref/templ

Re: Using databrowse with a different ORM?

2010-08-19 Thread James Chiang
Hi, I'm new to django too, but I was able to define models for a legacy database and specifying the primary keys using "primary_key=True". Our tables have composite PKs, so I just added that option for all the columns that were appropriate. I don't know whether django does anything with the compo

Re: Bind variables in Oracle backend - how to use them?

2010-08-19 Thread Tim Sawyer
No, I don't think you're mistaken, especially if you want to use hints. I tried this code again today with the django database connection (using 1.2 final), and it didn't work. This only works with cx_Oracle connections. See http://drumcoder.co.uk/blog/2010/apr/23/output-parameters-cx_oracle

Re: Displaying images

2010-08-19 Thread Bradley Hintze
Greg, that didn't do it :( Thanks though :) On Thu, Aug 19, 2010 at 1:43 PM, Greg Pelly wrote: > try this: > def math_form(request): >   return render_to_response('form.html', > {}, context_instance=RequestContext(request)) > > greg > On Thu, Aug 19, 2010 at 10:35 AM, Bradley Hintze > wrote: >>

Re: Displaying images

2010-08-19 Thread Greg Pelly
try this: def math_form(request): return render_to_response('form.html', {}, context_instance=RequestContext(request)) greg On Thu, Aug 19, 2010 at 10:35 AM, Bradley Hintze < bradle...@aggiemail.usu.edu> wrote: > I am sorry. I am using render to response. > > #view.py > > def math_form(reque

Re: Displaying images

2010-08-19 Thread Bradley Hintze
I am sorry. I am using render to response. #view.py def math_form(request): return render_to_response('form.html') #base.html {% block title %}{% endblock %} {% block header %}{% endblock %} Please enter two numbers to add them. {% block content %}{% endblock %} {

Re: HttpResponse.delete_cookie() gives me an error

2010-08-19 Thread Dane Larsen
Well, regardless, it works if you convert it to a str first. Thanks for the help! On Thu, Aug 19, 2010 at 11:02 AM, Rolando Espinoza La Fuente < dark...@gmail.com> wrote: > On Thu, Aug 19, 2010 at 12:14 PM, Dane Larsen > wrote: > [...] > > I then tried: > > response.delete_cookie(key=str(co

Re: Displaying images

2010-08-19 Thread Javier Guerra Giraldez
On Thu, Aug 19, 2010 at 12:03 PM, Bradley Hintze wrote: > So do I create 'my_data_dictionary'? and whats in there? are you using render_to_response()? can't comment on your code if you don't show it -- Javier -- You received this message because you are subscribed to the Google Groups "Djan

Re: Displaying images

2010-08-19 Thread Bradley Hintze
So do I create 'my_data_dictionary'? and whats in there? On Thu, Aug 19, 2010 at 12:54 PM, Steve Holden wrote: > On 8/19/2010 12:29 PM, Bradley Hintze wrote: >> I am sorry. How does this 'Context' object(?) relate to displaying an >> image? Your last though me for a loop. >> > The context is what

Re: Updating user's unique e-mail

2010-08-19 Thread aa56280
> Is best practice to do this from a custom user profile? I have an > avatar imageField which will be editable as well. Well, the first name, last name and e-mail fields are part of the User model so you wouldn't need a profile model for that. As for the avatar, yes, that would have to go in that

Re: HttpResponse.delete_cookie() gives me an error

2010-08-19 Thread Rolando Espinoza La Fuente
On Thu, Aug 19, 2010 at 12:14 PM, Dane Larsen wrote: [...] > I then tried: >     response.delete_cookie(key=str(color_id)) > and it worked fine. > Should I report this as a bug? Cookie.Morsel does not handle unicode strings, mainly because string.translate expects two arguments where unicode.tran

Cannot connect to development server on windows

2010-08-19 Thread cwurld
I am using django 1.1 on windows XP. I run the development server from the command line. Most of the time things work fine. But at seemly random times, I can no longer connect to the development server. On chrome, I get: "Oops! This link appears to be broken." with other browsers, I get similar

Re: Displaying images

2010-08-19 Thread Steve Holden
On 8/19/2010 12:29 PM, Bradley Hintze wrote: > I am sorry. How does this 'Context' object(?) relate to displaying an > image? Your last though me for a loop. > The context is what provide the variables that become available for use inside curly braces in the template. The render_to_response() func

Re: Displaying images

2010-08-19 Thread Bradley Hintze
I am sorry. How does this 'Context' object(?) relate to displaying an image? Your last though me for a loop. On Thu, Aug 19, 2010 at 12:11 PM, Javier Guerra Giraldez wrote: > On Thu, Aug 19, 2010 at 10:49 AM, Bradley Hintze > wrote: >> >> ... >> >> so it looks as if you're right, the template i

Re: HttpResponse.delete_cookie() gives me an error

2010-08-19 Thread Dane Larsen
Ahh. Problem solved. I was calling: response.delete_cookie(key=color_id) color_id was a string. When I did this: for key in request.COOKIES.keys(): if key == color_id: response.delete_cookie(key=key) It worked. It seems that passing a unicode string rather than a python string

Re: adding a summary field to a model

2010-08-19 Thread tsmets
You replied faster than me Mathieu :) It looks the easiest solution unless the SUM is potentially heavy on the system... There are of course other means to circumvent the issue but it going further & further in the denormalization process (it is not an issue per se ... you just have to be aware of

Re: Displaying images

2010-08-19 Thread Javier Guerra Giraldez
On Thu, Aug 19, 2010 at 10:49 AM, Bradley Hintze wrote: > > ... > > so it looks as if you're right, the template isn't gettng the > MEDIA_URL variable. > I thought this was taken care of in setttings.py (see previous > messages). Does something need to be done in url.py? no, it's done on a cont

Re: Generic Relations: questions

2010-08-19 Thread tsmets
The more generic is yr model, the more you will find these. and of course these join tables can grow exponentially ! What you can do is add extra fields to navigate faster or allow partitioning of the table (it helps but not in all circumstances) IMHO Unless you are working for Yahoo/Google/FB/...

Re: Displaying images

2010-08-19 Thread Bradley Hintze
Ok, I appreciate your patiencce! here what the generated HTML loos like ... ... so it looks as if you're right, the template isn't gettng the MEDIA_URL variable. I thought this was taken care of in setttings.py (see previous messages). Does something need to be done in url.py? On Thu, Aug 19,

Re: adding a summary field to a model

2010-08-19 Thread Mathieu Leduc-Hamel
But by the way you field seem to be a sum of some others, maybe it should not be a new field but just a new method returing the resulting calculation depending of the attributes of your instance. No ? On Thu, Aug 19, 2010 at 4:56 PM, bruno desthuilliers < bruno.desthuilli...@gmail.com> wrote: > O

Re: Displaying images

2010-08-19 Thread Javier Guerra Giraldez
On Thu, Aug 19, 2010 at 10:28 AM, Bradley Hintze wrote: > Javier > > Unfortunately, changing the quotes as you explained did not work. likely the template isn't gettng the MEDIA_URL variable. if you show the generated HTML it would be easier to help -- Javier -- You received this message be

Re: Displaying images

2010-08-19 Thread Bradley Hintze
Javier Unfortunately, changing the quotes as you explained did not work. Bradley On Thu, Aug 19, 2010 at 11:15 AM, Javier Guerra Giraldez wrote: > On Thu, Aug 19, 2010 at 10:00 AM, Bradley Hintze > wrote: >> > > you got the quotes wrong: > > > > -- > Javier > > -- > You received this message

Re: Context processor

2010-08-19 Thread Pep
Well, I have an argument in my url : http://www.mysite.com/city This url call the view home I have another urls like this : http://www.mysite.com/city http://www.mysite.com/city/category1 which call the view category1 http://www.mysite.com/city/category2 which call the view category2 etc. In ea

Re: NoReverseMatch error when attempting to spawn an intermediate window from an admin action

2010-08-19 Thread Guy
I realize that I must have hit reply to author earlier. But thank you again (and more publicly) for the help. This definitely gets me started. Guy On Aug 19, 5:25 am, Daniel Roseman wrote: > On Aug 19, 9:16 am, Guy wrote: > > > > > I am having trouble with learning to use httpresponseredirect

Re: Displaying images

2010-08-19 Thread Bradley Hintze
By broken I mean i get the little square 'boren image' symbol (I am not sure the official name, sorry I can't be more specific). What do you mean by 'MEDIA_URL isn't being included in the request context.' do I deed to do something in url.py and/or views.py for my media files? On Thu, Aug 19, 2010

Re: Displaying images

2010-08-19 Thread Javier Guerra Giraldez
On Thu, Aug 19, 2010 at 10:00 AM, Bradley Hintze wrote: > you got the quotes wrong: -- Javier -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this gro

Re: per-object permission

2010-08-19 Thread Наталя Триф'як
Hello! One more good link http://groups.google.com/group/django-authority/browse_thread/thread/59ef512046ad41b3 -- netik -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To un

Re: Displaying images

2010-08-19 Thread Steve Holden
On 8/19/2010 11:00 AM, Bradley Hintze wrote: > Hi all, > > I am trying to display an image but cant get it up. I tried google > searches and tried what was suggested with no luck. i am a newbie > running the local server. Here is my code: > > #settings.py > ... > MEDIA_ROOT = '/Users/bradleyhintz

Displaying images

2010-08-19 Thread Bradley Hintze
Hi all, I am trying to display an image but cant get it up. I tried google searches and tried what was suggested with no luck. i am a newbie running the local server. Here is my code: #settings.py ... MEDIA_ROOT = '/Users/bradleyhintze/djcode/my_try/media/' MEDIA_URL = 'media/' ... base.html ...

Re: adding a summary field to a model

2010-08-19 Thread bruno desthuilliers
On 19 août, 16:25, Nick wrote: > You need to look at overriding the model's save method in order to add > data from one field to another dynamically. Useless denormalization (until proved otherwise of course...). -- You received this message because you are subscribed to the Google Groups "Dja

Re: adding a summary field to a model

2010-08-19 Thread Nick
You need to look at overriding the model's save method in order to add data from one field to another dynamically. http://docs.djangoproject.com/en/dev/topics/db/models/#overriding-model-methods On Aug 19, 2:03 am, djnubbio wrote: > Sorry for wasting your preciuose time. I'm very newby in dja

Re: adding a summary field to a model

2010-08-19 Thread bruno desthuilliers
On 19 août, 09:03, djnubbio wrote: > Sorry for wasting your preciuose time. I'm very newby in django. > > I have de following > > class Commessa(models.Model): >     commessa = models.CharField(max_length=20) >      quota_oraria=models.DecimalField(max_digits=5, decimal_places=2) >   ... > > class

Re: Context processor

2010-08-19 Thread bruno desthuilliers
On 19 août, 11:31, Pep wrote: > Thanks for your help. > > This is my code : > > def custom_proc(request): >     "A context processor that provides 'authForm'" > >     return { >         'authForm' : authForm, >         'event': event >     } Where do these authForm and event come from ??? > def

Updating user's unique e-mail

2010-08-19 Thread reduxdj
So, I am getting into user profiles in django, I want the user to be able to update their name and email. Is best practice to do this from a custom user profile? I have an avatar imageField which will be editable as well. Any suggestions on this please? -- You received this message because you

Re: Context processor

2010-08-19 Thread bruno desthuilliers
On 19 août, 10:30, Daniel Roseman wrote: > > Context processors are automatically applied to all views Sorry but this is plain wrong. Context processors are automatically applied to all RequestContext instances - which is note quite the same thing. http://docs.djangoproject.com/en/dev/ref/templa

Re: django and php

2010-08-19 Thread bruno desthuilliers
On 19 août, 11:01, Imad Elharoussi wrote: > You said that we must not think in a PHP way while using django > > can you please give me a solution to my problem > > I have to connect every minute to a server and get an object from it an show > the modifications > > can you please tell me what djang

Appengine - Forms from different classes same page

2010-08-19 Thread xerife
I'm doing a program for teachers fill out a form with their CV. After filling out the form it should be possible to print to PDF. Obviously the form has to be on the same page. I have a model with relationship one2many, with teachers, experience, distribution service, etc.. I haven´t seen so far

Re: How does Django handle auto-increment PK when a model is sharded horizontally into multiple databases?

2010-08-19 Thread Russell Keith-Magee
On Thu, Aug 19, 2010 at 7:06 PM, Andy wrote: > I have a model Tweet that I'd like to shard horizontally based on the > tweet author's id. > > class Tweet(models.Model): >    author_id = models.IntegreField() >    text = models.TextField() > > > Let's say I set up 3 databases: shard0, shard1, shard

Re: CSRF verification failures (admin)

2010-08-19 Thread Aspontus
Thanks for help. I've found the old template. I've asked server administrator to remove it and now it works. Best regards On 19 Sie, 13:06, Karen Tracey wrote: > On Thu, Aug 19, 2010 at 5:33 AM, Aspontus wrote: > > It seems I haven't expressed myself clearly enough. > > The template django/contr

Re: CSRF verification failures (admin)

2010-08-19 Thread Karen Tracey
On Thu, Aug 19, 2010 at 5:33 AM, Aspontus wrote: > It seems I haven't expressed myself clearly enough. > The template django/contrib/admin/templates/admin/auth/user/ > change_password.html You point me to is rendered when I use the > password change form from user change form. > The one that seem

How does Django handle auto-increment PK when a model is sharded horizontally into multiple databases?

2010-08-19 Thread Andy
I have a model Tweet that I'd like to shard horizontally based on the tweet author's id. class Tweet(models.Model): author_id = models.IntegreField() text = models.TextField() Let's say I set up 3 databases: shard0, shard1, shard2 I'd like to take the tweet author's id, do a modulo 3 an

Re: connect to database from template

2010-08-19 Thread Imad Elharoussi
thank you for your help but I find a solution I'm using jquery to connect to a server 2010/8/19 Mathieu Leduc-Hamel > You have to forget the php when you code something in Python and Django. > > The process doesn't fallow the same way it does in PHP. > > It's complete new world (and a more beaut

Re: connect to database from template

2010-08-19 Thread Mathieu Leduc-Hamel
You have to forget the php when you code something in Python and Django. The process doesn't fallow the same way it does in PHP. It's complete new world (and a more beautiful and peaceful one i think). Your connection will be keep alive, don't worry about that. What do you mean by connection ? T

Re: CSRF verification failures (admin)

2010-08-19 Thread Aspontus
It seems I haven't expressed myself clearly enough. The template django/contrib/admin/templates/admin/auth/user/ change_password.html You point me to is rendered when I use the password change form from user change form. The one that seems to be missing CSRF token is rendered when I try to change p

Re: django and php

2010-08-19 Thread Xavier Ordoquy
Hi, Do you mean that you have to refresh the user browser page every minute or that every minute your website application has to pull another information system ? In either case, I hardly see the connection between your issue and the fact that Django has nothing to do with thinking in PHP. PHP i

Re: Context processor

2010-08-19 Thread Pep
Thanks for your help. This is my code : def custom_proc(request): "A context processor that provides 'authForm'" return { 'authForm' : authForm, 'event': event } def home(request, city): paginator = Paginator(Event.objects.all(), 5) try: page = int(re

Using databrowse with a different ORM?

2010-08-19 Thread Brianna Laugher
Hi, I have a read-only Oracle database that I'd like to use Django's databrowse to, well, browse. However Django's primary key requirement, along with my database being read-only, means I can't use Django's default models and DB handling. If I use something else like SQLAlchemy, so that I can spe

Re: NoReverseMatch error when attempting to spawn an intermediate window from an admin action

2010-08-19 Thread Daniel Roseman
On Aug 19, 9:16 am, Guy wrote: > I am having trouble with learning to use httpresponseredirect and > reverse. > I am trying to generate an admin action on a selection of a list of > items. The purpose is to generate an intermediate window that can be > used to select a new > status for all the obj

Re: django and php

2010-08-19 Thread Sithembewena Lloyd Dube
Here's a point to start from. This documentation contains all you need to know to get started with Django. http://docs.djangoproject.com/en/1.2/ On Thu, Aug 19, 2010 at 11:01 AM, Imad Elharoussi wrote: > > You said that we must not think in a PHP way while using django > > can you please give m

Re: django and php

2010-08-19 Thread Sithembewena Lloyd Dube
As stated by others above, look at the tutorial first. Install Django and build the sample poll app. It will show you how Django works and from there you can try any customisations that you have in mind. On Thu, Aug 19, 2010 at 11:08 AM, Mathieu Leduc-Hamel wrote: > Have you took a look at the

Re: Context processor

2010-08-19 Thread Daniel Roseman
On Aug 19, 9:53 am, Pep wrote: > Sorry ! The matter was I believed that an object was in my > context_processor and it wasn't. > > So, I have a new problem which also concern context_processors. Is it > possible to give an argument in a context_processor. > > For example, I have a context_processo

Re: django and php

2010-08-19 Thread Mathieu Leduc-Hamel
Have you took a look at the tutorial on the django webpage ? It's a must to read before doing anything with django. After that i can propose to you a solution: If i was you i would code 2 views One for the rendering on the page One as ajax view The first one would use the javascript to reload s

django and php

2010-08-19 Thread Imad Elharoussi
You said that we must not think in a PHP way while using django can you please give me a solution to my problem I have to connect every minute to a server and get an object from it an show the modifications can you please tell me what django give as solution to this thank you -- You received

Re: Context processor

2010-08-19 Thread Pep
Sorry ! The matter was I believed that an object was in my context_processor and it wasn't. So, I have a new problem which also concern context_processors. Is it possible to give an argument in a context_processor. For example, I have a context_processor view context : def context(request): I hav

Re: connect to database from template

2010-08-19 Thread Imad Elharoussi
In my view.py I did this but I don't know how to make the connection to the server permanent 2010/8/18 Renne Rocha > You have to do a view that handle the action of getting the content > of the treeview... > > It seems you don't know how Django works. Take a look at the > tutorial first. Don'

Re: Context processor

2010-08-19 Thread Daniel Roseman
On Aug 19, 8:42 am, Pep wrote: > Hi everybody, > > I would like to use the context processor I wrote with my registration > views. But I don't see how to do it without changing the registration > views ? Somebody has an idea ? > > Thanks ! > > PEP Context processors are automatically applied to a

NoReverseMatch error when attempting to spawn an intermediate window from an admin action

2010-08-19 Thread Guy
I am having trouble with learning to use httpresponseredirect and reverse. I am trying to generate an admin action on a selection of a list of items. The purpose is to generate an intermediate window that can be used to select a new status for all the objects, The admin action shows up in the pull

Re: CSRF verification failures (admin)

2010-08-19 Thread Matthias Runge
On 19/08/10 09:32, PieterB wrote: > I'm doing none of the above. > I just deployed django 1.2 on python 2.4 on RHEL > no changes in the admin code... > Maybe It's due to some plugin in Firefox ? I will test again with > another plugin showing my session/POST variables :-) > I've seen some strange

Re: lightning talks at djangocon

2010-08-19 Thread Russell Keith-Magee
On Thu, Aug 19, 2010 at 3:44 PM, mack the finger wrote: > i submitted two talk proposals for djangocon, but neither was > accepted. I can easily condense both topics into 5 minute > presentations. I have never attended a "con" such as djangocon, so > forgive me. How do lightning talks work? Do you

lightning talks at djangocon

2010-08-19 Thread mack the finger
i submitted two talk proposals for djangocon, but neither was accepted. I can easily condense both topics into 5 minute presentations. I have never attended a "con" such as djangocon, so forgive me. How do lightning talks work? Do you "sign up" to do one right before the lightning talk session, or

Context processor

2010-08-19 Thread Pep
Hi everybody, I would like to use the context processor I wrote with my registration views. But I don't see how to do it without changing the registration views ? Somebody has an idea ? Thanks ! PEP -- You received this message because you are subscribed to the Google Groups "Django users" gr

Re: CSRF verification failures (admin)

2010-08-19 Thread PieterB
On Aug 19, 2:09 am, Russell Keith-Magee wrote: >  * Your TEMPLATE_DIRS setting is pointing to a directory with pre-1.2 > templates >  * Your Django install is running pre-1.2 code, or using stale pyc > files (which might mean you're loading templates from the wrong app > directory) >  * You have

adding a summary field to a model

2010-08-19 Thread djnubbio
Sorry for wasting your preciuose time. I'm very newby in django. I have de following class Commessa(models.Model): commessa = models.CharField(max_length=20) quota_oraria=models.DecimalField(max_digits=5, decimal_places=2) ... class Diario(models.Model): data= models.DateField('da