Re: What is best way of positioning html edit boxes?

2008-02-02 Thread Glenn_NZ

I am not modifying form.as_p() in the view.  Should I be?
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Problem creating a model instance with data captured from an URL in a View

2008-02-02 Thread Jack Oswald
I have just created my first, very simple, Django app.  Using the URL as a
way to pass in parameters, I capture information and use a template to
create an iCal file.  I intend to put this up on the web to allow anyone who
wants to add a link to a web page (especially static pages) a link that
returns a properly formatted iCal file so page visitors can get a scheduled
item into their calendar easily.
 
The challenge that I ran into is this.  I was easily able to capture the
values I needed from the URL and have them passed into the View function.
In addition to rendering the template and  passing it back to the browser I
want to capture the passed in parameters in a database.  The only way I
could get this to work was to create an empty instance of the database model
and then set each field value one at a time from the passed in parameters
from the URL.  I was surprised that I could not simply do the following:
 
Def makeicalEvent(request, summary, location, start_date, start_time, …)
 
p = icalEvent(summary, location, start_date, start_time, …)
 
and have it create a new instance and fill the field values.  I tried adding
an __init__ function to the model but that didn’t work either.  What did
work was this:
 
p= icalEvent()
p.summary = summary
p.location = location
…
 
Seems odd to me.
 
Jack
 

No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.516 / Virus Database: 269.19.18/1255 - Release Date: 2/1/2008
9:59 AM
 

--~--~-~--~~~---~--~~
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: What is best way of positioning html edit boxes?

2008-02-02 Thread Kenneth Gonsalves


On 03-Feb-08, at 11:24 AM, Glenn_NZ wrote:

> I am a new django user and I am using the django trunk version.
> Inside the template I am using the {{form.as_p}} template variable to
> automatically output all the fields for the form.
>
> Someone told me, not from this group, that the best way of position
> edit boxes (ie ) is to use cascading style sheets.  However
> when I try to do something like the following:
> 
> #id_phone_home {left:30px; top:70px}
> 
> the input box moves but not the label.

are you modifying form.as_p() in the view?

-- 

regards
kg
http://lawgon.livejournal.com
http://nrcfosshelpline.in/web/
Foss Conference for the common man: http://registration.fossconf.in/web/



--~--~-~--~~~---~--~~
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: unknown encoding: cp0 (apache, mod_python)

2008-02-02 Thread Karen Tracey
On Feb 2, 2008 8:14 PM, Michael Hipp <[EMAIL PROTECTED]> wrote:

>
> My code runs fine on the development server, but dies on a local copy of
> apache with mod_python.
>
> It's giving me this error:
> unknown encoding: cp0
>
> On this line:
> print 'report: %s' % report_name
>
> Google found several references to making everything unicode (see
> below), so I tried this:
> print u'report: %s' % unicode(report_name)
>
> But it still fails the same.
>
> I'm running the latest from SVN on W2k with Apache 2.2.8, mod_python
> 3.3.1 and Python 2.5.1.
>
> Any ideas?
>
> Thanks,
> Michael
>
> http://code.djangoproject.com/ticket/5584
>
> http://code.djangoproject.com/wiki/UnicodeBranch#PortingApplicationsTheQuickChecklist
>

This thread:

http://groups.google.com/group/django-users/browse_thread/thread/f995ff5ddae2cd51

reports the same error message on a print statement and the fix in that case
was to wrap the variable in str(), not unicode(), though it doesn't seem the
problem/fix was well understood there.  I'm guessing (which I probably
shouldn't do at 1AM) but I think the problem is Windows is returning
something to Python that makes Python think unicode strings must be
converted to "cp0" in order to be displayed on the console, but Python has
no idea what "cp0" is, so generates an error.  If you wrap the variable in
str() before you print it then you sidestep the issue of what codepage needs
to be used for console printing of unicode strings.  I think,  maybe.
Anyway, it's worth a try.

Karen

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



What is best way of positioning html edit boxes?

2008-02-02 Thread Glenn_NZ

Hi,

I am a new django user and I am using the django trunk version.
Inside the template I am using the {{form.as_p}} template variable to
automatically output all the fields for the form.

Someone told me, not from this group, that the best way of position
edit boxes (ie ) is to use cascading style sheets.  However
when I try to do something like the following:

#id_phone_home {left:30px; top:70px}

the input box moves but not the label.

