Django Multilingual Model

2011-01-31 Thread Alagu Madhu
Hi I am looking best model for the following tables: - ---Table : groups_t - CREATE TABLE groups_t ( id BIGINT NOT NULL, code VARCHAR NOT NULL, version BIGINT NOT NULL ); - ---Table : groups_i18n_t - CREATE TABLE groups_i18n_t ( group_id BIGINT NOT NULL,

Re: pyodbc & FreeTDS: Can I work with NVARCHAR column on MSSQL2008

2011-01-31 Thread Adnan Sadzak
This is how Your FreeTDS config should look like: ;-- [mssql2008] host = 10.0.0.61 port = 1433 tds version = 7.0 ;-- Here is the code with pymssql: #-- import pymssql conn = pymssql.connect(host='mssql2008', user='erp',

Re: mis-named setting? SESSION_EXPIRE_AT_BROWSER_CLOSE

2011-01-31 Thread Jani Tiainen
On Monday 31 January 2011 18:38:20 Tim Sawyer wrote: > > You can't stop the user from closing the browser, or switching to another > > tab, with JS. And you shouldn't try to stop them navigating away - this > > sort of thing is only likely to annoy them intensely. > > Taking this to the extreme -

Re: ImportError importing forms.py into models.py

2011-01-31 Thread Ivo Brodien
if you have circular imports, you can try to put the name of the model. This at least works for Foreign Keys http://docs.djangoproject.com/en/dev/ref/models/fields/#foreignkey On 01.02.2011, at 00:34, Jeffrey Stiles wrote: > I would really like to make a form instance a model attribute so

Re: pyodbc & FreeTDS: Can I work with NVARCHAR column on MSSQL2008

2011-01-31 Thread Orgil
> Hi, > I have expirience with pymssql and mssql server, and that works fine > (utf-8). > Did You try utf-8? I think that I have tried pymssql using charsets including utf-8, utf-16, iso-. But I have no luck there. I can not get unicode datas. Also, I have read that pymssql does not support

Re: working django with existing database

2011-01-31 Thread Jani Tiainen
On Monday 31 January 2011 18:21:40 Ian wrote: > On Jan 31, 3:29 am, arief nur andono wrote: > > oh please... > > > > i need only to query the table, have no access to modified the table > > > > why there is no way query the database and then make the output as > >

Re: Storing *big* texts in db fields

2011-01-31 Thread Eric Chamberlain
Karen, In your use case, large text fields shouldn't be a problem. I would install the django-toolbar and use the reporting to determine if a particular query or template is causing the slowdown. Are you displaying the large text field in the admin list view? If you are and the view

ImportError importing forms.py into models.py

2011-01-31 Thread Jeffrey Stiles
I would really like to make a form instance a model attribute so that i have access to the form from the template through an object that I have handy. When I try to import import any form into models.py, I get an ImportError on each of the import statements in the forms.py file which reference a

Re: Storing *big* texts in db fields

2011-01-31 Thread Andre Terra
I'm not really experienced, but my approach would be to reference files in some open format in the DB and use python to edit open/edit/save them. Sounds leaner, cleaner, faster, imho. Sincerely, André Terra On Mon, Jan 31, 2011 at 23:22, Karen McNeil wrote: > I've

Styling help_text

2011-01-31 Thread Scot Hacker
This ticket http://code.djangoproject.com/ticket/8426 says that, as of six months ago, model field help_text rendered in forms by {{form.as_p}} gets wrapped in a style-able span. But in Django 1.2.4, {{form.as_p}} still generates unspanned help_text. It also doesn't show up spanned in the docs:

Storing *big* texts in db fields

2011-01-31 Thread Karen McNeil
I've created an application to manage texts, storing the content in a TextField, along with metadata in other fields. Now that I've completed the model and started actually adding the texts, the admin is getting vey slow. The app is just for the use of me and my team, so the slowness is not a

Configuration for Nginx and staticfiles

2011-01-31 Thread Victor Hooi
Hi, I'm using Django 1.3 and the included staticfiles app to handle my static media, and Nginx as the webserver. It's currently working, but I have a feeling my paths are more complex than they need to be. I was wondering if anybody could perhaps point out a better way to config this, or any

cascading create

2011-01-31 Thread Phlip
Djangoists: Given a model Tree with many Leaves, I want to write this: t = Tree(data=42) t.leaves.add(leafy_data=43) t.leaves.add(leafy_data=44) t.save() I want the save() to create the Tree, then create the leaves. Other notations would do fine. Batching like this might permit the ORM

Re: Django Admin select boxes

2011-01-31 Thread Bjorn Meyer
Thanks to both you and Tom. I suspected that I was going to have to use javascript in order to do this. I did find Dojo and Dajax that will hopefully lead me in the direction I need as well. Bjorn On Mon, Jan 31, 2011 at 10:39, Joel Goldstick wrote: > > > On Mon, Jan

PostgreSQL Conference East: CFP! (In NYC, you want to be there)

2011-01-31 Thread Joshua D. Drake
Following on the smashing success of PostgreSQL Conference West, PostgreSQL Conference West, The PostgreSQL Conference for Developers, End Users and Decision Makers, is being held at the Hotel Pennsylvania, in New York City from March 22nd through 25th 2011. Please join us in continuing to make

Re: Selecting related objects with condition

2011-01-31 Thread Michael
The easiest way would be to get a list of all closed work items, ordered by user: context['work'] = Work.objects.filter(whatever).order_by('user') {% for work_item in work %} {% ifchanged %}Display {{work_item.user}}{% endifchanged %} Display {{ work_item }} {% endfor %} --

Re: tutorial part 4: ImportError

2011-01-31 Thread screened
**some corrections from my previous post By "model" I mean "view" and in #1, index.html gets changed to poll_list.html Sorry! -- 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.

Re: tutorial part 4: ImportError

2011-01-31 Thread screened
Hi group, I've noticed a few things in the tutorial documentation for 1.2 on page * http://docs.djangoproject.com/en/1.2/intro/tutorial04/* under the section "Use generic views: Less code is better": 1. It instructs the user to rename both the *detail.html* and *list.html*pages to

Re: tutorial part 4: ImportError

2011-01-31 Thread screened
Ok, right after my last post the content seems to have been corrected! Nice! Please disregard my previous post. Thank you for the documentation update! -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: tutorial part 4: ImportError

2011-01-31 Thread screened
I accidentally previously sent this post just to Rob - sorry about that Rob! I know that this is a couple months old, but the documentation does seem to be incorrect. I am using 1.2.4, and am on the correct tutorial page (http://docs.djangoproject.com/en/1.2/intro/tutorial04/), and the import

Re: caching of Models (not the cache middleware)

2011-01-31 Thread Brian Craft
The behavior seems to have reverted after a couple days. I suspect that the connection to mysql is being renegotiated, during which it loses the autocommit setting. This seems like it should be a setting in django, so if it renegotiates it will set autocommit again. Another solution might be to

Re: ANN: Server upgrade on djangoproject.com

2011-01-31 Thread Eric Chamberlain
On Jan 31, 2011, at 9:15 AM, Shawn Milochik wrote: > > I was using my iPhone at the time. I probably should have checked it on a > desktop browser before replying to the thread. Sorry 'bout that. > On the iPhone, use two fingers to scroll to the cut-off text in the code box. -- Eric

Re: flatpages templatetags missing

2011-01-31 Thread Adi
I had my settings.py exactly like you suggested. I realized that the template tag loadflatpages is available in the Trunk, and not available in 1.2.3 or 1.2.4 I was confused because the documentation for 1.2.3 talks about the load flatpages tag (and there is a disclaimer there that says

Selecting related objects with condition

2011-01-31 Thread Martin Tiršel
Hello, I have a model: class Work(models.Model): ... user = models.ForeignKey( User ) closed = models.DateTimeField( blank=True ) ... Now, I want to print all users and for each user all Works closed between a specific date. If I don't need the

Re: Django Admin select boxes

2011-01-31 Thread Joel Goldstick
On Mon, Jan 31, 2011 at 12:06 PM, Tom Evans wrote: > On Mon, Jan 31, 2011 at 4:51 PM, Bjorn Meyer > wrote: > > Hi all, I am hoping that someone might be able to point me in the right > > direction for the following problem. I have been searching

Model Forms Customization

2011-01-31 Thread hank23
I think I've read most of the documentation on Model Forms, but I haven't seen much on how to customize them, other than changing the order in which fields are displayed, or not displaying some fields at all. The one ModelForm which I've done so far does not look very good as it is automatically

Re: ANN: Server upgrade on djangoproject.com

2011-01-31 Thread Shawn Milochik
On Jan 31, 2011, at 12:12 PM, Jacob Kaplan-Moss wrote: > On Mon, Jan 31, 2011 at 2:40 AM, Shawn Milochik wrote: >> I'm seeing the code samples being cut off in the docs as well. >> http://docs.djangoproject.com/en/dev/topics/signals/ >> See sample under: >> Preventing

Re: ANN: Server upgrade on djangoproject.com

2011-01-31 Thread Jacob Kaplan-Moss
On Mon, Jan 31, 2011 at 2:40 AM, Shawn Milochik wrote: > I'm seeing the code samples being cut off in the docs as well. > http://docs.djangoproject.com/en/dev/topics/signals/ > See sample under: > Preventing duplicate signals It's working for me (Chrome/Safari OSX), so it's

Re: Django Admin select boxes

2011-01-31 Thread Tom Evans
On Mon, Jan 31, 2011 at 4:51 PM, Bjorn Meyer wrote: > Hi all, I am hoping that someone might be able to point me in the right > direction for the following problem. I have been searching for a few days now > and haven't been able to find a way to accomplish this. I have

Re: Facebook session problems.

2011-01-31 Thread CrabbyPete
Its definitely a django thing. It does it on explorer as well. Somehow the session information is lost. Maybe because it goes out to facebook to get the log in. I used firebug and I can see the facebook cookies as well as those for my site. On Jan 31, 9:33 am, Aljoša Mohorović

Django Admin select boxes

2011-01-31 Thread Bjorn Meyer
Hi all, I am hoping that someone might be able to point me in the right direction for the following problem. I have been searching for a few days now and haven't been able to find a way to accomplish this. I have found some solutions that are close, but only work on editing an entry, not on

Re: mis-named setting? SESSION_EXPIRE_AT_BROWSER_CLOSE

2011-01-31 Thread Tim Sawyer
> You can't stop the user from closing the browser, or switching to another > tab, with JS. And you shouldn't try to stop them navigating away - this > sort of thing is only likely to annoy them intensely. Taking this to the extreme - what do you want to happen if a person using your site has a

Re: working django with existing database

2011-01-31 Thread Ian
On Jan 31, 3:29 am, arief nur andono wrote: > oh please... > > i need only to query the table, have no access to modified the table > > why there is no way query the database and then make the output as object?? You don't need to modify the table. That was just a

Re: visually cut off code on djangoproject.com after upgrade?

2011-01-31 Thread Tom Evans
On Mon, Jan 31, 2011 at 4:11 PM, Shawn Milochik wrote: > Could have been the browser I was using. I'm not seeing the issue there now > on Chrome. > > Shawn > I don't think they've been updated yet. I'm using this page:

Re: visually cut off code on djangoproject.com after upgrade?

2011-01-31 Thread Shawn Milochik
On Jan 31, 2011, at 11:05 AM, creecode wrote: > Hello Shawn, > > I'm not seeing < ... Could have been the browser I was using. I'm not seeing the issue there now on Chrome. Shawn -- You received this message because you are subscribed to the Google Groups "Django users" group. To post

Re: visually cut off code on djangoproject.com after upgrade?

2011-01-31 Thread creecode
Hello Shawn, On Jan 31, 12:40 am, Shawn Milochik wrote: > I'm seeing the code samples being cut off in the docs as well. > > http://docs.djangoproject.com/en/dev/topics/signals/ > > See sample under: > Preventing duplicate signals I'm not seeing <

Re: django and mysql connection problem

2011-01-31 Thread cuteangel
thnkzit helped... -- 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 django-users+unsubscr...@googlegroups.com. For more

Re: mis-named setting? SESSION_EXPIRE_AT_BROWSER_CLOSE

2011-01-31 Thread Daniel Roseman
On Monday, January 31, 2011 3:06:29 PM UTC, Ivan Uemlianin wrote: > > Dear Tom > > Thanks for your comment. > > My use case is a "presence"-type system. When a user logs out their > status change is sent out to all other logged-in users (using comet). > If they just close the browser this

Re: django and mysql connection problem

2011-01-31 Thread Daniel Roseman
On Monday, January 31, 2011 2:45:55 PM UTC, cuteangel wrote: > > > its my first project with django..i already tried the connection with > sqlite.but now m using django's connection with mysql n m getting > following error... > > D:\project\wogma>manage.py syncdb > Traceback (most recent call

Re: mis-named setting? SESSION_EXPIRE_AT_BROWSER_CLOSE

2011-01-31 Thread Ivan Uemlianin
Dear Tom Thanks for your comment. My use case is a "presence"-type system. When a user logs out their status change is sent out to all other logged-in users (using comet). If they just close the browser this doesn't happen. I'm mulling over two possible solutions: (a) some bit of javascript

Re: django and mysql connection problem

2011-01-31 Thread Tom Evans
On Mon, Jan 31, 2011 at 2:45 PM, cuteangel wrote: > > its my first project with django..i already tried the connection with > sqlite.but now m using django's connection with mysql n m getting > following error... > > > _mysql_exceptions.OperationalError: (1049,

django and mysql connection problem

2011-01-31 Thread cuteangel
its my first project with django..i already tried the connection with sqlite.but now m using django's connection with mysql n m getting following error... D:\project\wogma>manage.py syncdb Traceback (most recent call last): File "D:\project\wogma\manage.py", line 11, in

Re: Django session gets confused behind proxy, already logged in

2011-01-31 Thread Tom Evans
On Mon, Jan 31, 2011 at 1:15 PM, Stefan wrote: > Hi, > > Currently we're having some issues with a user of our product who uses > a proxy on their internal network. > > According to their system administrator the proxy is open to port 80 > and 443, and doesn't do anything

Re: mis-named setting? SESSION_EXPIRE_AT_BROWSER_CLOSE

2011-01-31 Thread Tom Evans
On Mon, Jan 31, 2011 at 2:21 PM, Ivan Uemlianin wrote: > Dear All > > Is the setting SESSION_EXPIRE_AT_BROWSER_CLOSE mis-named?  As far as I > can tell the setting doesn't influence the session expiry at all > (e.g., what happens to the django_session table on the server).  What

Filtered drop down choice django

2011-01-31 Thread sushanth Reddy
I am trying to create a dynamic filtered drop down choice fields,i gone through below blog but it confusing,can any one suggest easy way to do this in django. http://www.nerdydork.com/dynamic-filtered-drop-down-choice-fields-with-django.html Thanks in advance :) -- You received this message

Issue with Foriegnkey in django

2011-01-31 Thread sushanth Reddy
i AM trying to create a from which is linked with foriegnkey. Model.py enter code here model.py class CreateD(models.Model): id=models.IntegerField(primary_key=True) db = models.CharField(max_length=50, blank=True) iss = models.CharField(max_length=100, blank=True)

Re: Facebook session problems.

2011-01-31 Thread Aljoša Mohorović
On Mon, Jan 31, 2011 at 2:59 PM, CrabbyPete wrote: > I am loosing the django session. try setting the P3P on response: response['P3P:CP'] = "IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT" it probably wont help but it fixes this issue with explorer so it

mis-named setting? SESSION_EXPIRE_AT_BROWSER_CLOSE

2011-01-31 Thread Ivan Uemlianin
Dear All Is the setting SESSION_EXPIRE_AT_BROWSER_CLOSE mis-named? As far as I can tell the setting doesn't influence the session expiry at all (e.g., what happens to the django_session table on the server). What this setting seems to affect is the expiry of the *cookie* in the browser. I'm

Re: Facebook session problems.

2011-01-31 Thread CrabbyPete
I am loosing the django session. On Jan 31, 8:44 am, "christian.posta" wrote: > Which session are you losing? > The django authenticated session, or the facebook session? > > On Jan 29, 10:30 pm, CrabbyPete wrote: > > > > > > > > > I managed to

Re: Facebook session problems.

2011-01-31 Thread christian.posta
Which session are you losing? The django authenticated session, or the facebook session? On Jan 29, 10:30 pm, CrabbyPete wrote: > I managed to log into facebook using the graph api, I store the FB id > and tie it to a User, like this > > class FacebookUser(models.Model): >  

Re: pyodbc & FreeTDS: Can I work with NVARCHAR column on MSSQL2008

2011-01-31 Thread Adnan Sadzak
Hi, I have expirience with pymssql and mssql server, and that works fine (utf-8). FreeTDS docs says: "FreeTDS is not fully compatible with multi-byte character sets such as UCS-2. You must use an ASCII-extension charset (e.g., UTF-8,

Django session gets confused behind proxy, already logged in

2011-01-31 Thread Stefan
Hi, Currently we're having some issues with a user of our product who uses a proxy on their internal network. According to their system administrator the proxy is open to port 80 and 443, and doesn't do anything with cookies and such, only blocks out some sites. The problem: when user X logs in

pyodbc & FreeTDS: Can I work with NVARCHAR column on MSSQL2008

2011-01-31 Thread Orgil
Hello. I have FreeTDS, pyodbc-2.1.8, python-2.6, ubuntu-10.4. I also have MSSQL2008 database server on Windows7. My question is: Can I get unicode data from nvarchar column on Mssql2008 database using pyodbc? To do this, what does other library or configuration need me? I use FreeTDS driver to

Re: Redirect with current data

2011-01-31 Thread Masklinn
On 2011-01-31, at 06:36 , Antônio Ribeiro wrote: > Hello guys! > > I've been wondering about this all night and i've already made a search on > google and everything, but I didn't get a straight answer. > > Is there a way to make a redirect and send data from my current request to > the other

Re: Redirect with current data

2011-01-31 Thread Jonas Geiregat
Maybe this will help you: http://docs.djangoproject.com/en/dev/topics/http/shortcuts/ Op 31-jan-2011, om 06:36 heeft Antônio Ribeiro het volgende geschreven: > Hello guys! > > I've been wondering about this all night and i've already made a search on > google and everything, but I didn't get

Seeing tracebacks of unhandled exceptions in AJAX requests

2011-01-31 Thread Yaniv Aknin
Hi, I really like Django's technical error page (the one you get when a view raises an uncaught exception and DEBUG is true). However, when an AJAX request causes an error, the technical error page reaches the AJAX error handler, instead of being displayed in the browser. To solve this problem,

Re: loading the external css file

2011-01-31 Thread Ben Dembroski
Aha !! Is there a notice of this somewhere obvious on the website that I missed? Thanks again! -- Ben On Jan 31, 11:38 am, Łukasz Rekucki wrote: > On 31 January 2011 12:17, Ben Dembroski wrote: > > > Hi all, > > > I was having the same trouble

Redirect with current data

2011-01-31 Thread Antônio Ribeiro
Hello guys! I've been wondering about this all night and i've already made a search on google and everything, but I didn't get a straight answer. Is there a way to make a redirect and send data from my current request to the other page. I mean, I could use the render_to_response to call another

Re: flatpages templatetags missing

2011-01-31 Thread GSV
MIDDLEWARE_CLASSES = ( 'django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware',

Re: loading the external css file

2011-01-31 Thread Łukasz Rekucki
On 31 January 2011 12:17, Ben Dembroski wrote: > Hi all, > > I was having the same trouble (using version 1.2).  I double checked > that I was looking at the correct documentation: > > http://docs.djangoproject.com/en/1.2/howto/static-files/ Django 1.2 doesn't have (never

Re: loading the external css file

2011-01-31 Thread Ben Dembroski
Hi all, I was having the same trouble (using version 1.2). I double checked that I was looking at the correct documentation: http://docs.djangoproject.com/en/1.2/howto/static-files/ and it does indicate that I should be truing to use django.contrib.staticfiles . Should I instead be using the

Re: working django with existing database

2011-01-31 Thread arief nur andono
errr...what do you think i read at http://code.activestate.com/recipes/285262-create-objects-from-variable-class-names/ class Bunch(dict): def __init__(self,**kw): dict.__init__(self,kw) self.__dict__ = self fruit = Bunch(apples=1, pears=2) print fruit.apples print

Re: working django with existing database

2011-01-31 Thread Adrian Bool
Arief, Just do a search and replace in your text file along the lines of, search for, max_digits=0, decimal_places=-127 replace, max_digits=10, decimal_places=2 And Django should be happy. aid On 31 Jan 2011, at 10:29, arief nur andono wrote: > oh please... > > i need only to query the

Re: working django with existing database

2011-01-31 Thread arief nur andono
oh please... i need only to query the table, have no access to modified the table why there is no way query the database and then make the output as object?? 2011/1/31 Ian > On Jan 31, 12:20 am, arief nur andono > wrote: > > class

Re: XML parsing

2011-01-31 Thread Adrian Bool
Hi, Remove any carriage returns and extra spaces from your binary.xml file, like so, http://schemas.xmlsoap.org/soap/envelope/;>http://flypp.infy.com/sms/v2010r1_0;>12345343661t1p1p2DICT test Seems to parse ok then. aid On 31 Jan 2011, at 09:18, sami nathan wrote: > HI >I am trying

Re: Weird Django Artifact Error

2011-01-31 Thread Samuel Baldwin
2011/1/31 bruno desthuilliers : > If yes, then grep is your friend: > > # cd /path/to/your/project > # grep -rHne "djang\.form" Yeah, I had done this (except with ack[1]) and 'djang.form.formsets' appears nowhere… And yes, I had restarted the service. Anyways, I

XML parsing

2011-01-31 Thread sami nathan
HI I am trying to parse my response by the following method elif request.method == 'POST': reqp=request.raw_post_data response = HttpResponse(mimetype='text/xml') response.write(reqp) print response xmldoc = minidom.parse('binary.xml') reflist =

Re: ANN: Server upgrade on djangoproject.com

2011-01-31 Thread Shawn Milochik
I'm seeing the code samples being cut off in the docs as well. http://docs.djangoproject.com/en/dev/topics/signals/ See sample under: Preventing duplicate signals Shawn -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group,

Re: newbie question about paths

2011-01-31 Thread bruno desthuilliers
On 29 jan, 17:00, Brian Craft wrote: > Suppose the project is /var/www/django/project. Following the django > with wsgi docs, you would add /var/www/django to the path, and > DJANGO_SETTINGS_MODULE would be project.settings. > > However, in that case, the path scheme

Re: Weird Django Artifact Error

2011-01-31 Thread bruno desthuilliers
On 30 jan, 20:02, Samuel Baldwin wrote: > I was writing a view in Django and I accidentally tried to import from > a module 'djang.form.formsets'. Naturally this didn't work so I fixed > it, but I still continue to get an error like it's there. I've tried > removing

Re: working django with existing database

2011-01-31 Thread Ian
On Jan 31, 12:20 am, arief nur andono wrote: > class TempJmlGangguanPyl(models.Model): >     singkatpyl = models.CharField(max_length=4, blank=True) >     singkatgrd = models.CharField(max_length=4, blank=True) >     jumlah_gangguan = models.DecimalField(null=True,

Re: Some beginners question

2011-01-31 Thread Sam Lai
On 31 January 2011 15:55, vishy wrote: > 1) I want to read files. Where should I put these files? I am not using a > model to link to the files. And how to discover the path to files? I am > working on windows, and in development environment I am using the full path > to