Re: Announcement of GUI for Creating Models

2012-09-08 Thread Alec Taylor
Kurtis: That looks very interesting; just finished reading it.

I wouldn't recommend this for Timothy though; it looks like something
which will require a large team to develop.

Maybe submit it as a project proposal to Canonical?

Or post on Django-Dev [and here] to see if you can get a large +
skilled enough team to build such a system.

On Sun, Sep 9, 2012 at 6:41 AM, Kurtis Mullins  wrote:
> You could take it a few steps farther and reproduce some work done by a
> doctor(now) I used to go to school with.
>
> http://knoesis.wright.edu/research/srl/projects/mobicloud/
>
>
> On Sat, Sep 8, 2012 at 2:50 PM, Javier Guerra Giraldez 
> wrote:
>>
>> On Fri, Sep 7, 2012 at 9:42 PM, Timothy Clemans
>>  wrote:
>> > I've developed a GUI for creating models, see
>> > https://github.com/timothyclemans/django-admin-models-editor
>> >
>> > Would this be helpful for developers? Would it be useful for you? Should
>> > I
>> > keep developing it? What features would you like to see added?
>>
>> personally, i much prefer the reverse approach:  i write the models,
>> and a tool (ie. django-extensions) generates a graphical
>> representation.
>>
>> pros:
>>  - the final models are exactly what i want them to be.  even if the
>> graphical tool doesn't support some obscure Django feature, i can
>> still use it; it's just not shown graphically.
>>
>>  - i don't have to learn a different (graphical) language
>>
>>  - i keep fluent in the real Django language, so i don't have to
>> relearn it when for any reason i don't have to use that tool.
>>
>> cons:
>>   - less sexy than not writing code
>>
>> --
>> Javier
>>
>> --
>> 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
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>
> --
> 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
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django Tutorial

2012-09-08 Thread TJ Max
Please tell us what your urls.py is

On Sat, Sep 8, 2012 at 6:02 PM, David Perez
wrote:

> Hi,
>
> I am new to Django, I am actually starting its tutorial. On part 2 it
> enables the admin site, but I can't log in to it. The following error comes
> up (see at the bottom):
>
> If I remember correctly I did not get prompt to create a superuser when I
> wrote *python manage.py syncdb*, so I am not sure if I do not have a
> superuser. I tried to create it with *python manage.py createsuperuser
> --username=david* but it is not working.
>
> I am most certain it is something simple...and I tried to follow the steps
> as exact as I could. I appreciate your help
> David
>
>
> DoesNotExist at /admin/
>
> Site matching query does not exist.
>
> Request Method:GET Request URL:http://127.0.0.1:8000/admin/ Django
> Version:1.4.1Exception Type: DoesNotExistException Value:
>
>
> Site matching query does not exist.
>
> Exception 
> Location:/Library/Python/2.7/site-packages/django/db/models/query.py in get, 
> line 366Python
> Executable: /usr/bin/pythonPython Version: 2.7.1Python Path:
>
>
> ['/Users/Dperezc/Desktop/Estudios independientes/Django/Proyecto1_Poll',
>  '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip',
>  '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7',
>  
> '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin',
>  
> '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac',
>  
> '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages',
>  '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python',
>  
> '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk',
>  
> '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old',
>  
> '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload',
>  
> '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC',
>  '/Library/Python/2.7/site-packages']
>
> Server time: Sat, 8 Sep 2012 18:45:28 -0600
>
>
>
>
>  --
> 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/-/YzfZzN7HgtoJ.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Django Tutorial

2012-09-08 Thread David Perez
Hi,

I am new to Django, I am actually starting its tutorial. On part 2 it 
enables the admin site, but I can't log in to it. The following error comes 
up (see at the bottom):

If I remember correctly I did not get prompt to create a superuser when I 
wrote *python manage.py syncdb*, so I am not sure if I do not have a 
superuser. I tried to create it with *python manage.py createsuperuser 
--username=david* but it is not working.

I am most certain it is something simple...and I tried to follow the steps 
as exact as I could. I appreciate your help.

David


DoesNotExist at /admin/

Site matching query does not exist.

Request Method:GETRequest URL:http://127.0.0.1:8000/admin/Django Version:
1.4.1Exception Type:DoesNotExistException Value:

Site matching query does not exist.

Exception Location:/Library/Python/2.7/site-packages/django/db/models/query.py 
in get, line 366Python Executable:/usr/bin/pythonPython Version:2.7.1Python 
Path:

['/Users/Dperezc/Desktop/Estudios independientes/Django/Proyecto1_Poll',
 '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip',
 '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7',
 
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin',
 
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac',
 
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages',
 '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python',
 
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk',
 
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old',
 
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload',
 
'/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC',
 '/Library/Python/2.7/site-packages']