I would like to use the form.as_p() as it makes it easy to render
validation errors (rather than to have to come up with stuff to do
this myself).

An excerpt from my form.as_p() is shown below:

(Pdb) form.as_p()
u'Phone home: 
\n

Phone work: maxlength="20" />\n
Phone mobile: \n

etc.

Am I using the right form method?  ie as_p() ?

What is the recommended best practice here?

Thanks in advance.
Glenn.
--~--~-~--~~~---~--~~
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: problems with custom template library

2008-02-02 Thread Kenneth Gonsalves


On 03-Feb-08, at 8:06 AM, [EMAIL PROTECTED] wrote:

> @register.filter()

try: @register.filter   <--- without the '()'

-- 

regards
kg
http://lawgon.livejournal.com
http://nrcfosshelpline.in/web/
Foss Conference for the common man: http://registration.fossconf.in/web/



--~--~-~--~~~---~--~~
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: problems with custom template library

2008-02-02 Thread Kenneth Gonsalves


On 03-Feb-08, at 8:06 AM, [EMAIL PROTECTED] wrote:

> I have tried 'breaking' the filter module by entering all manner of
> syntax errors in the file, deleting the import statements, leaving it
> blank, etc.  No matter what I do the error message is the same.

this error message is hardcoded - it can either mean that it cannot  
find your templatetag or that there is a syntax error in the template  
tag. If the template tag file does not compile you will get that not  
found error message. Try running from the python shell - you may get  
a more meaningful error message

-- 

regards
kg
http://lawgon.livejournal.com
http://nrcfosshelpline.in/web/
Foss Conference for the common man: http://registration.fossconf.in/web/



--~--~-~--~~~---~--~~
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: template: how to make use of forloop.counter0

2008-02-02 Thread Malcolm Tredinnick


On Sat, 2008-02-02 at 20:42 -0600, Michael Hipp wrote:
> I'm trying to do something in a template that seems really simple ... 
> populate the row/columns of a table and apply alignment for each field. 
>   So I'm doing this:
> 
>  {% for row in report_data %}
>  
>{% for col in row %}
>  
>  {{ col }}
>  
>{% endfor %}
>  
>  {% endfor %}
> 
> I'm trying to use the 'forloop.counter0' to get at which column I'm 
> currently populating so I can apply the appropriate alignment according 
> to the list contained in align.  Align is a tuple of alignments:
> 
>align = ("Center", "Right", "Left", "Center")
> 
> So how does one actually make use of the forloop.counter0 variable?

By writing {{ align.forloop.counter0 }} you are actually asking for the
"forloop" attribute on the "align" object and then the "counter0"
attribute on that. Which isn't what you want.

{{ forloop.counter0 }} is mostly for display purposes (displaying the
index of a list) and testing (is it equal to 0 or whatever).

> 
> Or is there some other way to get at my 'align' list?

Look at the {% cycle %} template tag. It's designed for precisely this
purpose.

Regards,
Malcolm

-- 
No one is listening until you make a mistake. 
http://www.pointy-stick.com/blog/


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



template: how to make use of forloop.counter0

2008-02-02 Thread Michael Hipp

I'm trying to do something in a template that seems really simple ... 
populate the row/columns of a table and apply alignment for each field. 
  So I'm doing this:

 {% for row in report_data %}
 
   {% for col in row %}
 
 {{ col }}
 
   {% endfor %}
 
 {% endfor %}

I'm trying to use the 'forloop.counter0' to get at which column I'm 
currently populating so I can apply the appropriate alignment according 
to the list contained in align.  Align is a tuple of alignments:

   align = ("Center", "Right", "Left", "Center")

So how does one actually make use of the forloop.counter0 variable?

Or is there some other way to get at my 'align' list?

Thanks,
Michael

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



problems with custom template library

2008-02-02 Thread jonathan . lukens

Hi all,

I am new to Django and am trying to get my site, which is now built
with ExpressionEngine, running on my development machine.
I am trying to write a custom filter.  When I place it in a template,
I get the following error message:

'blog_extras' is not a valid tag library: Could not load template
library from django.templatetags.blog_extras, cannot import name
Category

I have one app, weblog, in my project, which in turn has two models in
models.py: Category and Entry.  There is a templatetags directory
there as well containing __init__.py and blog_extras.py.  weblog is
installed in INSTALLED_APPS and aside from the filter problem works as
intended.  The contents of blog_extras.py is as follows:

