On Dec 20, 2:22 pm, Todd Blanchard wrote:
> I think what i actually want is a form set, but I don't find that all that
> well done either.
>
> What I'm finding lacking is the ability to put a master/detail relationship
> in a single form. For instance, Author/Books.
You
Hello Tim,
On Dec 19, 6:28 am, Tim Daniel wrote:
> Brian & Creecode Django Custom management commands are really the same
> as this:
>
> from django.core.management import setup_environ
> import settings
> setup_environ(settings)
>
> or am I wrong? I'm just running the
Found this (old) post
http://oebfare.com/blog/2008/feb/23/changing-modelchoicefield-queryset/
So i tried
class Post(models.Model):
blog = models.ForeignKey(blog)
.
url = models.ModelChoiceField
(queryset=Image.objects.values_list())
def __init__(self, *args,
I think what i actually want is a form set, but I don't find that all that well
done either.
What I'm finding lacking is the ability to put a master/detail relationship in
a single form. For instance, Author/Books. Furthermore, I don't see a nice
way to work with dynamically expanding forms
Clear as mud. Where does it show how I update two objects in one form?
On Dec 19, 2009, at 1:16 PM, Antoni Aloy wrote:
> 2009/12/19 Todd Blanchard :
>> How does this solve the problem of having two related objects that have the
>> same attribute name (like "name") on the
Hi, I have ported some haml concepts to Python in my implementation of
SHPAML. Details here:
http://shpaml.webfactional.com/
For those of you not aware of haml, haml is a markup language
implemented in Ruby that allows you to eliminate end tags in HTML.
Like Python itself, haml and SHPAML use
Hey just a newbie question about the design of the models.py What is
the best way to use the result of objects.values_list for a choices
model ?
** shell ***
In [1]: from photos.models import Image, Pool
In [3]: Image.objects.values_list('image')
Out[3]:
On Dec 18, 2009, at 10:15 AM, Peter Herndon wrote:
>>
>> The error message came from command: python manage.py syncdb
>> Creating table ldap_groups_ldapgroup
>> Traceback (most recent call last):
>>
> [snip]
>> cx_Oracle.DatabaseError: ORA-02329: column of datatype LOB cannot be
>> unique or a
Thank you very much for your quick response. That seems to have fixed
it. The site I used was
http://codemagnet.blogspot.com/2008/12/py-association-in-vistawindows-missing.html
. I had to go into the windows registry, into the Computer/
On Fri, Dec 18, 2009 at 7:27 PM, Todd Blanchard wrote:
> One thing I'm keenly missing from rails is the form input naming convention
> that causes the form values to be converted into a hierarchy. For instance,
>
>
>
>
> will result in the request values being stored as {
Lately I have really liked using custom template tags for these sorts of
queries.
Once you get the hang of writing them, it's very quick to build a little
library of queries in custom tags for your application. These are *very*
convenient to use because you don't have to modify views.py -- or
On Sat, Dec 19, 2009 at 7:04 PM, Bob wrote:
> Hi,
> I am trying to get started with django on windows vista. I have
> successfully installed it as "import django" works in python.
> However, whenever I try at the command prompt
> "django-admin.py startproject myproject"
>
Hi,
I am trying to get started with django on windows vista. I have
successfully installed it as "import django" works in python.
However, whenever I try at the command prompt
"django-admin.py startproject myproject"
I get "Type 'django-admin.py help' for usage".
I have tried four installs on 3
Hi,
I am trying to get started with django on windows vista. I have
successfully installed it as "import django" works in python.
However, whenever I try at the command prompt
"django-admin.py startproject myproject"
I get "Type 'django-admin.py help' for usage".
I have tried four installs on 3
@Brian
Thank you very much for clear explanation!
I gives me much more than enormous pages of manuals.
@Itay
Thanks for suggestion, but refractoring inside views.py looks more
clear to manage.
I wasn't also sure, if such simple solution requires middleware
involved. I will probably have
more than
Hi,
I wanted a "sum" of a particular column being listed in the admin list
page. I looked it up and did it the following way. Is this the correct
way of doing it?
I modified the admin.py to do the calculation:
class CollectionAdmin(admin.ModelAdmin):
list_display = ('supplier',
2009/12/19 Todd Blanchard :
> How does this solve the problem of having two related objects that have the
> same attribute name (like "name") on the same html form? As I see it, it
> doesn't. There will be a conflict and it will be impossible to keep them
> separate.
> IOW,
>
Osiaq wrote:
> def services(request):
> property = Property.objects.all().order_by('name')[:4]
> city = City.objects.all()
> category=PropertyCategory.objects.all()
> status=PropertyStatus.objects.all()
> return render_to_response('website/services.html',{'property':
Guys got 2 columns generated by
{% autopaginate blogs_one 3 %}
{% for blog_post in blogs_one %}
{% show_blog_post blog_post %}
{% endfor %}
{% paginate %}
{% autopaginate blogs_two 3 %}
{% for blog_post in
On Dec 19, 2009, at 4:06 AM, Yusuf Mohsinally wrote:
> In your experience, would it be better to use the
> "@transaction.commit_on_success" decorator for the functions that need
> it, or turn on transaction middleware for the whole app?
My general approach, when using PostgreSQL as the backend,
I'm not sure I'm entirely understanding your question, but yes, that
does look easy to implement with django.
What part is troubling you? You seem to have a good idea of what you
want.
On Dec 17, 6:42 am, tezro wrote:
> Hello everyone. Making well-structured websites on
Ok, figured this one out with google.
Idle had taken over .py files. It was as simple as going to My
Computer, Tools, Folder Options, File Types, scrolling down to .py,
and clicking Restore Default (which is python).
Thanks for the help all!
On Dec 19, 2:14 pm, Dane
C:\Python26\Scripts is where django-admin.py is, and it's in my PATH
variable. It's strange because C:\Python26 (the path to python itself)
is also in the same PATH variable, and that is working. If I just type
'python', I do get the shell.
If idle.pyw has taken over .py associations, how would I
How does this solve the problem of having two related objects that have the
same attribute name (like "name") on the same html form? As I see it, it
doesn't. There will be a conflict and it will be impossible to keep them
separate.
IOW,
{{ account_form }}
{{ contact_form }}
def
i'm quite a noob myself but my best guess is to use context processor,
see
http://stackoverflow.com/questions/557460/django-having-middleware-communicate-with-views-templates
On Sat, Dec 19, 2009 at 8:14 PM, Osiaq wrote:
> VIEWS:
>
> def services(request):
>
VIEWS:
def services(request):
property = Property.objects.all().order_by('name')[:4]
city = City.objects.all()
category=PropertyCategory.objects.all()
status=PropertyStatus.objects.all()
return render_to_response('website/services.html',{'property':
David, Celery sounds really good, thanks for the tip, I'll have a
deeper look into it as soon as I've got some time, if I can't get it
up for this project I'll study it's details and put it up later maybe
for a new release or a new project. For what I've seen until now it
seems to be perfect,
Solved.
It wasn't the OS, django, Python or MySQL versions...
It was the South version. Locally I was using 0.6.2 whereas the on the
development server I had 0.6-pre installed.
btw, if you encounter this and try to "python setup.py install" the
new South - remember to erase the old South folders
You can paginate whatever you want. From the docs:
"Note that you can give Paginator a list/tuple, a Django QuerySet, or
any other object with a count() or __len__() method. "
On Dec 19, 3:33 am, Continuation wrote:
> In the django-pagination, it uses the example:
> {%
Thanks! The blog post was very very helpful.
In your experience, would it be better to use the
"@transaction.commit_on_success" decorator for the functions that need
it, or turn on transaction middleware for the whole app?
Thanks
On Sat, Dec 19, 2009 at 10:34 AM, Christophe Pettus
Hi Folks,
The complex example of an Atom feed
(http://docs.djangoproject.com/en/1.1/ref/contrib/syndication/#a-complex-example)
is based on a model where it's possible to work out from a single
element in the feed (in this case a Crime), what the driving object is
(a Beat). So there's a
Result is stored in request.POST (or you can do same with get params,
?foo=one=two).
for example request.POST.getlist('foo'). Default getitem implementation
returns only last occurence from list.
See:
http://docs.djangoproject.com/en/1.1/ref/request-response/#querydict-objectsfor
more info.
32 matches
Mail list logo