Server time:Sat, 8 Sep 2012 18:45:28 -0600




-- 
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/-/YzfZzN7HgtoJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Announcement of GUI for Creating Models

2012-09-08 Thread TJ Max
Thank you for the feedback.

I implemented the simple_mode suggestion. I'll use it personally so I
don't have to click two checkboxes.

I have simple ungrouped choices almost implemented. Unfortunately I'm
getting weird undefined errors in my javascript. Most other field
options are enabled now.

Once I get choices fully implemented I'll focus on being able to edit
models. I forgot about South. Having a GUI for it will be nice because
I was constantly getting errors I didn't understand.

I found the comment about having clients use this interesting. I would
be interested in making this easy for non-developers to use.

On Sat, Sep 8, 2012 at 3:05 PM, Dennis Lee Bieber  wrote:
> On Sat, 8 Sep 2012 08:00:21 -0700 (PDT), Joni Bekenstein
>  declaimed the following in
> gmane.comp.python.django.user:
>
>> Also having a "simple" mode for the client who will actually use this would
>> be helpful. For example, instead of enabling blank/null checkboxes, just
>> add one "required" checkbox.
>>
> For a string field, having Null and Not Blank can be a meaningful
> difference (or the other way around, Not Null and Blank Allowed -- since
> this means the user has to explicitly set the field to blanks rather
> than passing an undefined/null)
> --
> Wulfraed Dennis Lee Bieber AF6VN
> wlfr...@ix.netcom.comHTTP://wlfraed.home.netcom.com/
>
> --
> 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 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
>

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Test driven development in Django framework

2012-09-08 Thread Steven Cummings
I think when people say "unit" tests to mean fully isolated tests, what
they really mean is *whitebox* tests. You define the size of the unit under
test and context runs from full isolation (whitebox test) to full
integration/user-experience (blackbox test)
--
Steven


On Fri, Sep 7, 2012 at 7:39 AM, Harry P  wrote:

> Hey, glad to hear someone's been found it useful!
>
> re: whether my unit tests are unit tests or not... some people have a very
> restrictive definition of what a unit test is - they want it to be 100%
> isolated from other tests, always mock out the filesystem and the database,
> etc.  That's fine, but we tend to find it's a bit OTT, and a slightly more
> relaxed approach is more productive.   Ultimately, I'm writing two types of
> test - some high-level tests that test the behaviour of the app from the
> user's point of view - so call them system tests, or functional tests, or
> acceptance tests, or whatever you will, but their purpose is to check the
> system actually works.  The other type of test is low-level, they test the
> behaviour of individual functions, classes etc, and their purpose is to
> help you think about your code before you write it, to think through edge
> cases and to help write correct code.
>
> So, to me, the important thing is that you have those two types of test,
> and that they help you achieve those two different objectives.  Finer
> details of terminology or practices to do with mocking, stubbing etc are up
> to personal preferences really.
>
> cheers,
> hp
>
>
>
>
> On Friday, September 7, 2012 10:25:32 AM UTC+1, jyria wrote:
>>
>> Thank you for reply,
>>
>> I have been using your tutorial to learn TDD in django. One of the best I
>> have found so far. You also talk about "unit tests" and thats what is
>> confusing. As I understand, your tutorial examples are not unit tests in
>> the strict meaning of the term.
>>
>> You have a great tutorial and I have learned a lot of them. Maybe too
>> much focus on admin and polls app for me. I would have liked to see
>> something different and new. What about running you selenium functional
>> tests in a acceptance testing framework?
>>
>> I would love to see your tutorials for intermediate/advanced level.
>>
>> On Thursday, September 6, 2012 1:57:08 PM UTC+3, Harry P wrote:
>>>
>>> Hi there,
>>>
>>> I work for a bunch of XP fanatics, so we do quite religious TDD in our
>>> Python/Django development.   We start with functional/acceptance tests,
>>> which we write using Selenium, driving a real web browser, and following a
>>> test script that is essential a user story.  We then write unit tests that
>>> we can run using a python manage.py test.
>>>
>>> I've written a "TDD for beginners" tutorial, that covers both of these
>>> types of test:
>>>
>>> http://www.tdd-django-**tutorial.com/
>>>
>>> I'd love any comments, feedback, suggestions?
>>>
>>> rgds,
>>> Harry
>>>
>>> On Thursday, September 6, 2012 1:47:08 AM UTC+1, Mike Dewhirst wrote:

 On 6/09/2012 3:04am, Javier Guerra Giraldez wrote:
 > On Wed, Sep 5, 2012 at 7:46 AM, jyria  wrote:
 >> What is your experience? Is it worth it, and is it possible?
 >>
 >> I tried it and found it quite difficult to follow guideline of unit
 testing
 >> -- testing a unit of code, a class for example. Maybe Im just
 ignorant, but
 >> I didnt see, how can I create registration app only with unit tests.
 The
 >> only way I could drive implementation with tests was using more like
 an
 >> integration testing approach: calling requests with data and
 asserting that
 >> new user was registered and that form was valid/invalid etc, but
 this goes
 >> against TDD as I understand it. So should I not worry about pure
 "unit
 >> testing" approach and use django client http request to validate
 >> RegistrationForm. Or I should write unit tests for RegistrationForm
 class?
 >
 > TDD is not unit-testing

 Here is a lovely diagram I found recently - probably by following a
 link
 someone posted here - which shows the TDD process with unit tests and
 acceptance tests.

 IMO it covers pretty much everything in the universe ...

 http://www.methodsandtools.**com/archive/attready3.jpg

 >
 > https://www.google.com/webhp?**q=tdd%20is%20not%20unit%**20testing
 >
 >
 > in short, it's like you've found: the tests you easily get with TDD
 > are more (but not exactly) like integration tests, because you test
 > features, not units.  The "test isolated units" mantra of
 unit-testing
 > requires different work.  There's nothing wrong in adding 'real'
 > unit-tests, but it's not required to do effective TDD.
 >
 > I guess that since 

