How to get latest db results ? (commit problem)

2007-01-06 Thread Ilia Kantor



Hello!

I'm using django with Twisted + Mysql.

The problem is that cursor for same SQL returns same results between
requests if  connection.commit() was not called.

Sometimes that's a problem, because data is changed by other clients, and
commit never happens.

Autocommit mode is fine and it fixes the problem (hence it has nothing to
do with result caching), but I have to patch django for it.

I can call commit before every select, but it's just ugly..

Is there a solid way to go ?

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Edit_Inline, Love, and Invoices

2006-08-30 Thread Ilia Kantor


Had hard time with it too.

Check this

http://code.djangoproject.com/ticket/2413
and
http://code.djangoproject.com/ticket/2534

Hopefully will be merged into django.. Current behavior is bug.

> My client would like to be able to upload invoices via the admin
> interface. There's a customer model, and I've created another related
> model (Invoice), which I've set to edit_inline and associated via
> foreign key to the Customer model.
>
> The client may or may not have an invoice to upload.
>
> So far, my Invoice model looks like this:
>
> --
> class Invoice(models.Model):
>
> customer = models.ForeignKey(Customer, edit_inline=models.STACKED,
> num_in_admin=4)
>
> invoice = models.FileField(upload_to='invoices', core=True)
> --
>
> Which displays great in the Admin interface. I'm able to save Customers
> without adding invoices, which is perfect.
>
> The problem arises when the I try to upload an invoice. Nothing
> happens...
>
> No error is displayed, but no file is uploaded.
>
> Has anyone encountered this and found a solution, or can point out
> where I'm mistaken?
>
> Thanks,
> Dave Worley
>
>
> 

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



specific admin functionality

2006-08-30 Thread Ilia Kantor


Admin is great, but customazibility is.. Not quite clear..
How can I add e.g

1) single radio-field among all edit_inlined objects ?

2) hierselect ( select 1 is set, then select 2 shows fields depending on 
select 1)

3) self-managed search functionality in admin object list ?
E.g search by fields combination

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



edit_inline fails

2006-08-29 Thread Ilia Kantor

I have an object + edit_inline=stacked

I edit inline object and press save... But nothing changes.. 

How can I debug what's up ?

No errors, just doesn't work (trunk)

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: python syntax errors

2006-08-29 Thread Ilia Kantor


> if there are syntax errors, the file will not compile and the only
> error apache will give is incomplete script headers or something like
> that. So before running with apache, make sure the file compiles (F5
> in idle). Even if it does compile, if some import errors are there,
> again you will not get the error - just the script headers thing

Wait, wait.. When the error occurs, message is GENERATED.
it should not be consumed, but saved somewhere.
Better go apache log...

And people here tell me set admin email.. So I will get emails with errors 
WHILE I DEVELOP on my home box!
*rofl*

Maybe django redirects stdout/stderr somewhere so the errors get consumed ?


>
> > Save Apache for final deployment.
>
> no harm in using it for development - that way both devel and
> production are on identical platforms

I too can't understand why I shouldn't develop on apache.

Usually people recommend use same env for development and production.
Less weak points.

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Custom file handling

2006-08-28 Thread Ilia Kantor


Works great!

But probably the better way would be to make a special FileBrowserField.

Such fixing is kind of hack..