from django import template
from weblog.models import Entry

register = template.Library()

@register.filter()
def category_url(entry_id):
e = Entry.objects.get(id=entry_id)
return e.category.url

I have tried 'breaking' the filter module by entering all manner of
syntax errors in the file, deleting the import statements, leaving it
blank, etc.  No matter what I do the error message is the same.  I am
a sloppy, amateur programmer and I am sure there is something idiotic
here that I am missing, perhaps something in the settings?  Or
PYTHONPATH?
Any help is much appreciated.
--~--~-~--~~~---~--~~
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: Cache problem with language

2008-02-02 Thread Antoni Aloy
2008/2/2, Grupo Django <[EMAIL PROTECTED]>:
>
>
> Hello, I'm having a problem using the cache system with different
> languages.
> I have used the vary_on_cookie decorator in my view:
>
> @vary_on_cookie
> @cache_page(60 * 60 * 12)
> def my_view(request):
> ...
>
>
> I've even test with:
> @vary_on_headers('Cookie')
>
> and:
>
> my_view = vary_on_headers(my_view, 'Cookie')
>
> but not working at all. the cache doesn't difference the language.
> Any idea?
>
> Thank you.
>
> I have the same problem and I have filed a bug report on Django. My
workarround has been to modify the cache decorator. You can do it yourself
patching Django source o by application basis, just write this code in on of
the __init__.py files on one of the applications. You should need to add the
missing imports.

def _generate_cache_key_i18n(request, headerlist, key_prefix):
"""Returns a cache key from the headers given in the header list.
This function overrides the one that django provides in orde to consider
the page language"""
ctx = md5.new()
lang = translation.get_language()
for header in headerlist:
value = request.META.get(header, None)
if value is not None:
ctx.update(value)
return 'views.decorators.cache.cache_page.%s.%s.%s.%s' % (
   key_prefix, iri_to_uri(request.path), ctx.hexdigest(),lang)
cache._generate_cache_key=_generate_cache_key_i18n

Hope it helps!

-- 
Antoni Aloy López
Blog: http://www.trespams.com
Site: http://apls.net

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



unknown encoding: cp0 (apache, mod_python)

2008-02-02 Thread Michael Hipp

My code runs fine on the development server, but dies on a local copy of 
apache with mod_python.

It's giving me this error:
 unknown encoding: cp0

On this line:
 print 'report: %s' % report_name

Google found several references to making everything unicode (see 
below), so I tried this:
 print u'report: %s' % unicode(report_name)

But it still fails the same.

I'm running the latest from SVN on W2k with Apache 2.2.8, mod_python 
3.3.1 and Python 2.5.1.

Any ideas?

Thanks,
Michael

http://code.djangoproject.com/ticket/5584
http://code.djangoproject.com/wiki/UnicodeBranch#PortingApplicationsTheQuickChecklist

--~--~-~--~~~---~--~~
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: Template help, gotta be simple

2008-02-02 Thread Ned Batchelder

I'm not sure there's a way to do this purely in the template language.  
You can munge the data in the view instead.  This line creates a new 
filtered_data list that has only the data you want to display:

filtered_data = [ dict([ (k,d[k]) for k in fields ]) for d in data ]

--Ned.
http://nedbatchelder.com/blog

Michael Hipp wrote:
> I'm trying to do something with a template that I thought would be very 
> simple but I've not yet found a way to make it work at all.
>
> from django.template import Template, Context
> fields = ("f1", "f3")
> data = [
>  {"f1": "Foo", "f2": "Skip  ","f3": "Bar"},
>  {"f1": "Cat", "f2": "Ignore","f3": "Dog"},
>  {"f1": "Him", "f2": "Avoid ","f3": "Her"},
> ]
> t = Template("""
>  {% for row in data %}
>  {% for f in fields %}
>  {{ row.f }}
>  {% endfor %}
>  {% endfor %}
>   """)
> print t.render(Context({'fields': fields, 'data': data}))
>
> I want to print out the data items row-by-row but skipping 'f2' since 
> it's not listed in 'fields'. The above is how it seems like it ought to 
> work, but it just ignores me. Lots of other crazy permutations didn't 
> work either.
>
> Can someone show me what (very simple) thing I'm missing?
>
> Thanks,
> Michael
>
> >
>
>   

-- 
Ned Batchelder, http://nedbatchelder.com

