On Fri, 2007-03-30 at 07:49 +, Milan Andric wrote:
>
>
> On Mar 29, 8:31 pm, "Gary Wilson" <[EMAIL PROTECTED]> wrote:
[...]
> > When you say that the view is functioning very quickly, do you mean
> > the time from request to page render? If so, the template is already
> > getting run and is
On 30 Mar 2007, at 2:32 am, James Bennett wrote:
>
> On 3/29/07, Rob Hudson <[EMAIL PROTECTED]> wrote:
>> I can't think of a way to account for "up to last 3 years" and "up to
>> the next 5 years" or variation thereof.
>
> paid_up_until = models.DateField()
>
> Then use Python's standard 'dateti
On 30 Mar 2007, at 9:21 am, David Reynolds wrote:
>
> One of the things that annoys me about datetime is that it doesn't
> handle leap years properly. However, if you use python-dateutil[1] it
> has a relativedelta so you can do things like:
>
datetime.date.today()+relativedelta(years=+3)
>
[EMAIL PROTECTED] wrote on 03/29/07 20:15:
> I'm running a production Django application on two loadbalanced
> webservers and a single, dedicated Postgres server handling around
> 500k requests/day. I'm using memcached, and my database server
> performance has been fantastic.
>
> Lately, I've bee
On Mar 30, 1:08 am, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
>
> I'm confused. First you said it took 0.2 seconds, then you say it took
> 47 seconds and then 3 seconds. Both of those numbers are bigger than
> 0.2. I know this because I took advanced maths courses at university.
>
Yea, I tr
Well, one thing that you could do is to execute an external script
from your view. Then you'd immediatelly return from the view, and the
script could mail them in the background. That is, of course, if you
don't need any feedback to be displayed.
If you do need to do something like that, you'll n
Hello,
Here is how I define a form in my views:
class MyForm(forms.Form):
name= forms.CharField(label=_('Name'))
...
The problem is _('Name') is translated when I restart the server
(Django or Apache),
but not when I switch the browser locale.
I tried both
from django.utils.tra
Hi There!
I'm Markus Majer, and I'm from the german Ubuntu community. I plannig
a ubuntu / open source booth at a web developer confernce in
Ludwigsburg called "Webinale 2007"..
Some english information is provided here:
http://entwickler.de/konferenzen/divers/psecom,id,496,nodeid,567,_language,
On Fri, 2007-03-30 at 01:43 -0700, olive wrote:
> Hello,
>
> Here is how I define a form in my views:
>
> class MyForm(forms.Form):
> name= forms.CharField(label=_('Name'))
> ...
>
> The problem is _('Name') is translated when I restart the server
> (Django or Apache),
> but not
Ticket is #3877.
I did not found a way to assign the ticket to you Malcom.
It has been assigned to Hugo.
On 30 mar, 08:53, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote:
> On Fri, 2007-03-30 at 01:43 -0700, olive wrote:
> > Hello,
>
> > Here is how I define a form in my views:
>
> > class MyForm
Hi, I'm trying to provide end users with a view into DB (syslog
viewer), well actually I'm trying to imitate Admin part. I have
pagination working, but is there a way how to use the filter bar and
search form from admin part (I love them) in fronted view? I've
searched groups and posts seems to be
Hi,
I have a function in my views.py that expects POST data from a form.
As long as this function is called correctly, i. e. from within the
form, everything works fine. But if I call this function directly by
typing it in the URL, I'm getting an error page complaining about
missing data (which i
On Fri, 2007-03-30 at 03:01 -0700, Helge wrote:
> Hi,
>
> I have a function in my views.py that expects POST data from a form.
> As long as this function is called correctly, i. e. from within the
> form, everything works fine. But if I call this function directly by
> typing it in the URL, I'm g
On Mar 30, 2:37 am, "James Bennett" <[EMAIL PROTECTED]> wrote:
> I guess I'm not sure what's meant by "securing" here; accessing
> anything in the admin app requires the user to be authenticated and
> marked as staff first. And there's really no harm in someone stumbling
> across the admin login
On Fri, Mar 30, 2007 at 03:01:44AM -0700, Helge wrote:
>
> Hi,
>
> I have a function in my views.py that expects POST data from a form.
> As long as this function is called correctly, i. e. from within the
> form, everything works fine. But if I call this function directly by
> typing it in the
On Mar 30, 6:31 pm, Steven Armstrong <[EMAIL PROTECTED]> wrote:
> My understanding is that every apache child pulls in all modules
> (mod_python, mod_perl, mod_php, mod_your_favorite_mod_here) which all
> consume memory. So you end up with loads of processes using ??MB of RAM
> to serve up e.g. a
On 3/30/07, Arvin Schnell <[EMAIL PROTECTED]> wrote:
>
> On Fri, Mar 30, 2007 at 03:01:44AM -0700, Helge wrote:
> >
*SNIP*
> > I wonder if there is a standard way in Django to prevent URLs from
> > being called directly.
>
> You can use the require_POST decorator to ensure that the view
> has some
Hi all,
I've updated to the latested django SVN version 4868 and installing it into my
system I ran the regression test of the same version.
It seems to me that the tests are broken ?
My database is a MySQL 5.0.27 with MySQLDB 1.2.1-p2, Python 2.5 if it matters.
I attached the log results.
Reg
Hey guys,
Thanks a lot for all your answers!
Helge
--~--~-~--~~~---~--~~
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
On Fri, 2007-03-30 at 12:43 +0200, [EMAIL PROTECTED] wrote:
> Hi all,
>
> I've updated to the latested django SVN version 4868 and installing it into
> my system I ran the regression test of the same version.
>
> It seems to me that the tests are broken ?
> My database is a MySQL 5.0.27 with My
Graham Dumpleton wrote on 03/30/07 12:27:
> On Mar 30, 6:31 pm, Steven Armstrong <[EMAIL PROTECTED]> wrote:
>> My understanding is that every apache child pulls in all modules
>> (mod_python, mod_perl, mod_php, mod_your_favorite_mod_here) which all
>> consume memory. So you end up with loads of pr
In my case, it's quite urgent (it must work today), so do you have
any example to execute this external script? Is it simple python
(*.py) files?
I was reading the link you sent, it's really interesting and it could
be useful in a visual progress process, I will try it with another
project.
On Mar 30, 8:26 am, "IvanK" <[EMAIL PROTECTED]> wrote:
> Now I come from the rails camp (obviously deserting :)) and I've been
> wondering does Django has anything like capistrano for automated
> deployment, cause it's really easy with rails to just write "rake
> deploy" and have your production b
Mike,
What comes to mind is an intermediary table, a Many-to_many table.
Design 1:
This design depends on a separate Model that lists the available
plugins, but would require a manual join of the plugin_table_id to
the appropriate model/table. The plugin model tells you which type of
link
Seems that is not possible to disable a subset language in locale
system.
I can't define only the "pt" locale, because if the user uses in his
browser "pt-br" it loads the "pt-br" and not the "pt" that was defined
in LANGUAGE settings:
gettext = lambda s: s
LANGUAGES = (
('pt', gettext('Portu
Let's say I have the files main.py, a.py and b.py
main.py:
---
x="some local value"
import a
...
a.py:
---
x="some other local value"
import b
...
b.py:
---
def test():
print x
--
Is it possible to access the x of the module a.py in the module
On Fri, Mar 30, 2007 at 01:43:41PM +0200, Aidas Bendoraitis wrote:
>
> Let's say I have the files main.py, a.py and b.py
>
> main.py:
> ---
> x="some local value"
> import a
> ...
>
>
> a.py:
> ---
> x="some other local value"
> import b
> ...
>
>
> b.py:
> ---
> def t
Hey Nuno,
On Fri, 2007-03-30 at 11:36 +, Nuno Mariz wrote:
> Seems that is not possible to disable a subset language in locale
> system.
What do you mean by "disable the subset language" here?
> I can't define only the "pt" locale, because if the user uses in his
> browser "pt-br" it loads
Hello,
I've notice the same memory consuption on my servers.
I'm running django appz on 3 LVS loadbalanced mod_python apache http
servers.
If, for instance, I do a maintnance on one of the server Swap is
increasing a lot on the two remaining servers, even if those two
servers should handle the tr
Hello,
Sending email within a view seems to me quite a strange process :)
You should send your emails within a shell python (or whatever)
process.
What I would do ...
I would within my view, write some kind of data to a database or a
text file or whatever.
Then, have a cronjob that check that da
I was looking for how to execute a script and I was just thinking how
to use django code and here is your e-mail! Thank you!
I am just not sure about how to call the shell script.
should I use the os.system(command) or the os.popen ? That seems that
popen just return when I close the script and
I keep getting this error randomly.
The only differences I see from other requests is the
'HTTP_CONTENT_TYPE': 'application/x-www-form-urlencoded' and
POST:.
Is there anyone getting this error?
Is there a solution to this?
I've found a someone with the same issue, but the post is old and I
coul
On 3/30/07, xgdlm <[EMAIL PROTECTED]> wrote:
...
> This week I decided to give a try to a new configuration. I'm now
> running django on lighttpd / fcgi and I have no swap at all.
> So I'm aware the mod_python is the prefered way to use django ... buy
> I'm quite happy with that new server configu
> I am just not sure about how to call the shell script.
I would call the shell script withing a cronjob command :
python /path/to/sendmail.py
this script would do someting roughly like :
-
if there_is_a_mailing_to_send :
for mail in mailtosend :
do
send mail
-
> read from a databa
Thank you, again. Now I think I have enough information to find my way =D
On 3/30/07, xgdlm <[EMAIL PROTECTED]> wrote:
>
> > I am just not sure about how to call the shell script.
>
> I would call the shell script withing a cronjob command :
> python /path/to/sendmail.py
>
> this script would
> > This week I decided to give a try to a new configuration. I'm now
> > running django on lighttpd / fcgi and I have no swap at all.
> > So I'm aware the mod_python is the prefered way to use django ... buy
> > I'm quite happy with that new server configuration :)
>
> Can you give some more deta
On 3/30/07, Enrico <[EMAIL PROTECTED]> wrote:
>
> I keep getting this error randomly.
>
> The only differences I see from other requests is the
> 'HTTP_CONTENT_TYPE': 'application/x-www-form-urlencoded' and
> POST:.
>
> Is there anyone getting this error?
> Is there a solution to this?
Yes, I do
I've been trying to update some existing code to use newforms.
My initial experiment substituting a newforms produced form for a form
created by a custom manipulator worked fine.
However, I ran into some difficulty attempting to use a
form_for_instance produced form to substitute for a changemanip
hello,
I myself hink that your solution with foreign keys is good. the fact
that django requires raw sql to handle left joins is its limitation
but not that of your design.
another solution that comes to mind is to have a table of generic
"attributes" for each patron. this way you will have two
Hi Jeremy,
I get this almost daily.
The 'application/x-www-form-urlencoded' felt weird for a page that
doesn't have forms.
I'm not worried also, just curious. :)
Thanks.
Enrico
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the G
FREE TELE-SEMINAR!
How to create an effective business plan for
Rehabbers/Flippers to be used for obtaining private
money and institutional credit lines.
Lee Salinas, MBA, CPA resides in San Antonio and is a full time real
estate investor. He has purchased over 200 properties since he began
hi
I have written a custom tag.
Here is the code:
register = template.Library()
def bloque_menu(posicion):
def items(bloque, padre):
entradasMenu = bloque.menu_set.filter(padre = padre,visible=1)
salida=""
if entradasMenu:
Hi there,
I'm evaluating Django for a project and the framework fits in many
ways.
However on one issue it would be nice with some help to hand-sew the
glove:
We need multiple types of users. Different profiles and different
permission.
To be more specific: it is a event site where different
> txtfld_attrs_dict = { 'class': 'default_txt_field'}
> contact_first =
> forms.CharField(widget=forms.TextInput(attrs=txtfld_attrs_dict),max_length=25,label=u'Contact
> First')
I figured out the problem, you have to set the dictionary
representation within the widget parameter if you use a
Hello -- I've added a custom method to a model that returns a boolean --
I've tried something like this:
class Liquid(models.Model):
# ...
def ruins_everything(self):
return bool(0)
... which does show up as "False" in the list of the admin.
What I'm wondering is, what would I
Hello, I created a UML to Django Code Generator... If you're
intereseted look at my Blog...
http://andikoerner.blogspot.com/
or get it direct: http://www.jaak.de/upload/DjanGenXML.zip
I would be happy if you would test my program. Will be in svn soon,
but at this
time it's just zipped...
bye,
James Bennett wrote:
> On 3/29/07, Rob Hudson <[EMAIL PROTECTED]> wrote:
>> I can't think of a way to account for "up to last 3 years" and "up to
>> the next 5 years" or variation thereof.
>
> paid_up_until = models.DateField()
>
> Then use Python's standard 'datetime.timedelta' to handle offets
Is it possible to access the POST information from within my forms.py
file after a page submission? I am confused on how to access this
information from within the constructor of if I can even do this.
--
forms.py
--
from django import newforms as forms
class CustomerAdd(
Below I have posted a short form of my modules.
In the admin backend, when a user goes in to the Vehicle form the
company field should be filled with the users own company data but the
admin should still get the select box.
This is a big one then I don't have to create all the forms and can
just
Hi Malcolm,
Simple example:
In my settings.py:
gettext = lambda s: s
LANGUAGES = (
('pt', gettext('Portuguese')),
('en', gettext('English')),
)
Imagine a client accessing to my site with a browser using 'pt-br', my
applications falls in 'pt-br'(because of
'django.middleware.locale.Locale
Frank, you may want to confirm that you can import mysite3 from
Python. You may want to ensure that mysite3 is within your python site-
packages or there is a symbolic link (tougher to do on windows) to the
mysite3 folder. Or place the mysite3 folder (for testing) right in the
site-packages folder
Hi,
I am starting out with django and python, don't have much experience
in either. I have managed to create a few "simple" website with django
and really enjoy working with it.
But I am a bit stuck on my latest project. I am using a M2M relation
via an intermediary table.
http://dpaste.com/hold
Actually the was no circular import since I haven't imported a from b,
but just b from a.
And unfortunately your answer didn't solve the original question,
which is getting the value from the module that imports the current
module.
Or maybe the is a way to include another file and parse it with t
b.py:
import a
...
def test():
print a.x
--
Jeff Bauer
Rubicon, Inc.
On Mar 30, 6:43 am, "Aidas Bendoraitis" <[EMAIL PROTECTED]>
wrote:
> Let's say I have the files main.py, a.py and b.py
>
> main.py:
> ---
> x="some local value"
> import a
> ...
>
> a.py:
> ---
Maybe this leads to nothing and is more-or-less a theoretical
question, but anyway, I'll give you another example:
a1.py
x = "A1"
import b
a2.py
x = "A2"
import b
b.py
-
# the module which imports me is a blackbox to me
def get_the_x_of_the_module_which_is_importing_me
I'm a bit confused by what you're trying to do with the actual data
itself...
I haven't used newforms a great deal yet, but anytime that it has been
necessary to modify data coming in from request.POST I've either done
it within the view itself or within the newforms data validation
system.
for
Hi,
Now I'm trying to write a 'Advanced search' function like this.
http://code.djangoproject.com/query
Because I'm still new to Python and Django
writing flexible query like this is a bit hard.
So I svn checkouted djangoproject.com's source and
tried to look at the custom query's code,
but I c
I am trying to setup field sets on my first project, however, when I
add the admin section below, I get the error "My_blog has no field
named 'e' " This error goes away if I remove the "fields=" from below.
I got the code straight from the documentation, what am I doing
wrong? :\
Thanks!
class M
I am trying to setup field sets on my first project, however, when I
add the admin section below, I get the error "My_blog has no field
named 'e' " This error goes away if I remove the "fields=" from below.
I got the code straight from the documentation, what am I doing
wrong? :\
Thanks!
class M
On 3/30/07, drackett <[EMAIL PROTECTED]> wrote:
> ('more', { 'classes': 'collapse', 'fields' :
> ('entry_date') }),
This line is the culprit; change it to
('more', { 'classes': 'collapse', 'fields' : ('entry_date',) }),
Take note of the comma after 'entry_date'.
The er
This could be a configuration error on my end, but it seems to me to
be a bug (or feature request).
using newforms:
class MyForm(forms.Form):
time = forms.TimeField(input_formats=('%H:%M',))
I want just an hour:minute field. The input works fine, but the output
always outputs %H:%M:%S because
I see.. if there were more than one item in there, the last comma
isn't necessary anymore, correct?
('more', { 'classes': 'collapse', 'fields' : ('entry_date',
'entry_something') }),
On Mar 30, 2:50 pm, "James Bennett" <[EMAIL PROTECTED]> wrote:
> On 3/30/07, drackett <[EMAIL PROTECTED]> wrote:
This situation is greatly helped if the same view displays the form as
well as processes it. So it could look something like this:
def write_entry(request):
form = EntryForm()
if request.POST:
form = EntryForm(request.POST)
if form.is_valid():
... save entry,
I was refering to line 187 (and maybe 184 as well):
170 class TimeField(Field):
171 def __init__(self, input_formats=None, *args, **kwargs):
172 super(TimeField, self).__init__(*args, **kwargs)
173 self.input_formats = input_formats or
DEFAULT_TIME_INPUT_FORMAT
On 3/30/07, Aidas Bendoraitis <[EMAIL PROTECTED]> wrote:
...
> b.py:
> ---
> def test():
> print x
>
> --
> Is it possible to access the x of the module a.py in the module b.py?
> What would be the functions/statements to make it possible? Or in
> general, how to ac
If I have multiple items that I want to use a common model, is there a
way to do this? currently I have:
class Link(models.Model):
author = models.ForeignKey(User)
link = URLField()
description = TextField(blank=True)
entry_date = models.DateTimeField(default=datet
On 3/30/07, Jeremy Dunck <[EMAIL PROTECTED]> wrote:
...
> In general, no. Python is lexically scoped, so that when b.test is
> called, it checks the scope of test, then b, then __builtins__, then
> fails with NameError.
Good intro to scoping, if needed:
http://en.wikipedia.org/wiki/Dynamic_scopi
On Mar 30, 10:12 pm, "Ian" <[EMAIL PROTECTED]> wrote:
> This situation is greatly helped if the same view displays the form as
> well as processes it. So it could look something like this:
>
> def write_entry(request):
> form = EntryForm()
> if request.POST:
> form = EntryForm(req
Here's a few ideas:
Solution 1 - use the __main__ module
The downside to this is that it always reads x from the "top-level"
module, in other words, the script that is being run. So when you run
a1, you'll get "a1" when you run a2 module b will then find "a2".
a1.py
--
import
On 3/30/07, drackett <[EMAIL PROTECTED]> wrote:
> I see.. if there were more than one item in there, the last comma
> isn't necessary anymore, correct?
Correct. The comma is needed on a single-element tuple so that Python
can distinguish between something that's in parentheses for grouping
(e.g.,
On 3/30/07, js <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> Now I'm trying to write a 'Advanced search' function like this.
> http://code.djangoproject.com/query
>
> Because I'm still new to Python and Django
> writing flexible query like this is a bit hard.
> So I svn checkouted djangoproject.com's so
I see what you are saying, but I was trying to do something a little
more complicated. I wasn't trying to validate any data, but rather
load choices into a select box based on information from the POST. I
have 2 select boxes in a form where one has info regarding all the
countries in the world.
On Fri, Mar 30, 2007 at 08:07:51PM +0200, Aidas Bendoraitis wrote:
>
> Actually the was no circular import since I haven't imported a from b,
> but just b from a.
Sorry, mis-read your code, I thought there were only two modules.
> And unfortunately your answer didn't solve the original question,
It's not strongly related to some specific problem, but more to the
better python perception and self-training.
Thank you all for your time and attention. Thank you, Jerremy D, for
the interesting solutions.
Regards,
Aidas Bendoraitis [aka Archatas]
On 3/31/07, Forest Bond <[EMAIL PROTECTED]>
On 30-Mar-07, at 8:45 PM, johncock wrote:
> We need multiple types of users. Different profiles and different
> permission.
this has been repeatedly discussed. The auth.user model gives the
bare essentials. extending this is up to the individual developer. O
course, until model inheritance
Hello,
When I am running the simple current_datetime example from the django
book, and then edit my urls.py to look like the one in the book, the
page doesn't server.
Book urls.py:
from django.conf.urls.defaults import *
f from mysite.views import current_datetime
urlpatterns =
Breakfast at Tiffany's
Movie
Classic
Borat
Movie
Comedy
How do you represent DVD id=1 and it's elements, and DVD id=2 and it's
elements as child of root "Library"?
Like this:?
from lxml import etree
from lxml import objectify
root = objectify.Element("Library")
child[1] = objectify.Eleme
On Fri, 2007-03-30 at 17:05 +, Nuno Mariz wrote:
> Hi Malcolm,
> Simple example:
>
> In my settings.py:
> gettext = lambda s: s
> LANGUAGES = (
> ('pt', gettext('Portuguese')),
> ('en', gettext('English')),
> )
>
> Imagine a client accessing to my site with a browser using 'pt-br', m
On Fri, 2007-03-30 at 09:50 -0700, TaMeR wrote:
>
> Below I have posted a short form of my modules.
> In the admin backend, when a user goes in to the Vehicle form the
> company field should be filled with the users own company data but the
> admin should still get the select box.
>
> This is a
On Fri, 2007-03-30 at 20:34 +, drackett wrote:
> If I have multiple items that I want to use a common model, is there a
> way to do this? currently I have:
>
> class Link(models.Model):
> author = models.ForeignKey(User)
> link = URLField()
> description = TextField(blank=Tr
On Sat, 2007-03-31 at 01:44 +, benrawk wrote:
> Hello,
>
> When I am running the simple current_datetime example from the django
> book, and then edit my urls.py to look like the one in the book, the
> page doesn't server.
>
> Book urls.py:
> from django.conf.urls.defaults import *
> f
On Sat, 2007-03-31 at 01:45 +, johnny wrote:
>
>
> Breakfast at Tiffany's
> Movie
> Classic
>
>
>
> Borat
> Movie
> Comedy
>
>
>
> How do you represent DVD id=1 and it's elements, and DVD id=2 and it's
> elements as child of root "Library"?
> Like this:?
>
> from lxml import etree
> f
On 3/29/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> Hi
> I 'm trying to test django app using built-in django unit
> testing. Some of it make a call to xml-rpc server using xmlrpclib.
> Now, I use django testing framework and can run unit testing except
> that I can't enable in-proce
Those solutions make sense, that was just what I was looking for,
thanks! That should be in the docs somewhere...
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send ema
Hi,
I am trying to export a model's data to XML. To do this I'm using the
model class's _meta.fields. However it doesn't list ManyToManyField
objects. How can I get those?
My code looks something like this-
# returns data of inst in a dict
def get_data(inst):
data = {}
for field in inst._me
On Sat, 2007-03-31 at 05:27 +, Ramashish Baranwal wrote:
> Hi,
>
> I am trying to export a model's data to XML. To do this I'm using the
> model class's _meta.fields. However it doesn't list ManyToManyField
> objects. How can I get those?
>
> My code looks something like this-
>
> # returns
Free international calls to anywhere in the world just for click
http://www.freewebs.com/msmani007/freephonecalls.htm
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send
87 matches
Mail list logo