Hello dear Django community,
I'm desperately trying to get the url template tag working. This is my
template's source code:
http://bitbucket.org/codethief/pybsd/src/e3b41c08ed90/tpl/devices/geraetegruppen.xhtml
And here are my URL settings:
http://bitbucket.org/codethief/pybsd/src/e3b41c08ed90/u
Hello,
I may do something, what the formsets are not intended for.
I have forms which assort data of several different Models.
This is because of aggregating data in logical blocks in the UI.
Additionally I have some fields, which have to be filled dynamically.
There is as well the possibility fo
On Thu, Mar 4, 2010 at 3:08 AM, Wiiboy wrote:
> Hi guys,
> I'm thinking about making multiple views files. I'm just wondering
> whether:
> a. There's any problems with that
> b. many people do it.
>
We do this. It depends on how many views each app has whether it is
necessary or not. I can't rec
mendes.rich...@gmail.com (mendes...@gmail.com) wrote:
> Hello Django Users,
>
> I just tried to upgrade my django version towards the last official
> release Django 1.1.1 and ran into some trouble after the install.
> When i do a runserver first it complained about an AttributeError:
> 'Settings'
On Thu, Mar 4, 2010 at 3:08 AM, coco wrote:
> Hello,
> Is it possible to get some kind of ListField() for some
> django.forms.Form fields ?
>
> Here is a typical example problem involving this. Let's try to make
> the following kind of form (forms.py):
>
> class mytable(forms.Form):
> tags = fo
Wiiboy (jordon...@gmail.com) wrote:
> Hi guys,
> I'm thinking about making multiple views files. I'm just wondering
> whether:
> a. There's any problems with that
> b. many people do it.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
>
Thanks
now it works,
In time i posted the question syncdb did not generated database file
"referenc.db".
Thats i posted the question.
Now it works normally again.
regards,
gintare
On Mar 3, 6:02 pm, Matt McCants wrote:
> For sqlite3, you don't even need to create an empty db. Just put the desir
Kenny Meyer wrote:
> Wiiboy (jordon...@gmail.com) wrote:
>
>> Hi guys,
>> I'm thinking about making multiple views files. I'm just wondering
>> whether:
>> a. There's any problems with that
>> b. many people do it.
>>
>> --
>> You received this message because you are subscribed to the Google
Has anyone ever had any success accessing the django admin site via
either of these tools?
I'm working on a view that will convert a particular dynamically-
generated page in my site to a PDF file, which can then be downloaded
from the server. I originally tried to do this using this reportlab/
p
On Thu, Mar 4, 2010 at 10:39 AM, Kenny Meyer wrote:
> ...
> I would probably have an app tree structure like this:
>
> test_app/
> |-- __init__.py
> |-- models.py
> |-- tests.py
> |-- view
> | |-- __init__.py
> | |-- blog_form_view.py
> | `-- blog_view.py
> `-- views.py
>
> Where my views.py
Thanks,
How about values in database?
Than i am retrieving data from database i am getting:
(3, u' ANN I. PERSSON1', u' MAGNUS W. LARSSON2, STIG STENSTR\xd6M3, B.
JONAS OHLSSON1, LARS SAMUELSON1 AND L. REINE WALLENBERG2 ', u' nature
materials', u' ..
Is it possible to write to databse
On 25 February 2010 07:05, leoz01 wrote:
> Hello,
>
> i have a simple question, how can i get the id attribute (which
> correspond to html id) from a form's field ?
I have this problem too when I wrote my wrapper for my django-ckeditor
app. It seems like an odd oversight, and from what I've read
On 03/03/10 23:35, Merrick wrote:
I wanted to give users who are authenticated the ability to upload
files, that's the easy part that I can handle.
What I cannot figure out is how to restrict the viewing/downloading of
files.
Links, tips, code are appreciated.
This is become quite the FAQ...
On 03/03/10 22:10, Nick wrote:
I am trying to build a search form with multiple filters/input
objects. Basically, i want to be able to allow for a simple searhc
based on one criteria or multiple. So if someone searches the name
field(q) they can filter by political party, or city, etc. Also, I
w
I have a template dir in common with different projects, outside the
projects dir.
Those templates have a locale dir with translations.
In my projects I have only the templates that differs from the common.
The problem is that it cannot use the locale inside the original
template dir, but If I
On Mar 4, 4:45 pm, Joakim Hove wrote:
> About every once a year I am forced out on the internet to read about
> "encodings and such"; while reading about it all makes sense, but when
> actually trying to get things to work I always go through a period of
> swearing and frustration - I never really
Thank you for answering; I had a feeling that some autoescape magic
might be at work.
Unfortunately I do not have the code here, but the django traceback
goes like this:
Environment:
Request Method: GET
Request URL: http://devel.pc-horse.com/NewLicense/47/
Django Versio
One possible solution: write your own Cassandra "O-non-R-M API"
separtely from Django and use the Django DB backend only for less
high-volume data - or not at all - and the Django web framework to
display the data (i.e., only implement views, forms, etc. in Django).
An example of such a layout (not
Hi,
I'm using django 1.0 and I have in my model a foreign key to the User
table. I want to fill this with the user which is creating the entry
and I understood I can do it in the save_model method:
http://docs.djangoproject.com/en/dev/ref/contrib/admin/#django.contrib.admin.ModelAdmin.save_model
Hi!
I've upgraded my Django to 1.2 (1.2-beta-1, tried also trunk) and
after that my application has started to throw an exception:
ValueError: Cannot add "": instance is on database
"default", value is is on database "None".
The code causing the problem is:
(...)
project = form.save()
admin_p
Tom Evans (tevans...@googlemail.com) wrote:
> On Thu, Mar 4, 2010 at 10:39 AM, Kenny Meyer wrote:
> > ...
> > I would probably have an app tree structure like this:
> >
> > test_app/
> > |-- __init__.py
> > |-- models.py
> > |-- tests.py
> > |-- view
> > | |-- __init__.py
> > | |-- blog_form_v
On Thu, Mar 4, 2010 at 1:15 PM, Joakim Hove wrote:
> Thank you for answering; I had a feeling that some autoescape magic
> might be at work.
> ...
> File "/var/www/Django/devel/sleipner/main/license.py" in __init__
> 36. productList.append( (p.id , "%s %s %6.0f %s" %
> (type.local
And you might be confused about what the current working directory is.
It is not,
in general, the directory containing the .py file in which you are
running at the time.
It is (unless explicitly changed) the working directory of the shell
at the time python
was started. For example, if your curre
I think the issue is the "|" characters in your url here:
http://bitbucket.org/codethief/pybsd/src/e3b41c08ed90/devices/urls.py#cl-7
>From
>http://docs.djangoproject.com/en/dev/topics/http/urls/#django.core.urlresolvers.reverse
The reverse() function can reverse a large variety of regular
expres
Check out your database settings. 1.2 adds Multi-DB support and with it a
new way of specifying databases, now it shouldn't be causing issues, since
the pre-1.2 way of specifying a database is going to be supported until 1.4,
it would still be where I started my debugging since it looks like Django
Hi,
I am wondering if it is possible to change template variables before
they get rendered in a template.
For example, I use something like this in my template:
return direct_to_template(request, template='index.html',
extra_context={'form':form})
I would like to extend this form variable before
Write your own view instead of using direct_to_template.
On Thu, Mar 4, 2010 at 10:06 AM, Kevin Renskers wrote:
> Hi,
>
> I am wondering if it is possible to change template variables before
> they get rendered in a template.
>
> For example, I use something like this in my template:
> return dir
Here's another post about a how to connect to wordpress mysql tables
from within Django.
http://uswaretech.com/blog/2010/01/wordpress-and-django-best-buddies/
The author has done all the work of setting up the django models for
you.
With multi-db available in Django 1.2, it is now possible to c
Well yes, but I do not want to change all of my views. I want a
generic solution to change template variables before they get
rendered.
On Mar 4, 4:14 pm, Bill Freeman wrote:
> Write your own view instead of using direct_to_template.
>
>
>
> On Thu, Mar 4, 2010 at 10:06 AM, Kevin Renskers wrote
Write your new view so that it can be used generically.
On Thu, Mar 4, 2010 at 10:22 AM, Kevin Renskers wrote:
> Well yes, but I do not want to change all of my views. I want a
> generic solution to change template variables before they get
> rendered.
>
>
> On Mar 4, 4:14 pm, Bill Freeman wrote
I'll explain a bit more what precisely it is what I want to do: Django
1.2 comes with a new messages framework that allows for each message
to have a different "level" (succes, error, warning, etc). I want to
see if a form has errors, and if so, make a message for each error so
all my notices and e
Hi,
I have a model which starts to have "too many" properties and methods.
I dont know if this is normal or if there are better ways to deal with
increasing complexity of a model.
In the beginning there were just 4 or 5 properties and methods but
with the news demands of the app they started to g
hi,
i'm looking into using AuditTrail (http://code.djangoproject.com/wiki/
AuditTrail) for a project.
it has a system of callbacks to track extra information such as which
user made the changes but it only passes the current instance being
modified and not the request.
my question is therefore: h
sorry, let me rewrite that last part
render_to_response ('%s/index.html' u'theme', {'dictionary':
dictionary})
On Mar 4, 12:11 am, Nick wrote:
> It seems like this would be best handled at the view level, you could
> pass a url variable in the render_to_response portion, maybe something
> like
>
I find it's pretty normal. Some of my models get quite large as well. For
one of my projects I did something like this:
Split models.py into multiple files.
Create a models directory in the app's directory.
Move the model files to that directory.
Create an __init__.py in app/models/
So the struct
This helped me:
http://code.djangoproject.com/wiki/CookBookThreadlocalsAndUser
Shawn
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email
On 4 Mar 2010, at 16:46 , filias wrote:
>
> Hi,
>
> I have a model which starts to have "too many" properties and methods.
> I dont know if this is normal or if there are better ways to deal with
> increasing complexity of a model.
>
> In the beginning there were just 4 or 5 properties and metho
On Wed, Mar 3, 2010 at 4:07 PM, mendes.rich...@gmail.com <
mendes...@gmail.com> wrote:
> Hello Django Users,
>
> I just tried to upgrade my django version towards the last official
> release Django 1.1.1 and ran into some trouble after the install.
> When i do a runserver first it complained about
Djangoids:
Consider this line:
foo = Foo.object.get(name='bar')
If foo is not found, I want it to contain a NullObject, such as an
empty Foo(). In the parlance, that could be like this:
foo = Foo.object.get(name='bar', _default=Foo())
I naturally don't expect (v 1.1.1) of Django to suppo
Thanks
Unfortunately I'm very new to Forms/ModelForms, and I'm having a lot
of difficulty understanding the Django examples.
All I want is to allow my users to make one change to one column. I
don't want them to see the ID, just a text box and a submit button.
Hitting Submit should take them bac
Good day Reinhardt followers,
Short: How can I make a field that renders itself as a pair of input
fields and a custom (not controlled by the user) label.
Long: I am trying to write a new custom field. I will use it for a
captcha-like service. The service works by requesting a question -
then rec
On 4 March 2010 18:02, Phlip wrote:
> Djangoids:
>
> Consider this line:
>
> foo = Foo.object.get(name='bar')
>
> If foo is not found, I want it to contain a NullObject, such as an
> empty Foo(). In the parlance, that could be like this:
>
> foo = Foo.object.get(name='bar', _default=Foo())
>
>
Here's a simple example. It could be improved, but it's meant to be very simple.
#Make a simple form.
class AgeForm(forms.Form):
age = forms.IntegerField()
#When the user submits the form:
age_form = AgeForm(request.POST)
if age_form.is_valid()
#get the pk however you need to
I was updating to the latest SVN and encountered some odd behavior
with a custom gallery image admin inline template. I've narrowed it
down to some dynamic inlines development released in 12297. The
problem is that I don't really know if it merits a feature request or
if I'm missing something.
The
Thanks Shawn
My problem is that Person.save() will do an update of all my columns.
Even though they are all identical, apart from the changed value, this
will violate my minimum privileges requirement of only allowing the
application access to the columns that it is allowed to change - hence
your
1. Doing Person.save() will NOT update every field in your model.
2. Your snippet uses a ModelForm. Mine used a Form. There's a huge difference.
If you use a ModelForm you're going to have to exclude all the fields you don't
want.
3. If you use a ModelForm and instantiate it with request.POST, d
> from django.core.exceptions import ObjectDoesNotExist
txbut... >sigh< I was hoping to head that off - Python's condescending
attitude is in fact the core of the problem.
Even if you wrap all your try: except: up in a method, so it's at
least DRY, is you must consign that method to use .get().
On Thu, Mar 4, 2010 at 12:59 PM, Phlip wrote:
> Doesn't anyone in Django-land have experience with the platforms that
> make this problem incredibly easy?
Most likely, yes. And those people, believe it or not, designed
Django's APIs based on their experiences. This is why there are
shortcuts avai
Thanks for your example, but whilst you're correct about Person.id not
getting updated, all the other columns do get changed (even if it is
to the same value).
Here's my code...
class TcsDetectionListsForm(forms.Form):
name = forms.CharField()
def candidateWithForm(request, tcs_transient_obj
I have yet to try your suggestion, but this looks great! I am really
looking forward to trying it, thanks!!
On Mar 3, 4:54 pm, Jervis wrote:
> On Mar 3, 3:51 pm, slenno1 wrote:
>
> > Hey everyone,
> > I am currently working with a section of a site that takes user
> > input usingDjangoforms
> Most likely, yes. And those people, believe it or not, designed
> Django's APIs based on their experiences. This is why there are
> shortcuts available, like the get_or_create() method (which fetches an
> object or, if none matches, creates a valid one, populated with
> default values you supply,
> Just create your own Manager and override the default (named 'objects') in
> your models. Have 'get' behave any way you like.
>
> http://docs.djangoproject.com/en/1.1/topics/db/managers/
>
> Shawn
Ding!
http://docs.djangoproject.com/en/1.1/topics/db/managers/#adding-extra-manager-methods
luv
Just create your own Manager and override the default (named 'objects') in your
models. Have 'get' behave any way you like.
http://docs.djangoproject.com/en/1.1/topics/db/managers/
Shawn
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post
On Mar 4, 2010, at 12:12 AM, Andy Robinson wrote:
> So, why don't I hear about architectures like this?
Perhaps because it just work.
> Why would I want to use more complex things (CouchDB, ZODB,
> blobs-in-RDBMS-tables)?
Perhaps you would not want to.
> Has anyone built a nontrivial system
Update - it seems that excluding the prefix elements can be done by
excluding forloop.last in addition to formsets that are data bound.
the stacked.html template in contrib mirrors this. While it doesn't
seem to be the futureproof solution I'd hoped for, it does work.
Perhaps the best move would be
Hi
I have a shopping cart application, where by each cart can hold
several kinds of objects, I have therefore used generic relations to
model the application along the lines of below, whereby each cart can
have many cartitems which are linked by a standard foreign key
relationship, the cartitems
2010/3/4 Alessandro Ronchi :
> I have a template dir in common with different projects, outside the
> projects dir.
>
> Those templates have a locale dir with translations.
>
> In my projects I have only the templates that differs from the common.
>
> The problem is that it cannot use the locale i
On Thu, Mar 4, 2010 at 1:43 PM, Phlip wrote:
> And again the condescension. As a programmer, I should be able to
> easily chose between statements that throw and ones that efficiently
> deal with branching conditions. A record-not-found is not a crisis, it
> is just a branching condition. 5 excess
Hi, I'm having a problem after upgrading from Python 2.5 to 2.6
I'm using Gentoo and running a Django app with Apache 2 and mod_python.
After the upgrade I started getting a segfault when I try to access
the site, Apache starts fine and can serve static pages.
I've tried moving the site to mod_ws
On Mar 4, 2010, at 2:56 PM, aditya wrote:
> I would like to add a new filter for models to my django build that
> can be used as follows:
>
> tags = ['tag1','tag2','tag3''tagn']
> i = Image.objects.filter(tags__contains_any=tags)
>
>
> Essentially, instead of passing a string, I pass a list
Start by reading:
http://code.google.com/p/modwsgi/wiki/InstallationIssues
http://code.google.com/p/modwsgi/wiki/ApplicationIssues
http://code.google.com/p/modwsgi/wiki/DebuggingTechniques
Various reasons for crashes are documented and also pointers to how to
configure Apache/mod_wsgi to ge
My model for a location has attributes for latitude and longitude -
when the admin change form is used for editing, I'd like to include a
url assembled from these attributes i.e.:
"http://www.myserver.com/map/map.py?lat=&lon="
The (non-django) page map.py already exists, I just want to build the
l
> The only condescension I've seen in this thread is from you. And, to
> be fair, if I wanted to be condescending I'd have simply pointed you
> at Tony Hoare's explanation of null values
That's why I said NullObject, in the first post.
--
You received this message because you are subscribed to t
Get the URL, preferably by using an absolute_url method of the model.
Then do something like this:
from urllib import urlencode
attrs = {
'latitude': address.latitude,
'longitude': address.longitude,
}
map_link = "%s?%s" % (urlencode(attrs),)
Shawn
On Mar 4, 2010, at 5:
If the question is answered to your satisfaction, why don't we drop the thread
now and avoid the personal stuff?
There is nothing to be gained by arguing with a respected core Django
developer, and nothing the rest of us will learn from it.
Thanks,
Shawn
--
You received this message because
Hello all,
So I'm making a sort of FAQ, with a hierarchical category structure:
28 class
SupportCategory(models.Model):
29 title =
models.CharField(max_length=100)
30 slug =
models.CharField(max_length=100)
31 parent = models.ForeignKey('self', blank=True,
null=True,
32 r
Hi,
has anyone got any pointers on good - preferably localisable -
integrations between a Django web-site and online payment system?
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-us...@googl
Hello Karen,
On my computer at home i indeed had installed a very old version,
I think it was the 0.97-pre-svn version.
Because al the applications i build were on external servers i don't
have to worry about code changes fortunately.
But i thought it was strange that when i installed the newest
I think it really depends on the payment system. Most all of them I've
dealt with have some sort of API. Tap into that, and away you go.
Localizable could be interesting, though, just due to currencies and
such. I built one that handled shipping to different areas (US,
Canada, Intl), but all funds
Satchmo is a full implementation of an ecommerce solution -
http://www.satchmoproject.com/
More recently, Bruce has been working to split out the payment modules to
django-bursar - http://bitbucket.org/bkroeze/django-bursar/overview/ which
might be more of what you are looking for in this case.
-
Peter Herndon wrote:
> Won't the "in" filter do exactly what you need?
>
> http://docs.djangoproject.com/en/1.1/ref/models/querysets/#in
Why do you need even __in? Given...
Entry.objects.filter(id__in=[1, 3, 4])
...couldn't id=[] overload if the target is a list?
--
Phlip
--
You received
Thanks for the quick response, but I am truly lost ... This logically
seems like part of a view - should I create a custom view extending
the normal admin view and add code as you suggested? If not, where
would this go.
Sorry to be slow,
J
On Mar 4, 5:34 pm, Shawn Milochik wrote:
> Get the URL,
On Thu, Mar 4, 2010 at 9:54 PM, eXt wrote:
> Hi!
>
> I've upgraded my Django to 1.2 (1.2-beta-1, tried also trunk) and
> after that my application has started to throw an exception:
> ValueError: Cannot add "": instance is on database
> "default", value is is on database "None".
>
> The code cau
On Mar 4, 2010, at 6:07 PM, Phlip wrote:
> Peter Herndon wrote:
>
>> Won't the "in" filter do exactly what you need?
>>
>> http://docs.djangoproject.com/en/1.1/ref/models/querysets/#in
>
> Why do you need even __in? Given...
>
> Entry.objects.filter(id__in=[1, 3, 4])
>
> ...couldn't id=[] o
Thanks for your answer. Unfortunatelly I get the same error using
DATABASES dict.
It is actually very strange. After I had used pdb and went through the
code slowly there were no error! However during normal execution there
is still a problem. I found that something goes wrong inside
allow_relatio
Following instructions at
http://www.howtoforge.com/how-to-install-django-on-fedora9-apache2-mod_python
and
http://docs.djangoproject.com/en/1.1/howto/deployment/modpython/
I cannot get past the error:
ImportError: Could not import settings 'mysite.settings' (Is it on
sys.path? Does it have synta
> > Entry.objects.filter(id__in=[1, 3, 4])
>
> > ...couldn't id=[] overload if the target is a list?
>
> I suppose it could if it were written that way, but it isn't. The filter
> form "filter(=)" is shorthand for the form
> "filter(__exact=)". To my knowledge, no one has written an
> operat
Folks
I need to get my users to submit a form, the result of which is a an
update of one column of one row of my database table. For security
reasons the Django database user only has privileges to update a
single column of this table (and select privs on the rest).
However, when I submit the fo
On Thu, Mar 4, 2010 at 2:24 PM, Ken wrote:
> Thanks for your example, but whilst you're correct about Person.id not
> getting updated, all the other columns do get changed (even if it is
> to the same value).
>
> Here's my code...
>
> class TcsDetectionListsForm(forms.Form):
>name = forms.Cha
On Thu, Mar 4, 2010 at 7:13 PM, RocB wrote:
> [snip]
> I have check the python path, I even printed our sys.path from "/usr/
> lib/python2.6/site-packages/django/conf/__init__.py, it looks like:
>
> ['/home/mycode', ...
>
So based on your config I'm assuming you have a mysite directory under
/ho
I answered your question in the other thread you had asking the exact same
thing.
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-us...@googlegroups.com.
To unsubscribe from this group, send emai
So I've got that the consensus here is to add a 'views' folder, and
add my views files in that.
Thanks for the help.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscr
Hi,
I am using Django 1.1. When I create a form, the initial data is set
when the class is created. It does not get updated when an object is
created. The following can demonstrate:
>>>
>>> import datetime
>>> from django import forms
>>>
>>> datetime.datetime.now()
datetime.datetime(2010, 3, 4,
Hello all!
I'm new to Django, and loving it! The documentation is fantastic, and
I've had no problems so far.
The admin interface does 95% of what I need, but I've gone really deep
into the documentation, and the remaining 5% eludes me. This is fine
as I've decided to write "regular" django pages
2010/3/4 Alejandro Recarey :
> Hello all!
>
> I'm new to Django, and loving it! The documentation is fantastic, and
> I've had no problems so far.
>
That's great to hear.
> The admin interface does 95% of what I need, but I've gone really deep
> into the documentation, and the remaining 5% eludes
I've got some very simply templates in which marking strings as
translatable is not working. For example:
--- snip
{% extends "base.html" %}
{% load i18n %}
{% block content %}
{% trans "Password reset successful" %}
{% trans "You successfully resetted your password. A confirmation mail
has be
It works! 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-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visi
Thanks! Ill give it a try
On Mar 4, 11:04 am, Nick wrote:
> sorry, let me rewrite that last part
>
> render_to_response ('%s/index.html' u'theme', {'dictionary':
> dictionary})
>
> On Mar 4, 12:11 am, Nick wrote:
>
> > It seems like this would be best handled at the view level, you could
> > pas
Not quite, because 'in' does exact matching, and I'm looking for the inexact
matching that 'contains' provides. Here's one way to simulate a
'contains_any' filter:
t = ["acrylic","watercolors"] # my list of tags
q = Q(tags__name__contains=t[0])
for i in range(1,len(t)):
q =
Posting this question made me rethink the problem... And it was a very
small mistake: {% trans "..." %} is not able to mark multilined...
Just use one line and everything will work.
Hope this helps someone :-)
Alex
On 5 Mrz., 04:19, Alex wrote:
> I've got some very simply templates in which mar
Ok, I've reopened a ticket here http://code.djangoproject.com/ticket/12883
adding some required informations.
On 5 Mar, 00:41, Russell Keith-Magee wrote:
> On Thu, Mar 4, 2010 at 9:54 PM, eXt wrote:
> > Hi!
>
> > I've upgraded my Django to 1.2 (1.2-beta-1, tried also trunk) and
> > after that
91 matches
Mail list logo