--~--~-~--~~~---~--~~
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: RSS escaping, {{ autoescape }} and |safe

2008-02-02 Thread Michael Elsdörfer

 > I'm sure  I'm not the only person who has come across
 > this problem

I ran into this yesterday:

http://code.djangoproject.com/ticket/6533

Might be related?

Michael

--~--~-~--~~~---~--~~
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: Heads-down transaction-processing apps on Django

2008-02-02 Thread Tim Chase

> Yes. This is really easy for stuff like Zebra printers. Hadn't thought 
> of it for the bigger ones needing lots of PCL but it could be done 
> easily enough with a little work to abstract some of the basic drawing.

There are some other add-on Python libraries that, as long as
your printer supports PostScript, you can use them as your
rendering target.  A couple that came up in a quick Google search:

http://pyx.sf.net
http://sping.sf.net
http://www.nongnu.org/pypsg/

I believe each of them has a way of outputting PS (or PDF or GIF
or PNG or other media formats), which can in turn be fired off to
the printer.

And since Django is just Python, anything you can do in Python,
you can do in Django.

-tim
(hoping to get his company to spring for PyCon again this year)






--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Template help, gotta be simple

2008-02-02 Thread Michael Hipp

I'm trying to do something with a template that I thought would be very 
simple but I've not yet found a way to make it work at all.

from django.template import Template, Context
fields = ("f1", "f3")
data = [
 {"f1": "Foo", "f2": "Skip  ","f3": "Bar"},
 {"f1": "Cat", "f2": "Ignore","f3": "Dog"},
 {"f1": "Him", "f2": "Avoid ","f3": "Her"},
]
t = Template("""
 {% for row in data %}
 {% for f in fields %}
 {{ row.f }}
 {% endfor %}
 {% endfor %}
  """)
print t.render(Context({'fields': fields, 'data': data}))

I want to print out the data items row-by-row but skipping 'f2' since 
it's not listed in 'fields'. The above is how it seems like it ought to 
work, but it just ignores me. Lots of other crazy permutations didn't 
work either.

Can someone show me what (very simple) thing I'm missing?

Thanks,
Michael

--~--~-~--~~~---~--~~
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: allow user to update his record

2008-02-02 Thread Carl Karsten

Carl Karsten wrote:
> Carl Karsten wrote:
>> Is there a built in way for users to update their own user record?
>>
>> I currently have a page that displays user data to any other user.  I was 
>> hoping 
>> to re-use that for allowing a user to edit his own.
>>
>> If it matters, I am useing a user_profile as described:
>> http://www.b-list.org/weblog/2006/jun/06/django-tips-extending-user-model/
> 
> (12:35:22 AM) ubernostrum: CarlFK: http://code.google.com/p/django-profiles/
> (12:35:47 AM) ubernostrum: CarlFK: I wrote it so you won't have to :)

How do I reference form and profile in my template?

