On 13/12/2011 5:21pm, kenneth gonsalves wrote:
On Tue, 2011-12-13 at 17:16 +1100, Mike Dewhirst wrote:
THINGS = ( (0, 'Thing Zero'),
(1, 'Thing One'), )
what happens when you do:
THINGS = ( ('0', 'Thing Zero'),
('1', 'Thing One'), )
By golly it worked! Mus
On Tue, Dec 13, 2011 at 8:49 AM, Bernardo wrote:
> One thing the project I was working had and I liked was lots of
> decorators on top of controllers (what you people call views - and
> makes sense)
> Something like that:
>
> #-
>
> @require_permission('login')
> @expos
On Tue, 2011-12-13 at 17:16 +1100, Mike Dewhirst wrote:
> THINGS = ( (0, 'Thing Zero'),
> (1, 'Thing One'), )
what happens when you do:
THINGS = ( ('0', 'Thing Zero'),
('1', 'Thing One'), )
--
regards
Kenneth Gonsalves
--
You received this message because you
I'm getting a puzzling error trying to follow the dev docs here ...
https://docs.djangoproject.com/en/dev/ref/models/instances/#django.db.models.Model.get_FOO_display
I syncdb'd a simple test model to eliminate everything except the
essentials with ...
class SimpleTest(models.Model):
THI
I've been working lately (not my choice!) with Pylons and the terrible
Genshi as template system.
The thing is: for the next project I wanted to use something better
and the first thing I could think of was Django.
I spent the last weaks reading documentation (FAQs, installation,
templates, models
Has anybody solved this issue?
On Dec 14 2006, 2:47 pm, "Aidas Bendoraitis"
wrote:
> I ran out of ideas. :) Maybe somebody else has any thoughts regarding new
> lines?
>
> Good luck with Django!
> Aidas Bendoraitis [aka Archatas]
>
> On 12/14/06, zhongke chen wrote:
>
>
>
>
>
>
>
> > firefox sh
On 13/12/2011 5:25am, cmc wrote:
write_info = "name: %s\n caption: %s\n source: %s\n more_info:
%s\n\n" % photo.name, caption, source, more_info
and I've always had to put parentheses around the values on the right
hand side of the % like this ...
write_info = "name: %s\n caption: %
On 12-12-11 19:25, cmc wrote:
I am trying to use django to upload images but its not working as
expected. Here is what I'm working with
Ehm, you're not telling us what goes wrong or unexpected :-)
There's one thing that I see in your code that might be a problem:
#handle_uploaded_image.py
I am trying to use django to upload images but its not working as
expected. Here is what I'm working with
#handle_uploaded_image.py
def handle_uploaded_image(photo, caption, source, more_info):
photo_dir = '%s/uploaded_photos/Not_Published/%Y/%m/%d' %
settings.MEDIA_ROOT
photo
I'm not sure, not having explored CBVs yet, but yes, I suspect you'll
want to either decorate or override the method that usually returns
the HttpResponse.
On Dec 12, 1:50 pm, Eli Criffield wrote:
> I like the raise exception idea, but where do i catch it?
> In a decorator?
> Overwrite get() ?
I like the raise exception idea, but where do i catch it?
In a decorator?
Overwrite get() ?
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/django-users/-/KMhk4RFokUAJ.
T
I'd recommend against doing that, as it's a strong violation of MVC
principles. Instead you should either catch the
ModelName.DoesNotExist exception in a custom (or inherited, or generic-
view-wrapping) view, or raise a custom exception in your get_queryset
method and catch that exception instead
I faced a similar situation where I had to check for valid input data
used to build the query in get_queryset(). My solution was to use a
decorator around the dispatch() function, but I think it could also be
used within that function. I chose dispatch() because it acts like a
traditional view fu
I can't test this, but the code below may do what you want. (I
learned this stuff from Reinout's blog posts)
# urls.py
(r'^tags/(?P[a-zA-Z0-9_.-]+)/$',
djangoblog.tag_views.TagDetailListView.as_view())
# views.py
from django.views.generic import ListView
class TagDetailListView(ListView):
Check out this little tool: http://pypi.python.org/pypi/django-widget-tweaks
Here's how I use it:
https://github.com/oinopion/twitz/blob/master/templates/statuses/_status_update_form.html
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To view
See this example:
https://github.com/ebertti/django-registration-bootstrap
have a example using django-registration
On Mon, Dec 12, 2011 at 07:37, Lukas Vinclav wrote:
> Hi,
>
> I am using Twitter Bootstrap in Django for a long time. Here are
> directions how to achieve correct result.
>
> 1.
Hi,
I am using Twitter Bootstrap in Django for a long time. Here are directions how
to achieve correct result.
1. Create new file for displaying forms in templates directory(e.g. forms.html)
2. In forms.html write the form displaying logic. This is just an example. You
have to set bootstrap's c
HI !
We currently have an inventory system for our employees. It contains
laptops, phones, but also ergonomic chairs, fridges or software
licenses ... So very different stuff that admins can create/read/
update/delete.
After doing a version completely based on admin interface, I gave up
cause it
Adding the csrf context processor would fix it. Refer to
https://docs.djangoproject.com/en/dev/ref/contrib/csrf/ for more details.
As suggested, you can add your own render_to_response() wrapper, if you are
likely to use it often.
--
*Regards,*
*Alagappan Ramu
(http://alagappan.co.in)
*
--
You
19 matches
Mail list logo