Thinking myself clever I added enumerate as a filter and did:
{% for i, item in menu_items|enumerate %}
{% ifequal i|add:1 menu_items:length %} class="last-item"{% endifequal
%}
To me I expect it to be true only for the last item, I printed {i|add:
1} and it works as expected. However, what happ
On Jul 27, 2007, at 10:36 PM, Greg wrote:
> AssertionError at /rugs/cart/addpad/
> [u'0']
>
> Does that mean that the value is 0? below is my view function and
> template code:
That little 'u' in front of the '0' means unicode so the value is the
unicode string "0" not the number zero. Very di
Nathan,
Thanks for the iteritems() method. I implemented that into my code.
However, 'if values != 0:' never evaluates to False. Even though some
of the forms elements values are 0. For example when I do a assert
False, values on one of those elements I see:
AssertionError at /rugs/cart/addpad
James Bennett wrote:
> On 7/27/07, Duc Nguyen <[EMAIL PROTECTED]> wrote:
>
>> One facebook in america is enough. There is plenty of room for
>> competition in other countries.
>>
>
> Yes, but a straight-up clone of Facebook isn't the way to do it.and be
> prepared not to say "we're just
Excellent, I have it figured out... or I should say, I have it
working. I'm not sure I have it set up correctly, but at least it's
working.
At first I couldn't figure out how the view source was going to help
me. I mean, I can point the css wherever I want, but trying to access
the css files di
In what context are you talking about?
Although Apache needs / to be used in Location paths, ie., URLs, it is
actually quite tolerant of DOS style \ being used in native file
system paths in DocumenRoot, Directory and other directives. Python
itself is also somewhat tolerant of / and \ being mixe
> And yes, facebook has been cloned in other countries, many, many times.
> The most famous one is from china: http://xiaonei.com/ Not only did
> they clone the features, they cloned the interface. It even got
> acquired for lots of money.
Or in Germany StudiVZ, which also got acquired. As some
I had the need to generate a few different types of charts using
ReportLab. The wiki only had a sample of a Horizontal Bar Chart, so
I've added a new sample on how to produce a Line Chart...
http://code.djangoproject.com/wiki/Charts
If anyone is interested in a sample for a Pie or Scatter chart,
On 7/28/07, Robert <[EMAIL PROTECTED]> wrote:
>
> Hi all-
> I'm very new to django, so pardon my faulty nomenclature!
> I'm trying to create a view that creates a guides the user through
> inserting some information into a table in my database. One of the
> columns in my database model is of the t
On 7/27/07, Duc Nguyen <[EMAIL PROTECTED]> wrote:
> One facebook in america is enough. There is plenty of room for
> competition in other countries.
Yes, but a straight-up clone of Facebook isn't the way to do it.
Facebook succeeded because it chose a specific target market and
oriented itself
Hi all-
I'm very new to django, so pardon my faulty nomenclature!
I'm trying to create a view that creates a guides the user through
inserting some information into a table in my database. One of the
columns in my database model is of the type "models.FileField()". When
I try to use the "auto-gene
On 28/07/07, Steve <[EMAIL PROTECTED]> wrote:
> I am on a shared hosting environment, and am attempting to make use of
> the textile filter. I have installed the textile library in $HOME/lib/
> python2.3/site-packages, which is on my $PATH, and my $PYTHONPATH. I
> can import textile through the py
I'm not sure if I'm following what your saying...but this is what I
think you want to do:
if request.method == 'POST':
pads = request.session.get('pad', [])
for pad in pads:
if request.POST[pad.id] <> '---': # the select
name should be the pad id
request.POST is a dictionary, not a list, so a for loop like yours is
iterating over the keys of the dict. to get the values, you can do:
for value in request.POST.itervalues():
to iterate over both keys and values:
for a, value in request.POST.iteritems():
On Jul 27, 2:54 pm, Greg <[EMAIL PRO
I am on a shared hosting environment, and am attempting to make use of
the textile filter. I have installed the textile library in $HOME/lib/
python2.3/site-packages, which is on my $PATH, and my $PYTHONPATH. I
can import textile through the python interactive interpreter and
execute it correctly.
On 7/27/07, Andrey Khavryuchenko <[EMAIL PROTECTED]> wrote:
>
> Then I've paused and wrote DbMock class for django that uses some black
> magic to steal django db connection and substitute it with temporary sqlite
> in-memory db.
How is this different to the default Django behavior if you specify
Hi group,
I am converting one old application from excel to django.
Almost all sorted but can't figure out how to find closest math in
query like in excel:
"=INDEX(TABLE5,MATCH(C203,CMW,1),MATCH(Sheet1!J26,CMH,1))"
All tables in models relate to pricelisttable
class PriceListTable(models.Model)
John DeRosa wrote:
> Ick! Why would you want to? Isn't one facebook in the world enough? :-)
>
One facebook in america is enough. There is plenty of room for
competition in other countries.
--~--~-~--~~~---~--~~
You received this message because you are sub
i'm working on an app that has a table called friends whose model
looks like this:
class Friend(models.Model):
user = models.ForeignKey(User)
friend = models.CharField(maxlength=100)
status = models.CharField(maxlength=1,choices=FSTATUS_CHOICES)
def __str__(self):
return
Ick! Why would you want to? Isn't one facebook in the world enough? :-)
[EMAIL PROTECTED] wrote:
> Is it possible to develop a Facebook functional clone in Django? What
> parts of it are provided out of the box? Any third-party contributions?
>
>
> >
>
>
--~--~-~--~~-
To get a list out of post you need to do:
request.POST.getlist('fieldname') and not request.POST['fieldname']
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email
> So my question is am I missing something or I was just expecting too
> much from the newforms?
I had similar problems initially, and after hundreds of forms built I
still get annoyed every time I have to build a newforms form. On the
other hand, I can't really think of a better way to do it ei
Hi,
Blow is a screen paste of server log for a small project I am working
on. I am just printing the httpRequests POST data.
Django version 0.96, using settings 'rsync.settings'
Development server is running at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
httpr.POST =
str(httpr.POST)
I'm trying to loop through my POST data. However I am having
difficulties. I think my 'for' statement might be wrong. Below is my
function and template code
View function
def addpad(request):
if request.method == 'POST':
pads = request.session.
Hi Greg,
Make sure you are consistently using tabs or spaces for indentation.
Most people set their editors to replace a tab with four spaces. I
would recommend this configuration. Python will get confused if you
start mixing tabs and spaces.
-Benjamin
On Jul 27, 2:59 pm, Greg <[EMAIL PROTECTED]
This is great, Chris, but the fact of the matter is that it won't
appeal to the "Wordpress crowd".
That group wants in-browser setup, easy plugin architecture etc.
contrib.admin wouldn't do the trick. The admin-panel would have to be
hand made.
For the plugin architecture: I have no idea how we'd
I have the following view:
def addpad(request):
if request.method == 'POST':
pads = request.session.get('pad', [])
i = 1
b = 1
for a in request.POST:
if a != '---':
opa
> I just added it to the wiki:
>
> http://code.djangoproject.com/wiki/BestPracticesToWorkWith3rdPartyAppsAndMakingYoursPortable
Looking there, I think you made a typo. The directory diagrams for
specific apps and generic apps are the same.
Furthermore, I can see how this system worked for you u
>
> Creating a template tag [1] might be a good idea here, especially if
> you will be displaying a list of events on any other pages.
>
> In your view, you would have:
>
> future_events =
> Event.objects.filter(start_date__gte=now).sort_by('start_date')
> return render_to_response('clubs/events.h
I use the following:
my pythonpath includes /usr/local/lib/django/
within which I have:
apps/
app1/(models,views,urls)
app2/(models,views,urls), etc.
vhosts/
vhost1/(settings,urls)
vhost2/(settings,urls), etc.
within the config for each apache virtual host
On 7/27/07, Jos Houtman <[EMAIL PROTECTED]> wrote:
> Is this possible without denormalization of the data model or is my only
> viable option in writing a separate view?
edit_inline doesn't nest, so those are (unfortunately) your only two choices.
Jacob
--~--~-~--~~~
On Jul 26, 1:22 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> In my view, I have:
> future_events = Event.objects.filter(start_date__gte=now)
> pacific_events = future_events.filter(club__region='Pacific')
> rocky_mountain_events = future_events.filter(club__region='Rocky
> Mountain
Hi everyone,
I'm trying to use PyDev to debug my Django project. I have followed
the instructions from Fabio:
http://pydev.blogspot.com/2006/09/configuring-pydev-to-work-with-django.html
Running the configuration he describes seems to work. It starts the
development server. However, the debugger
You can clone facebook in any programming language using any framework
you want. Django is one of the many frameworks which you can use to do
it.
And yes, facebook has been cloned in other countries, many, many times.
The most famous one is from china: http://xiaonei.com/ Not only did
the
A localised version would make sense in a country where most people
don't speak English
On 27 июл, 19:55, "James Bennett" <[EMAIL PROTECTED]> wrote:
> On 7/27/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> > Is it possible to develop a Facebook functional clone in Django? What
> > parts of
a localised version would make sense in a country where people mostly
don't speak English
On 27 июл, 19:55, "James Bennett" <[EMAIL PROTECTED]> wrote:
> On 7/27/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> > Is it possible to develop a Facebook functional clone in Django? What
> > parts o
You can define a list of valid keys to look for:
keys = ['one', 'two', 'three', 'four', 'five']
for key in keys:
if not key in request.POST:
continue
.. do stuff ..
Or you can delete the keys you don't want before looping:
for key in ['x', 'y', 'submit']:
del request.POST[key]
for key
> {% for a in pad %}
>
>
>
I would suggest adding a prefix to that name:
This way, when you are looping through your request.POST dictionary
keys, you can skip keys that don't start with "pad-" that will prevent
your loop from breaking if you get unexpected keys in the form post.
--~--
Hello,
May be what I am going to say is completely stupid but if it is the
case please let me know why :-)
I face the situation several times in the last weeks that I was
willing to build a "complex" form, not directly related to a model.
This forms had the following requirements: it should be
I just added it to the wiki:
http://code.djangoproject.com/wiki/BestPracticesToWorkWith3rdPartyAppsAndMakingYoursPortable
It's available in the resources page.
http://code.djangoproject.com/wiki/DjangoResources
Best,
Sebastian Macias
On Jul 26, 12:36 pm, Carl Karsten <[EMAIL PROTECTED]> wr
Hello,
just for the sake pay attention to the difference between "\" and "/".
If I remember well ONLY "/" will work.
yml
On Jul 27, 10:59 am, Graham Dumpleton <[EMAIL PROTECTED]>
wrote:
> On Jul 27, 6:31 pm, Graham Dumpleton <[EMAIL PROTECTED]>
> wrote:
>
>
>
> > On Jul 27, 4:09 pm, devjim <[EM
Hello,
This is the webpage you are looking for:
http://www.djangoproject.com/documentation/settings/
you should read the section called : "The django-admin.py utility" and
according to the os you are running you should set this variable.
I hope that help
On Jul 27, 3:11 pm, arf_cri <[EMAIL PRO
Recently I've encountered the following error:
--
Traceback (most recent call last):
File "/usr/local/lib/python2.5/site-packages/mod_python/importer.py",
line 1537, in HandlerDispatch
default=default_handler, arg=req, si
On 7/27/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Is it possible to develop a Facebook functional clone in Django? What
> parts of it are provided out of the box? Any third-party contributions?
This is like going to a company that sells construction equipment and
saying "is it possible t
Hi Haku,
On 7/27/07, Haku <[EMAIL PROTECTED]> wrote:
>
> I'm quite new to python and django.
>
> How can i add a custom filter? I've found one that i need (
> http://www.djangosnippets.org/snippets/192/ ) bt i dunno how to use it.
Here is the documentation:
http://www.djangoproject.com/documenta
I'm quite new to python and django.
How can i add a custom filter? I've found one that i need (
http://www.djangosnippets.org/snippets/192/ ) bt i dunno how to use it.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
I do hardcore test-driven development and hate when tests hit my mysql
database (even local one). Things get only worse when testcases start
demanding radically different datasets.
Then I've paused and wrote DbMock class for django that uses some black
magic to steal django db connection and sub
Just as you said, all my html files are using utf-8. So it is OK at
this time.
But some part of our program needs to handle the data from other web
site. That is, those forms are in some HTML pages (or programs) that
we cannot control. They will use GB2312 encoding definitely.
So we still need
>> but those min max constraints are so common? why not include
>> it?
>
> Because "common" is different for any given user and/or site.
> I think *I've* only written a single form with min/max
> validation, FWIW. Designing a framework is hard; you've got to
> search for things that are as close
Jacob,
Yep that was it. If I shouldn't assume anything from the browser.
Then how would I loop through the contents of my data? Below is my
view and template file
/
This code is in my template file
{% for a in pad %}
---
1
2
3
4
5
{{ a.size }} -- ${{
On Jul 27, 2:35 pm, braveheart <[EMAIL PROTECTED]> wrote:
> script process the input and forwards the output result to django; the
> result is stored in a database or displayed on the page.
Have the vbscript write to the same database django reads from or just
output to a logfile that django kno
Greg skrev:
> I post some info to a view. When I do a 'assert False, request.POST'
> I see the following
>
> [u'2'], u'5': [u'2'], u'4': [u'3'], u'7': [u'---'], u'6': [u'2'],
> u'y': [u'4'], u'8': [u'---']}>
>
> It should only have 8 keys (1 through 8). Instead I see the keys 'x'
> and 'y'? It
On 7/27/07, james_027 <[EMAIL PROTECTED]> wrote:
> but those min max constraints are so common? why not include it?
Because "common" is different for any given user and/or site. I think
*I've* only written a single form with min/max validation, FWIW.
Designing a framework is hard; you've got to s
On 7/27/07, Greg <[EMAIL PROTECTED]> wrote:
> It should only have 8 keys (1 through 8). Instead I see the keys 'x'
> and 'y'? It's causing a problem when I try to loop through my POST
> data.
>
> Does anybody know why this is happening?
You're probably using an - those send along x/y
coords of
Thanks. I knew it was simple, and I'd seen it before, but couldn't
remember or find it.
On Jul 27, 9:33 am, "Jonathan Buchanan" <[EMAIL PROTECTED]>
wrote:
> > I just know this is a dumb question, and I've seen this done
> > somewhere, but what I'm after is something like
>
> > GpUser.objects.filt
Access 1000's of Television Channels From All Over The World
Watch all your favorite shows on your Computer from anywhere in the
World!
Save 1000's of $$$ over many years on cable and satellite bills.
INSTANT DOWNLOAD
Learn More About it at Link below:
http://freetvonpc.50webs.com/
--~--~--
Access 1000's of Television Channels From All Over The World
Watch all your favorite shows on your Computer from anywhere in the
World!
Save 1000's of $$$ over many years on cable and satellite bills.
INSTANT DOWNLOAD
Learn More About it at Link below:
http://freetvonpc.50webs.com/
--~--~--
I post some info to a view. When I do a 'assert False, request.POST'
I see the following
It should only have 8 keys (1 through 8). Instead I see the keys 'x'
and 'y'? It's causing a problem when I try to loop through my POST
data.
Does anybody know why this is happening?
Thanks
--~--~---
> I just know this is a dumb question, and I've seen this done
> somewhere, but what I'm after is something like
>
> GpUser.objects.filter('image'=True)
>
> To only get the Gpuser objects that actually have an image, rather
> than all of them. Can someone point me in the right direction?
GpUser.o
b> Does someone have a solution ?
Have you tried subprocess module mentioned before? What was your
experience?
BTW, it's nothing django-specific in calling external software from your
python app...
--
Andrey V Khavryuchenko
Django NewGate - http://www.kds.com.ua/djiggit/
Devel
I just know this is a dumb question, and I've seen this done
somewhere, but what I'm after is something like
GpUser.objects.filter('image'=True)
To only get the Gpuser objects that actually have an image, rather
than all of them. Can someone point me in the right direction?
--~--~-~--~
On Fri, 27 Jul 2007 05:42:12 -0700, Gilbert Fine wrote:
> I used django rev. 5559 for some time. After svn up today, I found
> CharField's cleaned_data is unicode. I think it is a good idea.
> Actually, I made this conversion in my source program.
>
> The only question is how to specify encoding
unsubscribe
--~--~-~--~~~---~--~~
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
For the following data relations System -< Nic -< Ip (where -< means
OneToMany)
Using edit_inline it is already possible to view the nics in the system
detail page,
but I would also like to see which ip's are associated with the listed
nic's.
Something similar is already in place when inli
I forgot to say that I don't know how to make it work... if it is not
obvious :).
On Jul 27, 3:07 pm, arf_cri <[EMAIL PROTECTED]> wrote:
> Traceback (most recent call last):
> File "/usr/bin/django-admin.py", line 5, in ?
> management.execute_from_command_line()
> File "/usr/lib/python2.
Traceback (most recent call last):
File "/usr/bin/django-admin.py", line 5, in ?
management.execute_from_command_line()
File "/usr/lib/python2.4/site-packages/django/core/management.py",
line 1563, in execute_from_command_line
from django.utils import translation
File "/usr/lib/pytho
This is possible thank you for the heads up I will check that out.
--~--~-~--~~~---~--~~
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 unsubscr
I have got the idea what I have to do. I thought that it can be easier
with some option for dump command. However thank you for this
information. I will try to copy the stuff which I need.
Nader
On Jul 27, 1:27 pm, Tim Chase <[EMAIL PROTECTED]> wrote:
> > I have two different database file, so I
I used django rev. 5559 for some time. After svn up today, I found
CharField's cleaned_data is unicode. I think it is a good idea.
Actually, I made this conversion in my source program.
The only question is how to specify encoding of the string sent from
client browser? My users almost certainly
I know that can be solved with python also, but i have to call from
django almost 50 VBScripts (that are functional). I don't want to
rewrite all that scripts to python, cause i don't have time for this.
And I also have a huge library of vbscripts so if i will need a new
script in the future i w
> I have two different database file, so I can't copy it. I would like
> to extract only the data of the app which I would port to other
> machine.
I'm not sure how you ended up with two database files. However,
I suspect Daniel has the right idea: just copy the .db
file. If there's stuff in t
How can I dump not the whole database, but a portion (only the
information of one application) of of it?
On Jul 27, 12:56 pm, Hodren Naidoo <[EMAIL PROTECTED]>
wrote:
> Just do a dump, and source the script into a newly created database
> instance.
>
> On Fri, 2007-07-27 at 11:50 +, Nader wr
I have two different database file, so I can't copy it. I would like
to extract only the data of the app which I would port to other
machine.
On Jul 27, 1:04 pm, Daniel Ellison <[EMAIL PROTECTED]> wrote:
> Nader wrote:
> > But how about the content of my database? I
> > have used 'sqlite3' as a
Nader wrote:
> But how about the content of my database? I
> have used 'sqlite3' as a database engine.
> Could somebody tell me how I can do this?
If you're using sqlite3, wouldn't it simply be a matter of copying your
.db file to the new location?
--~--~-~--~~~---~-
Is it possible to develop a Facebook functional clone in Django? What
parts of it are provided out of the box? Any third-party contributions?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To
Just do a dump, and source the script into a newly created database
instance.
On Fri, 2007-07-27 at 11:50 +, Nader wrote:
> Hallo,
>
> I have an application on a computer at my work and I would like to
> port it to an other machine (a laptop). I can copy the source files
> (model.py, urls.py
Hallo,
I have an application on a computer at my work and I would like to
port it to an other machine (a laptop). I can copy the source files
(model.py, urls.py, *.html and configuration files) from first
machine to the second. But how about the content of my database? I
have used 'sqlite3' as a
Hi django fellows,
I scubclassed django's User model to create my own more complicated
model, I set it as my AUTH_PROFILE_MODULE in settings and I also wrote
my own backend to authenticate against this new class. So far no
problems. However, I also overrode User's Admin class and changed the
'fie
> I really love Django admin, however how can I add customer validation
> or contraints to my models?
I am coding for the GSoC Check constraints projecthere is a link
to the project site.
http://code.google.com/p/django-check-constraints/
Cheers
Thejaswi Puthraya
--~--~-~--~~--
On Jul 27, 6:31 pm, Graham Dumpleton <[EMAIL PROTECTED]>
wrote:
> On Jul 27, 4:09 pm, devjim <[EMAIL PROTECTED]> wrote:
>
> > Mod_python is working and I have this in my http.conf
> >
> > SetHandler python-program
> > PythonHandler django.core.handlers.modpython
> > SetEnv DJANGO_SETT
On Jul 27, 4:09 pm, devjim <[EMAIL PROTECTED]> wrote:
> Mod_python is working and I have this in my http.conf
>
> SetHandler python-program
> PythonHandler django.core.handlers.modpython
> SetEnv DJANGO_SETTINGS_MODULE testproj.settings
> PythonDebug On
> PythonPath "['c:d
westymatt wrote on 07/27/07 06:41:
> Yeah its the webserver for olr not the public site. The django server
> seems like a good start, just add ssl and logging ect, and lots of
> security enhancements
Maybe the standalone WSGI server of CherryPie already does what you need?
http://www.cherrypy.o
On Jul 26, 4:24 pm, Nis Jørgensen <[EMAIL PROTECTED]> wrote:
> AnaReis skrev:
>
> > Hi all!
> > I have a delete that isn't working properly. It deletes more than 1
> > register when it shouldn't because I'm specifying the primary key in
> > the filter.
> > The class file is this:
> > class UserI
Nis Jørgensen wrote:
> As others have said, you can stuff things into request.session (after
> adding the right middleware incantations).
Using the session middleware looks far better but it will take me a while to
try that
out. I'll try and do that next week.
> What is so bad about leaving th
On 27-Jul-07, at 1:21 PM, james_027 wrote:
> I really love Django admin, however how can I add customer validation
> or contraints to my models?
there is an on-going GSoc project for this - and a thread on this
list started yesterday. You could check that out
--
regards
kg
http://lawgon.li
Michael Lake skrev:
> Hi all
>
> Nis Jørgensen wrote:
>
>> The argument to HttpResponseRedirect is a url. You seem to be confusing
>> it with a template.
>>
>
> OK I can do this:
>
> code
> # some error occurs
> message = 'You have ... tell admin that '
>
Hi,
I really love Django admin, however how can I add customer validation
or contraints to my models?
Thanks
james
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send
we are using a context_processor.
e.g., the view for a login-page could look like this:
if everythins is ok:
request.session['messages'] = ['message', 'You are logged in.']
return HttpResponseRedirect(referer)
else:
messages = ['er
Ah does this way seem sensible?
> Nis Jørgensen wrote:
>>The argument to HttpResponseRedirect is a url. You seem to be confusing
>>it with a template.
code
# some error occurs
return HttpResponseRedirect('error/2/')
def error(request, message):
{
error_messages = {
'1': 'Yo
I am a newbie of django.
In my opinion, it means the CacheMiddleware module process shoule
after the
SessionMiddleware .
According to WSGI specification, CacheMiddleware shoule be the
"client" of the
SessionMiddleware. So we should put CacheMiddleware before
SessionMiddleware .
On 7月14日, 下午4
90 matches
Mail list logo