Reverse for 'app_list' with arguments '()' and keyword arguments '{'app_label': ''}' not found.

2012-09-08 Thread vijay shanker
hi
i have this model called charity
___
from django.db import models
from settings import DEFAULT_CHARITY_NAME as deafult_charity_name


class GetDefaultInstance(models.Manager):
def get_default_instance(self):
return 
super(Charity,self).get_query_set().filter(charity_name=default_charity_name)
   

class Charity(models.Model):
class Meta:
verbose_name_plural = 'Charities'
app_label = 'charities'
charity_name= models.CharField(max_length=50)
in_percentage   = models.IntegerField(help_text='default value is 0,\
  leave blank if you will enter 
fixed amount.', default=0, blank=True,null=True)
fixed_amount= models.IntegerField(help_text='default value is 0,\
  leave blank if you entered amount 
in percentage.',default=0, blank=True, null=True  )

objects = models.Manager()
default_instance = GetDefaultInstance()

def __unicode__(self):
return '%s'%self.charity_name

___-

in urls:
(r'^admin/charity_report/(?P[-\w]+)/$', 
'charities.admin_views.report'),
__

and another model called ItemDetails which have forignkey relation with 
above model, with  default instance of charity attached to each Itemdetail 
object .
I wanted to add admin button alongside history button so user can see 
amount charged as charity and stuff like percentage deduction,amount 
deducted etc.

i managed to show the button but when clicked at it gives this trace:
http://pastebin.com/03wscYLX

the settings is at: 
http://pastebin.com/7FYY189D

the other regular info are in:
http://pastebin.com/QmAdEeP9

its been 2-3 days trying to run it on apache server.. it works ok on local 
machine.

i override form_change template and provide the button, write urls for 
admin 

-- 
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/-/9Zu2zAew3aIJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

{% extends "admin/change_form.html" %}
{% load mini_shop_tags %}
{% load i18n %}
{% block object-tools %}
{% if change %}{% if not is_popup %}
  
{% trans "History" %}
{% if opts.module_name == "item" %}
Charity Report
{% endif %}
{% if has_absolute_url %}

{% trans "View on site" %}

{% endif%}
  
{% endif %}{% endif %}
{% endblock %}from charities.models import Charity, GetDefaultInstance
from django.template import RequestContext
from django.shortcuts import render_to_response
from django.contrib.admin.views.decorators import staff_member_required
from generoucity.mini_shop.extensions.deals.models import ItemDetails 
from generoucity.mini_shop.models import Item

class CharityReport(object):
def __init__(self,request,itemdetails_id):
self.request = request
self.itemdetails_id = itemdetails_id

def render_report(self):
data = {}
item = Item.objects.get(pk=self.itemdetails_id)
itemdetail_obj  = ItemDetails.objects.get(item=item)
charity_obj = itemdetail_obj.charity
if not type(charity_obj) is type('NoneType'):
data['charity_name'] = charity_obj.charity_name
else:
data['charity_name'] = 'No charity is associated with this deal.'
data['price'] = item.price
if charity_obj.in_percentage:
data['charity_category'] = 'Fixed Percentage: %s '%(charity_obj.in_percentage)
data['charity_amount'] = (float(charity_obj.in_percentage)/100)*item.price
else:
data['charity_category'] = 'By Fixed Amount: %d'%(charity_obj.fixed_amount)
data['charity_amount'] = charity_obj.fixed_amount
data['item'] = item.name
return render_to_response("admin/mini_shop/extensions/deals/charity_report.html",locals(),RequestContext(self.request,{}))

def report(request,itemdetails_id):
charity_report_object = CharityReport(request, itemdetails_id)
return charity_report_object.render_report()



report = staff_member_required(report)

from models import Charity
import datetime
from django.conf import settings

def charity_admin(request):
charities = Charity.objects.all()
return {"charities": charities,}
from django.db import models
from settings import DEFAULT_CHARITY_NAME as deafult_charity_name


class GetDefaultInstance(models.Manager):
def get_default_instance(self):
return super(Charity,self).get_query_set().filter(charity_name=default_charity_name)
   

class Charity(models.Model):

Re: is django too big for my use case?

2012-09-08 Thread Steven Elliott
I do not think your use case is too big for Django; you are only limited to
your imagination and your knowledge of Python really. Check out Django
Piston  for RESTful
APIs

On Sat, Sep 8, 2012 at 4:05 PM, LuckySMack  wrote:

> I am currently starting work on a a project that is rest based. In order
> to use django as a rest based system I have to use another library on top
> of it. I've seen that there are a couple out there. But this system will be
> an advanced rest a pi that will allow me to talk to my database, and allow
> other instances of the app to talk to each other. And as cool as django
> seems to get up and running quickly, I'm not sure if its a right fit. It
> seems a bit complex. My app will likely only have one or 2 models as the
> core. And I won't be using djangos orm as I will be needing a db like
> neo4j, titan, or orientdb.
>
> Now that is the core, that will be shared by about a half dozen apps. They
> will all build on top of that. And I feel like django might be too bloated
> or big or complex. The base a pi could probably done by an experienced
> python dev in flask or bottle in a few days time. It doesn't have any ui.
> In comparison I'm also thinking about implementing it in pyramid too. But
> I'm curious as if you guys think it will work in django.
>
> --
> 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/-/Iiuk6V4TSHQJ.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: is django too big for my use case?

2012-09-08 Thread Kurtis Mullins
I have a project that will be making extensive use of Neo4j, along with
other data systems. As much as I love Django, I don't think the marriage is
there for what you want, yet. If you're not using Django's ORM, Template
System, Administration System, etc... then there's really not much left of
Django to use :) You *could* make it work but you may have better luck
building a solution from a smaller framework or possibly find something out
there that fits your needs better.

On Sat, Sep 8, 2012 at 4:05 PM, LuckySMack  wrote:

> I am currently starting work on a a project that is rest based. In order
> to use django as a rest based system I have to use another library on top
> of it. I've seen that there are a couple out there. But this system will be
> an advanced rest a pi that will allow me to talk to my database, and allow
> other instances of the app to talk to each other. And as cool as django
> seems to get up and running quickly, I'm not sure if its a right fit. It
> seems a bit complex. My app will likely only have one or 2 models as the
> core. And I won't be using djangos orm as I will be needing a db like
> neo4j, titan, or orientdb.
>
> Now that is the core, that will be shared by about a half dozen apps. They
> will all build on top of that. And I feel like django might be too bloated
> or big or complex. The base a pi could probably done by an experienced
> python dev in flask or bottle in a few days time. It doesn't have any ui.
> In comparison I'm also thinking about implementing it in pyramid too. But
> I'm curious as if you guys think it will work in django.
>
> --
> 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/-/Iiuk6V4TSHQJ.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Announcement of GUI for Creating Models

2012-09-08 Thread Kurtis Mullins
You could take it a few steps farther and reproduce some work done by a
doctor(now) I used to go to school with.

http://knoesis.wright.edu/research/srl/projects/mobicloud/

On Sat, Sep 8, 2012 at 2:50 PM, Javier Guerra Giraldez
wrote:

> On Fri, Sep 7, 2012 at 9:42 PM, Timothy Clemans
>  wrote:
> > I've developed a GUI for creating models, see
> > https://github.com/timothyclemans/django-admin-models-editor
> >
> > Would this be helpful for developers? Would it be useful for you? Should
> I
> > keep developing it? What features would you like to see added?
>
> personally, i much prefer the reverse approach:  i write the models,
> and a tool (ie. django-extensions) generates a graphical
> representation.
>
> pros:
>  - the final models are exactly what i want them to be.  even if the
> graphical tool doesn't support some obscure Django feature, i can
> still use it; it's just not shown graphically.
>
>  - i don't have to learn a different (graphical) language
>
>  - i keep fluent in the real Django language, so i don't have to
> relearn it when for any reason i don't have to use that tool.
>
> cons:
>   - less sexy than not writing code
>
> --
> Javier
>
> --
> 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
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Seeing if a variable value is within a dictionary key value within a list of dictionaries

2012-09-08 Thread Tim Chase
On 09/08/12 14:45, Jason wrote:
> thank you for your responses. I think, following your advice, I'll have to 
> abandon my attempts to handle this in the template, and sort this out in 
> the views instead. 

While it's *possible* to implement the logic in the template, it (1)
is inefficient and (2) belongs in the view anyways. :-)