return render_to_response(template_name, { 'form': form, 'profile': 
profile_obj, 
},...

http://code.google.com/p/django-profiles/source/browse/trunk/profiles/views.py#88


Carl K

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



RSS escaping, {{ autoescape }} and |safe

2008-02-02 Thread Jon Atkinson

My blog uses some very simple Django apps, and applications in contrib
for most of the features, including django.contrib.syndication.feeds.

I've recently noticed that my RSS isn't being properly escaped (see
http://jonatkinson.co.uk/feeds/blog/), so I thought that simply
wrapping my RSS blog_description.html template in an autoescape tag
would solve the problem:

{% autoescape off %}
{{ obj.content|linebreaks }}
{% endautoescape %}

... where obj.content is a post object, and I want to have Django add
the  and  tags for me (hence the |linebreaks).

However, this doesn't seem to have made the problem go away, or does
any combination of {{ autoescape off }}, |safe, or similar. I'm sure
I'm not the only person who has come across this problem - is there a
magic combination of template filters to fix this? I realise that RSS
shouldn't be presentational, and that is it hard for Django to
determine whether a < or a > is meant literally or as part of a tag,
but surely this is a very common usage pattern?

Any help would be much appreciated.

--Jon

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Cache problem with language

2008-02-02 Thread Grupo Django

Hello, I'm having a problem using the cache system with different
languages.
I have used the vary_on_cookie decorator in my view:

@vary_on_cookie
@cache_page(60 * 60 * 12)
def my_view(request):
...


I've even test with:
@vary_on_headers('Cookie')

and:

my_view = vary_on_headers(my_view, 'Cookie')

but not working at all. the cache doesn't difference the language.
Any idea?

Thank you.
--~--~-~--~~~---~--~~
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: Heads-down transaction-processing apps on Django

2008-02-02 Thread Michael Hipp

Tim Chase wrote:
>>> try to use control+W to delete the previous word while I'm typing
>>> in IE, only to have it close my whole window.  Minutes of sotto
>>> voce oaths usually follow.
>> Ug. This would be disastrous to a clerk on a tight queue. In the very 
>> least it looks like I may have to make Firefox a requirement as there 
>> appear to be fewer push-here-to-explode opportunities.
> 
> The best way to prevent this is to make AJAX'y submissions in the
> background as they work, basically writing the application
> interface in JavaScript.  It's an ugly job to code, but it can
> help save page-fulls of lossage.  FireFox has similar behavior
> with control+W, but I believe if it's something you really want
> to prevent, you can bind it to a NOP to prevent it from
> occurring.  I've not gone hacking FF configs/chrome to such a degree.

That's probably way more JavaScript than I'm likely to do anytime soon 
but it's good to know that such techniques can be made to work.

>> Would that be ReportLab perchance? Print solutions in Python seems to be 
>> a scarce species. I've used ReportLab with mixed success. If you know of 
>> another one to look at I'd sure be eager.
> 
> A short dig in the c.p.l archives found the link I had seen:
> 
> http://wiki.wxpython.org/Printing
> 
> Again, that was for printing to a printer attached to the server,
> rather than a printer attached to the web-client.

Ok. I've done printing from the two methods described in wxPython. The 
HTML variety is good for very simple cases but quickly runs out of power 
even long before full HTML would. The full wxPrint is a bit like coding 
in Assembler and has some bugs.

> Another option is to send the direct PCL yourself.  I've
> hand-cranked printer drivers for a couple thermal printers (Zebra
> and Oneil) that had some basic page-layout functions that I could
> use.  I just sent the printer-specific codes over the wire (IrDA,
> BlueTooth serial-profile, or serial-port in case) for fast and
> simple printing.  If you just need a text dump that you can do
> via simple escape codes, this isn't a bad way to go.  A bit of a
> pain to decipher printer manuals to get those codes...but
> feasible.  At least for those two printers, the PCL is pretty
> straight-forward and well documented.

Yes. This is really easy for stuff like Zebra printers. Hadn't thought 
of it for the bigger ones needing lots of PCL but it could be done 
easily enough with a little work to abstract some of the basic drawing.

Thanks,
Michael


--~--~-~--~~~---~--~~
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: Heads-down transaction-processing apps on Django

2008-02-02 Thread Michael Hipp

Jon Atkinson wrote:
 - Data entry people use lots of F-keys, Ctrl-keys and Alt-keys to make
 things happen on the screen.
>>> Not quite as much flexibility here.  HTML defines accelerator
>>> keys which are browser-specific (sometimes Alt+letter, sometimes
>>> control+letter, or other combos).
>> This is perhaps the only disappointing news from your experiences.
>>
>>> As a vi/vim user, my fingers occasionally
>>> try to use control+W to delete the previous word while I'm typing
>>> in IE, only to have it close my whole window.  Minutes of sotto
>>> voce oaths usually follow.
>> Ug. This would be disastrous to a clerk on a tight queue. In the very
>> least it looks like I may have to make Firefox a requirement as there
>> appear to be fewer push-here-to-explode opportunities.
> 
> Depending on how much control you have over your deployment, remember
> that is it pretty much trivial to modify the Firefox XUL files which
> define the keyboard shortcuts browser-wide. Turning off certain
> shortcut combinations would take a few minutes at the most, once ou
> knew where to look. Then just distribute the XUL files to the clients
> (I think you do it via Firefox profiles, so you would have a profile
> on each client called 'Data Entry' or similar).

Thanks, that's an excellent idea. And could be readily implemented only 
for the stations that really need it.

Michael

--~--~-~--~~~---~--~~
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: FckEditor vs TinyMCE

2008-02-02 Thread Dj Gilcrease

On Feb 1, 2008 9:49 AM, Cull <[EMAIL PROTECTED]> wrote:
>
> We're just starting to consider text editing.
> What is our easiest path here?  TinyMce or FckEditor. The latter has
> been our choice previously, but is there a post somewhere that
> discusses who to do it?  I haven't been about to find more than bits
> and pieces.  If not, what about Tiny?

There is a FckWidget for newforms @ http://www.djangosnippets.org/snippets/576/

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Reinitializing of db connection

2008-02-02 Thread Grigoriy Petukhov

Hi, all.
I use django ORM in multiprocessed parser. I use processing module:
http://pyprocessing.berlios.de/doc/
Each process is a fork of main process and I need to work with DB in
each process.
It is not recommended to use one db connection from all forked
processes, so I want to reinitialize connection to DB  after forking.
Could you help me and show the code that will reconnection to DB?

May be (in each forked process):

from django.conf import settings
from django.db import connection
connection.connection = None
connection._cursor(settings)

But I am not sure. Does this code do that I want? Does it affect on
connection of parent process? Does it affect on anything? ) What do
you think?

Thanks.

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Reinitializing of db connection

2008-02-02 Thread Grigoriy Petukhov

Hi, all.
I use django ORM in multiprocessed parser. I use processing module:
http://pyprocessing.berlios.de/doc/
Each process is a fork of main process and I need to work with DB in
each process.
It is not recommended to use one db connection from all forked
processes, so I want to reinitialize connection to DB  after forking.
Could you help me and show the code that will reconnection to DB?

May be (in each forked process):

from django.conf import settings
from django.db import connection
connection.connection = None
connection._cursor(settings)

But I am not sure. Does this code do that I want? Does it affect on
connection of parent process? Does it affect on anything? ) What do
you think?