> btw, I´m about to rewrite that script using jquery ...
>
> patrick
>
> Am 28.08.2006 um 20:11 schrieb [EMAIL PROTECTED]:
> > You note
> >
> >> With adding the script AddFileBrowser.js to your model, you are
> >> getting a link to the FileBrowser
> >> as well as an Image-Preview.
> >
> > How can I use it in my model to have previews for image field ?
> >
> > I see
> >
> >  init: function() {
> > var helptext = document.getElementsByTagName('p');
> > for (var i = 0, ht; ht = helptext[i]; i++) {
> > charFieldID =
> > ht.previousSibling.previousSibling.getAttribute('id');
> >
> >
> > That means you get all  and misteriously search for sibling's id ?
> > What's mistery is that ?
>
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Custom file handling

2006-08-28 Thread Ilia Kantor


Can I integrate that with ImageField (or its inheritants) ?


> btw, I´m about to rewrite that script using jquery ...
>
> patrick
>
> Am 28.08.2006 um 20:11 schrieb [EMAIL PROTECTED]:
> > You note
> >
> >> With adding the script AddFileBrowser.js to your model, you are
> >> getting a link to the FileBrowser
> >> as well as an Image-Preview.
> >
> > How can I use it in my model to have previews for image field ?
> >
> > I see
> >
> >  init: function() {
> > var helptext = document.getElementsByTagName('p');
> > for (var i = 0, ht; ht = helptext[i]; i++) {
> > charFieldID =
> > ht.previousSibling.previousSibling.getAttribute('id');
> >
> >
> > That means you get all  and misteriously search for sibling's id ?
> > What's mistery is that ?
>
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: python syntax errors

2006-08-28 Thread Ilia Kantor


no, I did not care about it yet.

I'm under Gentoo box w/ sendmail wrapper


> On 8/28/06, Ilia Kantor <[EMAIL PROTECTED]> wrote:
> > my settings.py starts with
> >
> > DEBUG = True
> > TEMPLATE_DEBUG = DEBUG
>
> Are you listed in ADMINS? Is your system properly configured to send
> email? (ie.on my setup, I needed to configure the EMAIL_HOST and
> SERVER_EMAIL options).
>
> Jay P.
>
> 

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: python syntax errors

2006-08-28 Thread Ilia Kantor

my settings.py starts with

DEBUG = True
TEMPLATE_DEBUG = DEBUG


> On 8/28/06, Ilia Kantor <[EMAIL PROTECTED]> wrote:
> > After all, I think such behavior ("eating" errors) is simply wrong.
> > I want track errors from logs after deployment, because fixes on live
> > server should be possible.
>
> When the 'DEBUG' setting is False, Django will email tracebacks of any
> errors to all the people listed in the 'ADMINS' setting.

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: python syntax errors

2006-08-28 Thread Ilia Kantor


I have single static IP on my home host, and 80 port is occupied by apache.
I'm very satisfied by dev process using it.

After all, I think such behavior ("eating" errors) is simply wrong. 
I want track errors from logs after deployment, because fixes on live server 
should be possible.

> On 8/28/06, Ilia Kantor <[EMAIL PROTECTED]> wrote:
> > When I have syntax error in python code of an app, where it goes ?
> >
> > I'm working under apache, same config as production, but
> > MaxRequestsPerChild 1
> >
> > There are no syntax errors in apache error log or site error log.
> > What's up ?
>
> I don't remember where they go when running with Apache, but why not
> use the development server when doing your *development*? Then you see
> all the errors, and it *quickly* auto-reloads when you change files,
> etc. etc.
>
> Save Apache for final deployment.
>
> Jay P.
>
> 

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



python syntax errors

2006-08-28 Thread Ilia Kantor


When I have syntax error in python code of an app, where it goes ?

I'm working under apache, same config as production, but MaxRequestsPerChild 1

There are no syntax errors in apache error log or site error log.
What's up ? 

How should I setup things ?

 my vhost --


ServerName mysite.ru

ErrorLog /var/site/mysite/logs/error.log
CustomLog /var/site/mysite/logs/access.log combined
DocumentRoot /var/site/mysite/www
LogLevel debug


SetHandler python-program
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE mysite.settings
PythonDebug On
PythonPath "['/var/site'] + sys.path"


# Exceptions from the mod_python hooked onto '/'

SetHandler None




--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



thumbnails in admin (Edit)

2006-08-28 Thread Ilia Kantor


How can I see thumbnails instead of links on "edit" admin page ?

I see { bound_field_line } is printed there, what should I fix to have image 
instead of link to file ?

I tried PhotoField, ImageWithThumbnailField.

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---