So you're making the right choice.

-tkc


-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



is django too big for my use case?

2012-09-08 Thread LuckySMack
I am currently starting work on a a project that is rest based. In order to use 
django as a rest based system I have to use another library on top of it. I've 
seen that there are a couple out there. But this system will be an advanced 
rest a pi that will allow me to talk to my database, and allow other instances 
of the app to talk to each other. And as cool as django seems to get up and 
running quickly, I'm not sure if its a right fit. It seems a bit complex. My 
app will likely only have one or 2 models as the core. And I won't be using 
djangos orm as I will be needing a db like neo4j, titan, or orientdb.

Now that is the core, that will be shared by about a half dozen apps. They will 
all build on top of that. And I feel like django might be too bloated or big or 
complex. The base a pi could probably done by an experienced python dev in 
flask or bottle in a few days time. It doesn't have any ui. In comparison I'm 
also thinking about implementing it in pyramid too. But I'm curious as if you 
guys think it will work in django. 

-- 
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/-/Iiuk6V4TSHQJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Seeing if a variable value is within a dictionary key value within a list of dictionaries

2012-09-08 Thread Jason
Hi guys, 

thank you for your responses. I think, following your advice, I'll have to 
abandon my attempts to handle this in the template, and sort this out in 
the views instead. 