Thanks.

--~--~-~--~~~---~--~~
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: DB query filter on member relations

2008-02-02 Thread Sebastjan Trepca

It can be done but the query will be quite slow. Just don't set the
title, so when you'll be displaying the model, check if title exists
else use first 200 characters of url.

Sebastjan

On Feb 2, 2008 4:15 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> I have a Model with two fields, a url and a title.
>
> If no title is given, it is initialized as the url (or at least the
> first 200 characters of the url).
>
> Is there a way to filter a DB query to get the rows that weren't
> initialized with a title?
>
> Something like
>
> MyModel.objects.filter(url__contains=self.title)
>
> I know that "self." there is mumbo jumbo. Any real solutions?
>
> If no good solution, I'm left making a new table or column to record
> these instances, or doing a crazy search on each row.
>
> Thanks,
> Ivan
> >
>



-- 
Sebastjan

--~--~-~--~~~---~--~~
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: newforms file-upload troubleshooting

2008-02-02 Thread birkin

Been experimenting & ruminating: I'm thinking the problem has
something to do with this views.py line:

file_instance.originalfile = cleaned_form_data['originalfile']

Will experiment more.
--~--~-~--~~~---~--~~
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: Using a Python module

2008-02-02 Thread MariusB

Thanks for your help, Jeff!
--~--~-~--~~~---~--~~
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: Heads-down transaction-processing apps on Django

2008-02-02 Thread BALIBEY


_
Express yourself instantly with MSN Messenger! Download today it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
--~--~-~--~~~---~--~~
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: Heads-down transaction-processing apps on Django

2008-02-02 Thread Jon Atkinson

> >> - Data entry people use lots of F-keys, Ctrl-keys and Alt-keys to make
> >> things happen on the screen.
> >
> > Not quite as much flexibility here.  HTML defines accelerator
> > keys which are browser-specific (sometimes Alt+letter, sometimes
> > control+letter, or other combos).
>
> This is perhaps the only disappointing news from your experiences.
>
> > As a vi/vim user, my fingers occasionally
> > try to use control+W to delete the previous word while I'm typing
> > in IE, only to have it close my whole window.  Minutes of sotto
> > voce oaths usually follow.
>
> Ug. This would be disastrous to a clerk on a tight queue. In the very
> least it looks like I may have to make Firefox a requirement as there
> appear to be fewer push-here-to-explode opportunities.

Depending on how much control you have over your deployment, remember
that is it pretty much trivial to modify the Firefox XUL files which
define the keyboard shortcuts browser-wide. Turning off certain
shortcut combinations would take a few minutes at the most, once ou
knew where to look. Then just distribute the XUL files to the clients
(I think you do it via Firefox profiles, so you would have a profile
on each client called 'Data Entry' or similar).

--Jon

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---