Thanks again :)
J

On Saturday, September 8, 2012 7:40:39 PM UTC+1, Javier Guerra wrote:
>
> On Fri, Sep 7, 2012 at 6:19 PM, Tim Chase 
>  wrote: 
> > On 09/07/12 16:06, Jason Whatford wrote: 
> >> P.s. Tim, my data structure isn't that malleable. It's 
> >> essentially I query my appengine datastore, and that retrieves a 
> >> list of the data models, each of which can be treated as a dict. 
> >> The dicts are used in a few different ways in the view - only 
> >> this is giving me trouble though. 
> > 
> > Ah, but the transformations I suggest can be done within your view 
> > before passing it to your template. 
>
> it's the only sensible way. 
>
> you wouldn't put the database access code in the template, right? 
> similarly, there's no need to deal with less-than-optimal structures 
> in the template.  the view code is the appropriate place to gather all 
> relevant data, transform it to a presentation-friendly format and pass 
> to the template just for rendering. 
>
>
> -- 
> Javier 
>

-- 
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/-/6exFRIVwG6oJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Understanding the use of Apache and nginix with Django

2012-09-08 Thread Javier Guerra Giraldez
On Sat, Sep 8, 2012 at 9:49 AM, Reginald Choudari
 wrote:
> Django doesn't serve files itself; it leaves that job to whichever Web
> server you choose.
> We recommend using a separate Web server -- i.e., one that's not also
> running Django -- for serving media. Here are some good choices:

some time ago, the recommended Apache module was mod_python, which ran
Python code in the same process as the media serving capabilities of
Apache.  that led to suboptimal use of RAM

the advice was, and still is, to use different processes for media and
app code, therefore a separate webserver was a good advise if you used
mod_python.

now, mod_python is deprecated, and mod_wsgi manages a separate process
for Django.  uwsgi does a similar thing.  so, it's quite easy to do a
very good architecture with just Apache and mod_wsgi, or just nginx
and uwsgi.  (there are still many other options, of course)

-- 
Javier

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Announcement of GUI for Creating Models

2012-09-08 Thread Javier Guerra Giraldez
On Fri, Sep 7, 2012 at 9:42 PM, Timothy Clemans
 wrote:
> I've developed a GUI for creating models, see
> https://github.com/timothyclemans/django-admin-models-editor
>
> Would this be helpful for developers? Would it be useful for you? Should I
> keep developing it? What features would you like to see added?

personally, i much prefer the reverse approach:  i write the models,
and a tool (ie. django-extensions) generates a graphical
representation.

pros:
 - the final models are exactly what i want them to be.  even if the
graphical tool doesn't support some obscure Django feature, i can
still use it; it's just not shown graphically.

 - i don't have to learn a different (graphical) language

 - i keep fluent in the real Django language, so i don't have to
relearn it when for any reason i don't have to use that tool.

cons:
  - less sexy than not writing code

-- 
Javier

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Virtualenv changes url reverse behaviour

2012-09-08 Thread Javier Guerra Giraldez
On Sat, Sep 8, 2012 at 5:06 AM, William Hart  wrote:
> Hey Ramiro, thanks for the reply... yes you are correct I haven't mentioned
> the version of Django I have installed.  I've experienced this on both 1.4.1
> and 1.5dev.  I think I mentioned in the comments on SO that I've installed
> and uninstalled requirements several times using the same requirements.txt
> so its happening on the same version number.

i think this is the key to your perceived inconsistency: after so many
installations and reinstalls, it seems you're getting a different
Dajngo version in each case.

try checking the specific django version from inside the code.

-- 
Javier

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Development server won't work from a shared web host

2012-09-08 Thread Javier Guerra Giraldez
On Sat, Sep 8, 2012 at 12:55 AM, graeme  wrote:
> Why Mako? As a personal preference it is fine, but why general advice for
> newbies? Many people are happy with Django templates - although I far prefer
> Jinja which had the advantages without some of the more annoying
> restrictions.

after a quick look at Mako, it's similar enough to PHP (embedding a
full language in the template) to be familiar to many newcomers
for the wrong reasons.

there's a reason why the Django templates (and Jinja too, i believe)
make a conscious effort not to be Turing-complete.

-- 
Javier

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Seeing if a variable value is within a dictionary key value within a list of dictionaries

2012-09-08 Thread Javier Guerra Giraldez
On Fri, Sep 7, 2012 at 6:19 PM, Tim Chase
 wrote:
> On 09/07/12 16:06, Jason Whatford wrote:
>> P.s. Tim, my data structure isn't that malleable. It's
>> essentially I query my appengine datastore, and that retrieves a
>> list of the data models, each of which can be treated as a dict.
>> The dicts are used in a few different ways in the view - only
>> this is giving me trouble though.
>
> Ah, but the transformations I suggest can be done within your view
> before passing it to your template.

it's the only sensible way.

you wouldn't put the database access code in the template, right?
similarly, there's no need to deal with less-than-optimal structures
in the template.  the view code is the appropriate place to gather all
relevant data, transform it to a presentation-friendly format and pass
to the template just for rendering.


-- 
Javier

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Reverse for 'app_list' with arguments '()' and keyword arguments '{'app_label': ''}' not found.

2012-09-08 Thread vijay shanker
hi
i tried overriding change_form to add a extra button along side history 
button in django admin section.. on local machine it works fine but on 
server it gives me this error.
I have no clear idea what went wrong and how to fix it .


Environment:


Request Method: GET
Request URL: http://108.166.89.168/admin/charity_report/166/

Django Version: 1.4.1
Python Version: 2.7.1
Installed Applications:
('sorl.thumbnail',
 'south',
 'generoucity.newsletter',
 'django.contrib.comments',
 'django.contrib.messages',
 'django.contrib.flatpages',
 'django.contrib.humanize',
 'django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.staticfiles',
 'generoucity.mini_shop',
 'generoucity.mini_shop.extensions.deals',
 'generoucity.treemenus',
 'generoucity.social_auth',
 'generoucity.registration',
 'mptt',
 'captcha',
 'charities')
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.middleware.doc.XViewMiddleware',
 'generoucity.mini_shop.extensions.deals.middleware.LocationCookieMiddleware',
 'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware')


Traceback:
File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" 
in get_response
  111. response = callback(request, *callback_args, 
**callback_kwargs)
File 
"/usr/local/lib/python2.7/dist-packages/django/contrib/admin/views/decorators.py"
 
in _checklogin
  16. return view_func(request, *args, **kwargs)
File "/usr/gen1/generoucity_2011.com/generoucity/charities/admin_views.py" 
in report
  34. return charity_report_object.render_report()
File "/usr/gen1/generoucity_2011.com/generoucity/charities/admin_views.py" 
in render_report
  30. return 
render_to_response("admin/mini_shop/extensions/deals/charity_report.html",locals(),RequestContext(self.request,{}))
File "/usr/local/lib/python2.7/dist-packages/django/shortcuts/__init__.py" 
in render_to_response
  20. return HttpResponse(loader.render_to_string(*args, **kwargs), 
**httpresponse_kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/template/loader.py" in 
render_to_string
  176. return t.render(context_instance)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py" in 
render
  140. return self._render(context)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py" in 
_render
  134. return self.nodelist.render(context)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py" in 
render
  823. bit = self.render_node(node, context)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py" in 
render_node
  837. return node.render(context)
File 
"/usr/local/lib/python2.7/dist-packages/django/template/loader_tags.py" in 
render
  123. return compiled_parent._render(context)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py" in 
_render
  134. return self.nodelist.render(context)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py" in 
render
  823. bit = self.render_node(node, context)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py" in 
render_node
  837. return node.render(context)
File 
"/usr/local/lib/python2.7/dist-packages/django/template/loader_tags.py" in 
render
  123. return compiled_parent._render(context)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py" in 
_render
  134. return self.nodelist.render(context)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py" in 
render
  823. bit = self.render_node(node, context)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py" in 
render_node
  837. return node.render(context)
File 
"/usr/local/lib/python2.7/dist-packages/django/template/loader_tags.py" in 
render
  123. return compiled_parent._render(context)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py" in 
_render
  134. return self.nodelist.render(context)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py" in 
render
  823. bit = self.render_node(node, context)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py" in 
render_node
  837. return node.render(context)
File 
"/usr/local/lib/python2.7/dist-packages/django/template/defaulttags.py" in 
render
  281. return nodelist.render(context)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py" in 
render
  823. bit = self.render_node(node, context)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py" in 
render_node
  837. 

Changing the text on the admin "change_list.html"

2012-09-08 Thread Derek
I need to alter the text that appears above every change list in my app:

"Select *modelname* to change"

However, I cannot see this text in the change_list.html file -
whereabouts is this text kept, and can it be overridden?

Thanks
Derek

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Understanding the use of Apache and nginix with Django

2012-09-08 Thread Psamathos
If you are using only Apache with mod_wsgi, you will also need to set up 
Aliases for your media directories (like css, images, or user-uploaded 
files). This is because mod_wsgi doesn't serve static files, it is only 
used to generate the dynamic pages of your site. It's perfectly possible to 
use Apache alone to do this without employing another web server. However, 
if you are implementing a site that you expect will receive high load you 
may want to set up a separate web server to act as a reverse proxy to your 
apache/mod_wsgi server while also serving static files. This will allow you 
to use nginx to serve static files independently of apache, for which nginx 
is technically more efficient although in my opinion the actual difference 
in negligible. I would personally stick with an apache-only configuration 
unless you need the flexibility afforded by two separate web server 
configurations. 

If you're using Django 1.4 you should be using the built-in staticfiles 
app: https://docs.djangoproject.com/en/1.4/howto/static-files/

On Saturday, 8 September 2012 10:49:26 UTC-4, Reginald Choudari wrote:
>
> Hello,
>
> I've just started working on deploying a Django hosted website on my VPS. 
> Last night I finished configuring mod_wsgi with apache2.2 and had got the 
> 'It works!' page running from my Django project. I read here (
> https://docs.djangoproject.com/en/dev/howto/deployment/wsgi/modwsgi/) the 
> following: 
>
> Django doesn't serve files itself; it leaves that job to whichever Web 
> server you choose.
> We recommend using a separate Web server -- i.e., one that's not also 
> running Django -- for serving media. Here are some good choices:
>
>- lighttpd 
>
>
>- Nginx 
>
> I don't really understand this. This morning I configured my urls.py and 
> views.py to direct the '/' site url to an index.html template I created on 
> the fly (just for sanity check). Although it wasn't working at first, I 
> restarted apache2.2 service and the web page shows fine now. I don't 
> understand the idea of hosting two web servers and how Django is involved 
> with this if at all. 
>
> To me, it seems like apache routes clients to the wsgi, and the wsgi 
> returns with whatever http response it conjures up? Can someone shed some 
> light on this?
>
> Thanks,
> RC
>

-- 
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/-/9XWD6jFXeRAJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Understanding the use of Apache and nginix with Django

2012-09-08 Thread Phang Mulianto
Hi,

The apache or whatever the webserver you choose, should only serving static
files, not .py files .

the / request to your webserver will be redirect to django process, whether
it is uwsgi, or wsgi , or whatever service you choose to deploy.

Django runs as application server actually.

user -- web server   application server --- db server

hope helps

rgds,
Mulianto

On Sat, Sep 8, 2012 at 10:49 PM, Reginald Choudari <
adnanchowdhur...@gmail.com> wrote:

> Hello,
>
> I've just started working on deploying a Django hosted website on my VPS.
> Last night I finished configuring mod_wsgi with apache2.2 and had got the
> 'It works!' page running from my Django project. I read here (
> https://docs.djangoproject.com/en/dev/howto/deployment/wsgi/modwsgi/) the
> following:
>
> Django doesn't serve files itself; it leaves that job to whichever Web
> server you choose.
> We recommend using a separate Web server -- i.e., one that's not also
> running Django -- for serving media. Here are some good choices:
>
>- lighttpd 
>
>
>- Nginx 
>
> I don't really understand this. This morning I configured my urls.py and
> views.py to direct the '/' site url to an index.html template I created on
> the fly (just for sanity check). Although it wasn't working at first, I
> restarted apache2.2 service and the web page shows fine now. I don't
> understand the idea of hosting two web servers and how Django is involved
> with this if at all.
>
> To me, it seems like apache routes clients to the wsgi, and the wsgi
> returns with whatever http response it conjures up? Can someone shed some
> light on this?
>
> Thanks,
> RC
>
> --
> 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/-/9KrPNlJvEbwJ.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Understanding the use of Apache and nginix with Django

2012-09-08 Thread Reginald Choudari
Hello,

I've just started working on deploying a Django hosted website on my VPS. 
Last night I finished configuring mod_wsgi with apache2.2 and had got the 
'It works!' page running from my Django project. I read here (
https://docs.djangoproject.com/en/dev/howto/deployment/wsgi/modwsgi/) the 
following: 

Django doesn't serve files itself; it leaves that job to whichever Web 
server you choose.
We recommend using a separate Web server -- i.e., one that's not also 
running Django -- for serving media. Here are some good choices:
   
   - lighttpd 


   - Nginx 

I don't really understand this. This morning I configured my urls.py and 
views.py to direct the '/' site url to an index.html template I created on 
the fly (just for sanity check). Although it wasn't working at first, I 
restarted apache2.2 service and the web page shows fine now. I don't 
understand the idea of hosting two web servers and how Django is involved 
with this if at all. 

To me, it seems like apache routes clients to the wsgi, and the wsgi 
returns with whatever http response it conjures up? Can someone shed some 
light on this?

Thanks,
RC

-- 
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/-/9KrPNlJvEbwJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Announcement of GUI for Creating Models

2012-09-08 Thread Joni Bekenstein
This could be very useful for generating dynamic forms. You create the 
model and then just have some views that generate and process a ModelForm 
that uses the created model with this interface.

Also having a "simple" mode for the client who will actually use this would 
be helpful. For example, instead of enabling blank/null checkboxes, just 
add one "required" checkbox.

Just some ideas


On Friday, September 7, 2012 11:42:55 PM UTC-3, Timothy Clemans wrote:
>
> I've developed a GUI for creating models, see  
> https://github.com/timothyclemans/django-admin-models-editor
>
> Would this be helpful for developers? Would it be useful for you? Should I 
> keep developing it? What features would you like to see added?
>

-- 
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/-/YjY0voEABLsJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Can't Syncdb

2012-09-08 Thread Steven Elliott
What's the error message you get specifically
On Sep 8, 2012 7:31 AM, "Kollin"  wrote:

> I create a project. I create app by name "app" in the project. The app
> that :
> app
> __init__.py
> models
> __init__.py
> a.py
> b.py
> but I can't syncdb the app. I use django 1.4.
> What error?
> THX
>
> --
> 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/-/o6fxby4Smw8J.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Can't Syncdb

2012-09-08 Thread Kelly Nicholes
Did you add the app name in settings.py under the INSTALLED_APPS list?

On Friday, September 7, 2012 10:23:31 PM UTC-6, Kollin wrote:
>
> I create a project. I create app by name "app" in the project. The app 
> that :
> app
> __init__.py
> models
> __init__.py
> a.py
> b.py
> but I can't syncdb the app. I use django 1.4.
> What error?
> THX
>

-- 
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/-/9JWe4hjtB0kJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Can't Syncdb

2012-09-08 Thread Kollin
I create a project. I create app by name "app" in the project. The app that 
:
app
__init__.py
models
__init__.py
a.py
b.py
but I can't syncdb the app. I use django 1.4.
What error?
THX

-- 
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/-/o6fxby4Smw8J.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: how to use timezones for datetime fields that are foreign keys in admin interface

2012-09-08 Thread Melvyn Sopacua
On 3-9-2012 2:47, dalupus wrote:

> datetime = models.DateTimeField(auto_now_add=True)
> def __unicode__(self):
> return unicode(self.datetime)

> On the item list screen however the datetime is not formated and seems
> to be in utc format

The list display uses the unicode representation by default. See here:


-- 
Melvyn Sopacua

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Virtualenv changes url reverse behaviour

2012-09-08 Thread William Hart

>
> You've posted five time on StackOverflow and four times on this thread 
> and haven't provided that rather basic piece of information. 
>

Hey Ramiro, thanks for the reply... yes you are correct I haven't mentioned 
the version of Django I have installed.  I've experienced this on both 
1.4.1 and 1.5dev.  I think I mentioned in the comments on SO that I've 
installed and uninstalled requirements several times using the same 
requirements.txt so its happening on the same version number.

Newer versions of Djagno WILL eventually require quotes, and using the 
> 'load url from future' line allows you to get a head start on it. 
>

Thanks Aaron, good to know.   I think for now I will just use the 
workaround of removing the quotes and renaming some urls that fail, but I 
suppose the purpose of posting here was to work out if I should submit a 
bug report... 

Thanks to everybody for your replies and help!

Will

On Saturday, September 8, 2012 3:04:15 AM UTC+1, Aaron C. de Bruyn wrote:
>
> On Fri, Sep 7, 2012 at 12:36 PM, William Hart  
> wrote: 
> > And used in templates like so: 
> > {% url 'dashboard' %} 
>
> If you want to use quotes, put: 
> {% load url from future %} 
> at the top of your template. 
>
> Newer versions of Djagno WILL eventually require quotes, and using the 
> 'load url from future' line allows you to get a head start on it. 
>
> -A 
>

-- 
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/-/Zb0sBUgLhWQJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.