Re: django beginner

2014-07-10 Thread ngangsia akumbo
it is not working thanks bro




i have one more question.
I have created a series of apps for my project. like services, contact, 
news ,booking app for my hotel site.
i created their individual individual templates for each of them and 
extended it to the base.html, they are all working fine.

my probe now is how do i feature all of these feature on a single page cos 
all the apps are opening individually using thei various urls?

How do i place these seperate apps on a single web page ? how do i 
introduce design patterns on them ?

how do i deploy it so that even a client can views the already finished 
site from his desk or office, just by typing the name of the site and 
getting in to the webiste?


thanks for the reply


booking app
>>
>>>  

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d5496b23-7d39-46fa-9b48-5b25ca9ebd0f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django beginner

2014-07-10 Thread Mario Gudelj
You mentioned that you haven't completed a tutorial. You should because
this stuff is in it. Your questions are too broad and covered in docs and
other material on the web. Google is your bro :)
On 10/07/2014 5:52 pm, "ngangsia akumbo"  wrote:

> it is not working thanks bro
>
>
>
>
> i have one more question.
> I have created a series of apps for my project. like services, contact,
> news ,booking app for my hotel site.
> i created their individual individual templates for each of them and
> extended it to the base.html, they are all working fine.
>
> my probe now is how do i feature all of these feature on a single page cos
> all the apps are opening individually using thei various urls?
>
> How do i place these seperate apps on a single web page ? how do i
> introduce design patterns on them ?
>
> how do i deploy it so that even a client can views the already finished
> site from his desk or office, just by typing the name of the site and
> getting in to the webiste?
>
>
> thanks for the reply
>
>
> booking app
>>>
   --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/d5496b23-7d39-46fa-9b48-5b25ca9ebd0f%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHqTbjk70yY7Kc3JA7TNr3-jXh79MMAjwq370zyC-DME1uYqjQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: django beginner

2014-07-10 Thread ngangsia akumbo


On Thursday, July 10, 2014 9:02:10 AM UTC+1, somecallitblues wrote:
>
> You mentioned that you haven't completed a tutorial. You should because 
> this stuff is in it. Your questions are too broad and covered in docs and 
> other material on the web. Google is your bro :)
> On 10/07/2014 5:52 pm, "ngangsia akumbo" > 
> wrote:
>
>> it is not working thanks bro
>>
>>
>> can u post me the link of the tutorial ahain i have completed some 
>> tutorials on article from django documentation
>>
>> i have one more question.
>> I have created a series of apps for my project. like services, contact, 
>> news ,booking app for my hotel site.
>> i created their individual individual templates for each of them and 
>> extended it to the base.html, they are all working fine.
>>
>> my probe now is how do i feature all of these feature on a single page 
>> cos all the apps are opening individually using thei various urls?
>>
>> How do i place these seperate apps on a single web page ? how do i 
>> introduce design patterns on them ?
>>
>> how do i deploy it so that even a client can views the already finished 
>> site from his desk or office, just by typing the name of the site and 
>> getting in to the webiste?
>>
>>
>> thanks for the reply
>>
>>
>>  booking app

>   -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com 
>> .
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/d5496b23-7d39-46fa-9b48-5b25ca9ebd0f%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/9506171d-1a61-4d50-b3a3-1188710929a3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django beginner

2014-07-10 Thread ngangsia akumbo
can u post the link again cos i have completed some tutorials on articles 
from django docs

>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/241db83d-f0ae-42ea-9e9c-c3a098567594%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django beginner

2014-07-10 Thread Lachlan Musicman
https://docs.djangoproject.com/en/1.6/intro/tutorial01/

cheers
L.

On 10 July 2014 18:16, ngangsia akumbo  wrote:
> can u post the link again cos i have completed some tutorials on articles
> from django docs
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/241db83d-f0ae-42ea-9e9c-c3a098567594%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



-- 
The idea is that a beautiful image is frameable. Everything you need
to see is there: It’s everything you want, and it’s very pleasing
because there’s no extra information that you don’t get to see.
Everything’s in a nice package for you. But sublime art is
unframeable: It’s an image or idea that implies that there’s a bigger
image or idea that you can’t see: You’re only getting to look at a
fraction of it, and in that way it’s both beautiful and scary, because
it’s reminding you that there’s more that you don’t have access to.
It’s now sort of left the piece itself and it’s become your own
invention, so it’s personal as well as being scary as well as being
beautiful, which is what I really like about art like that.
---
Adventure Time http://theholenearthecenteroftheworld.com/

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAGBeqiMYnz%2BJPEntp_5qaxR-_WjXdEM9sX%3DXh1RsLM5JbKkfxQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: django beginner

2014-07-10 Thread ngangsia akumbo


This tutorial does not tell me how to place multiple apps on a webpage. it 
is just a single app tutorials.

i have created more than 5 apps how do i display them to be on one web page 
cos each of the have their individual templates


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/87af7c52-8a68-4515-991e-bebca04767b9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django beginner

2014-07-10 Thread ngangsia akumbo
sorry i saw what am looking for Thanks

On Thursday, July 10, 2014 9:33:25 AM UTC+1, ngangsia akumbo wrote:
>
>
>
> This tutorial does not tell me how to place multiple apps on a webpage. it 
> is just a single app tutorials.
>
> i have created more than 5 apps how do i display them to be on one web 
> page cos each of the have their individual templates
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/cac2f87e-3942-4774-aa64-307169b404c4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How to sort by many custom methods in Django Admin

2014-07-10 Thread 9devmail
 

I want to be able to sort by several custom methods in Django Admin. This 
question on StackOverflow 

 
provides solution for one method only.

I tried to modify it:

from django.db import models
class CustomerAdmin(admin.ModelAdmin):
list_display = ('number_of_orders','number_of_somevalue') # added field

def queryset(self, request):
qs = super(CustomerAdmin, self).queryset(request)
qs = qs.annotate(models.Count('order'))
qs = qs.annotate(models.Count('somevalue')) # added line
return qs

def number_of_orders(self, obj):
return obj.order__count
number_of_orders.admin_order_field = 'order__count'

def number_of_somevalue(self, obj): # added method
return obj.somevalue__count
number_of_somevalue.admin_order_field = 'somevalue__count'

and it works incorrectly. It seems that it multiplies the count values 
instead of counting them separately.

Example:

I have 2 orders and 2 somevalues, but in the panel I see 4 orders and 4 
somevalues. Adding another method with yet another value makes it 8 (2*2*2).

How can I fix it?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/4737bbba-8c4b-47b8-bcd8-eb69b71f5497%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


django admin

2014-07-10 Thread ngangsia akumbo
how do i display the delete button on the admin so that it should not be a 
drop down button

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/0786e48f-929f-4118-9a3a-9aeba631cb75%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Some creating Forms from models snags.

2014-07-10 Thread Don Fox
Problem went away after PyCharm indicated that two imports be removed? Not 
really sure whet the problem was!

On Wednesday, July 9, 2014 12:09:40 AM UTC-4, Lachlan Musicman wrote:
>
> On 9 July 2014 13:19, Don Fox > wrote: 
> > 
> > 
> > I should have mentioned that I already had this method in the models.py: 
> > 
> > class Article (models.Model): 
> > pub_date = models.DateField() 
> > headline = models.CharField(max_length = 30) 
> > content  = models.CharField(max_length=500) 
> > reporter = models.CharField(max_length=20) 
> > 
> > This was assumed to be needed after the definition of the article form 
> in 
> > the shell. 
> > As I said I have that same class ArticleForm in the forms.py 
> > 
> > Thanks for the reply. 
>
> Do you still have the same issue? 
>
> If so I would suggest it's a PATH problem. 
>
> In classBased (which is the folder that has manage.py?), run 
>
> python manage.py 
>
> and then do 
>
> from myapp.models import Article 
>
> if that fails, it is a PATH problem. 
>
> Googling Django PATH has heaps on it, but something like this shows the 
> way: 
>
>
> https://community.webfaction.com/questions/16064/django-module-import-problem 
>
>
> cheers 
> L. 
>
>
>
> -- 
> The idea is that a beautiful image is frameable. Everything you need 
> to see is there: It’s everything you want, and it’s very pleasing 
> because there’s no extra information that you don’t get to see. 
> Everything’s in a nice package for you. But sublime art is 
> unframeable: It’s an image or idea that implies that there’s a bigger 
> image or idea that you can’t see: You’re only getting to look at a 
> fraction of it, and in that way it’s both beautiful and scary, because 
> it’s reminding you that there’s more that you don’t have access to. 
> It’s now sort of left the piece itself and it’s become your own 
> invention, so it’s personal as well as being scary as well as being 
> beautiful, which is what I really like about art like that. 
> ---
>  
>
> Adventure Time http://theholenearthecenteroftheworld.com/ 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/85fe398d-efda-49b4-a820-042bee9539d2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Issue with "Creating forms from Modules"

2014-07-10 Thread Don Fox
While typing in the code 
in https://docs.djangoproject.com/en/1.7/topics/forms/modelforms/ I get a 
a Name Error that doesn't seem related to any omitted import module.

I'm running this is the shell that has the settings* './manage.py shell' * 
where 
I have a project reflecting this particular tutorial.

Thanks!


f = ArticleForm(request.POST)

Traceback (most recent call last):

  File "", line 1, in 

NameError: name 'request' is not defined

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b1edf4aa-0857-45d4-bc7f-79ff678e72a7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


django admin

2014-07-10 Thread Lee
I don't want to come across as unhelpful but people will really appreciate it 
if you at least try the following:

1) Properly and clearly describe your problem
2) At least show what you've done so far to try to resolve it
3) Accept and action guidance those here have been kind enough to provide it
4) Learn how to use the documentation and google. These should really be your 
first port of call, not the last

I'd recommend once again that you work through and complete the Django tutorial 
and build the application yourself as already suggested by others. There is a 
whole section on customising the admin and you'll learn all the basics you need 
to work with Django

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/92fc3455-f9f6-4bc5-aadb-be28cbe4b865%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


SVG attribute is not transformed

2014-07-10 Thread Stodge
I'm adding map data from a new source that needs to be projected so I 
transform the query set like this:

 q = 
Polyline.objects.filter(overlay='63979e90-a578-4d18-af0a-8bd75279d923').transform(93997).svg()


The resulting SVG attribute isn't transformed. The documentation says:

Attaches a SVG attribute to every model in the queryset that contains the 
Scalable 
Vector Graphics (SVG)  path data of the 
geometry fields.


Which seems to confirm my suspicion - at least how I read it. Printing the 
query confirms that the SVG attribute isn't transformed:

print q.query
SELECT (ST_AsSVG("airmap_polyline"."the_geom",0,8)) AS "svg", 
"airmap_polyline"."id", "airmap_polyline"."overlay_id", 
ST_Transform("airmap_polyline"."the_geom", 93997) FROM "airmap_polyline" 
WHERE "airmap_polyline"."overlay_id" = 63979e90-a578-4d18-af0a-8bd75279d923


Is there a way to apply the transform to the SVG attribute? I can get it 
working using raw SQL but I thought I should be able to use the ORM. Thanks


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e0603cff-5283-41db-9587-c97b09ef8a67%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Tests in 1.6

2014-07-10 Thread Larry Martell
I am trying to upgrade a site to 1.6. I read the change notes about
the tests now having to start with test.

My project's structure is this:

myproj/app/appname/tests

and in that dir was a file called EventLog.py, and in that file a
function called EventLogTest

My __init__ had:

from myproj.app.appname.tests.EventLog import EventLogTest

I would run the test with:

manage.py test appname.EventLogTest

I reanmed EventLog.py to testEventLog.py, and I also changed it in the
__init__ file to:

from myproj.app.appname.tests.testEventLog import EventLogTest

Then I tried:

manage.py test appname.EventLogTest

ImportError: No module named appname

manage.py test app.appname.EventLogTest

ImportError: No module named app

manage.py test myproj.app.appname.EventLogTest

AttributeError: 'module' object has no attribute 'EventLogTest'

manage.py test myproj.app.appname.tests.EventLogTest

AttributeError: 'module' object has no attribute 'tests'


What simple, stupid thing I am doing wrong here? What do I have to do
to run my tests in 1.6?


Thanks!
-larry

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACwCsY7RC9xGUaUOYgyxZ%3Dg%2Bqm7KYEtfYBH%3DNW8rBgFfW%3DeZ%3Dw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Advanced Query / Django Idiocy Question

2014-07-10 Thread G Z
Hello,

I'm running a very complicated query against oracle to return some data. 
I'm running it manually because django can't natively do what I am doing 
from what I have read.
I run the query but django doesn't get any values in return. I recently 
switched from my dev database to my production to run the query because it 
has live data and the required
data doesn't exist in dev yet because its a new feature.

The query executes but doesn't return anything. However there is another 
very similarly query that I am running that is returning data. Also if I 
output the exact statement
django is using to make the query against oracle for the data that is not 
returning and then if i goto terminal and execute the query against the sql 
server manually it will return the data.
I also output the fetchall to the page as a debuging tool and the working 
query has all the info but the none working one outputs blank list. 

At first I thought it was the query but i have proven the query django is 
using works but django gets no data. The only logical answer is django is 
trying to use the dev database or the models table something is off.
However I ran syncdb and sql and no errors came up... If I run the query 
against dev it doesnt return data, but does against production.

Here is the query I am running.

if 'customer_licenses_all' in request.POST:

 return_query_type = 'customer_licenses_all'
 cursor.execute("alter session set time_zone='UTC'")
 selected_customer_id = int(selected_customer['selected_customer']) 
  
 rundate = selected_customer['compute_date']
 date2 = datetime.strptime(rundate, "%d-%b-%Y")
 date_list = ()
 date_list = (date2.day, date2.month, date2.year)
 last_date =  get_last_day(date_list)
 last_date = last_date.strftime("%d-%b-%Y")

 sql = (('''select customer_name, count(*) license_count, 
sum(cpu_ghz_hours) CPU_Core_Hours, sum(ram_gb_hours) RAM_GB_Hours, 
licensing_authority, product 
from customers a, vm_groups b, vms c, 
vm_license_histories d, licenses e, vm_compute_usage_histories f, 
license_authorities g 
where a.customer_id = b.customer_id 
and b.vm_group_id = c.vm_group_id 
and c.vm_id = d.vm_id 
and d.license_id = e.license_id 
and f.vm_id = c.vm_id 
and e.license_authority_id = g.license_authority_id 
and trunc(f.datetime) = to_date(%s,'DD-MON-') 
and inactive = 'N' 
and (deassignment_date is null or 
trunc(deassignment_date) between to_date(%s,'DD-MON-') and 
last_day(to_date(%s,'DD-MON-'))) 
and cpu_ghz_hours > 0 
and g.license_authority_id not in (28,27,31) 
group by customer_name, licensing_authority, product 
order by 1,5,6''')% ("'"+rundate+"'","'"+ rundate+"'" ,"'"+last_date+"'"))
 cursor.execute(sql)
 return_query = cursor.fetchall()
 context = Context({'customers': customers,
   'return_query': return_query,
   'return_query_type':return_query_type, 
   'rundate':rundate,
   'last_date':last_date, 
   'sql':sql, 
   })


the django output 


select customer_name, count(*) license_count, sum(cpu_ghz_hours) 
CPU_Core_Hours, sum(ram_gb_hours) RAM_GB_Hours, licensing_authority, 
product from customers a, vm_groups b, vms c, vm_license_histories d, 
licenses e, vm_compute_usage_histories f, license_authorities g where 
a.customer_id = b.customer_id and b.vm_group_id = c.vm_group_id and c.vm_id 
= d.vm_id and d.license_id = e.license_id and f.vm_id = c.vm_id and 
e.license_authority_id = g.license_authority_id and trunc(f.datetime) = 
to_date('01-Jun-2014','DD-MON-') and inactive = 'N' and 
(deassignment_date is null or trunc(deassignment_date) between 
to_date('01-Jun-2014','DD-MON-') and 
last_day(to_date('30-Jun-2014','DD-MON-'))) and cpu_ghz_hours > 0 and 
g.license_authority_id not in (28,27,31) group by customer_name, 
licensing_authority, product order by 1,5,6 


[] 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c6fcf80a-7511-4e34-b31e-74f2524cd4be%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Contacts

2014-07-10 Thread Lachlan Musicman
Oh I see what I've done wrong - I presumed it would come with templates and etc.

Ok, thanks

L.

On 10 July 2014 16:06, Esau Rodriguez  wrote:
> You need to import classes from models. Try from contacts.models import
> Person (or any other class).
>
> Regards,
> Esau Rodriguez.
>
> El 10/07/2014 06:44, "Lachlan Musicman"  escribió:
>>
>> Hola,
>>
>> So I need a contact app. I could write one myself, but there are a
>> gazillion forks of something that seems quite comprehensive,
>> django-contacts.
>>
>> This is the first time I've used a third party app that adds models to
>> my project.
>>
>> I did (in a dev virtualenv) pip install django-contacts, added to the
>> settings and have sync'd against the db.
>>
>> But there is no directory in my project folder - I can only presume
>> that's because it's in /virtualenv/path/lib/python/somewhere
>>
>> How do I add contacts, without using the Admin interface?
>>
>> Should I instead just git clone from the django-contacts src/contacts
>> folder into my project instead?
>>
>> cheers
>> L.
>>
>>
>>
>> --
>> The idea is that a beautiful image is frameable. Everything you need
>> to see is there: It’s everything you want, and it’s very pleasing
>> because there’s no extra information that you don’t get to see.
>> Everything’s in a nice package for you. But sublime art is
>> unframeable: It’s an image or idea that implies that there’s a bigger
>> image or idea that you can’t see: You’re only getting to look at a
>> fraction of it, and in that way it’s both beautiful and scary, because
>> it’s reminding you that there’s more that you don’t have access to.
>> It’s now sort of left the piece itself and it’s become your own
>> invention, so it’s personal as well as being scary as well as being
>> beautiful, which is what I really like about art like that.
>>
>> ---
>> Adventure Time http://theholenearthecenteroftheworld.com/
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAGBeqiPV6THzJasTdpdz4NkLsaVS5tvOEydSHh35TuPW_aUHxA%40mail.gmail.com.
>> For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAB4Jw75apWqkzcns4SP8NVM2tij4-htLw7-EhbgJh9daw_Xsqw%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.



-- 
The idea is that a beautiful image is frameable. Everything you need
to see is there: It’s everything you want, and it’s very pleasing
because there’s no extra information that you don’t get to see.
Everything’s in a nice package for you. But sublime art is
unframeable: It’s an image or idea that implies that there’s a bigger
image or idea that you can’t see: You’re only getting to look at a
fraction of it, and in that way it’s both beautiful and scary, because
it’s reminding you that there’s more that you don’t have access to.
It’s now sort of left the piece itself and it’s become your own
invention, so it’s personal as well as being scary as well as being
beautiful, which is what I really like about art like that.
---
Adventure Time http://theholenearthecenteroftheworld.com/

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAGBeqiNjCZ7Opq_c_qLBwKdpazZydyMwrBChe0hAtsqAtxbZnA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Tests in 1.6

2014-07-10 Thread Russell Keith-Magee
On Fri, Jul 11, 2014 at 3:34 AM, Larry Martell 
wrote:

> I am trying to upgrade a site to 1.6. I read the change notes about
> the tests now having to start with test.
>
> My project's structure is this:
>
> myproj/app/appname/tests
>
> and in that dir was a file called EventLog.py, and in that file a
> function called EventLogTest
>
> My __init__ had:
>
> from myproj.app.appname.tests.EventLog import EventLogTest
>
> I would run the test with:
>
> manage.py test appname.EventLogTest
>
> I reanmed EventLog.py to testEventLog.py, and I also changed it in the
> __init__ file to:
>
> from myproj.app.appname.tests.testEventLog import EventLogTest
>
> Then I tried:
>
> manage.py test appname.EventLogTest
>
> ImportError: No module named appname
>
> manage.py test app.appname.EventLogTest
>
> ImportError: No module named app
>
> manage.py test myproj.app.appname.EventLogTest
>
> AttributeError: 'module' object has no attribute 'EventLogTest'
>
> manage.py test myproj.app.appname.tests.EventLogTest
>
> AttributeError: 'module' object has no attribute 'tests'
>
>
> What simple, stupid thing I am doing wrong here? What do I have to do
> to run my tests in 1.6?
>

It depends where you're coming from, and how long you need your project to
last.

If you've got a working Django 1.5 project, and you just need to get it
into 1.6 as fast as possible, then just add

TEST_RUNNER = 'django.test.simple.DjangoTestSuiteRunner'

to your settings file, and you're done. Your 1.6 test suite will run
exactly the same as it does in 1.5, and there won't be any change to the
way your test suite runs - no changes to the way the tests are found, and
no change to the way you execute them. That means:

 * If you've got a tests *package*, you'll have to put a bunch of imports
in the tests/__init__.py module so that all the test classes are sitting in
the appname.tests namespace

 * When you run a test, you run one of:
   - manage.py test appname
   - manage.py test appname.TestClassName
   - manage.py test appname.TestClassName.test_this_feature

However, if you want to upgrade to the "new" behaviour in 1.6, you need to
make other changes.

The "new" test runner doesn't require the imports in tests/__init__.py. It
does automated discovery of file in those submodules named test*.py. If
your tests aren't in files with "discoverable" names, you'll need to either
rename the files (and directories), or manually point manage.py test at the
right filenames.

If you've got a newly-structured test suite, then invoking tests is
slightly different, too:
   - manage.py test appname
   - manage.py test appname.tests.test_submodule.TestClassName
   - manage.py test
appname.tests.test_submodule.TestClassName.test_this_feature

That is, you give the fully qualified Python module name of a test class,
not just the 'app name.classname' simplification.

See
https://docs.djangoproject.com/en/dev/topics/testing/overview/#running-tests
for more details, including details of how to include files other than
test_*.

As an aside - if you want your project to be long lived, you'll
*eventually* need to make these naming changes to your test suite. It's
just a question of whether you need to do it *right now*. The old approach
will still work in 1.6; it will also work in 1.7, but will be more noisy.
In 1.8, the DjangoTestSuiteRunner will be removed completely. So, if you
want your project test suite to last until Django 1.8 and beyond, you'll
ultimately need to make these changes.

I hope that helps.

Yours,
Russ Magee %-)

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAJxq8487HEOV6vj2Untt9ANrUuo%2BY7uOEWqUasLArVpXatMYug%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


RuntimeWarning: DateTimeField Task.start received a naive datetime (2014-07-21 07:39:14) while time zone support is active. RuntimeWarning)

2014-07-10 Thread Neto
Hi guys, I need a help here:


*settings.py*

TIME_ZONE = 'America/Sao_Paulo'

*view.py:*
task = Task.objects.get(id=id)
task.start = request.GET['task_start']
tarefa.save()

Terminal:

RuntimeWarning: DateTimeField Task.start received a naive datetime 
(2014-07-21 07:39:14) while time zone support is active.

  RuntimeWarning)


What is it? Any solution?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e06f3e0f-e3f2-4c74-8161-411a668a6928%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: RuntimeWarning: DateTimeField Task.start received a naive datetime (2014-07-21 07:39:14) while time zone support is active. RuntimeWarning)

2014-07-10 Thread Mike Dewhirst

On 11/07/2014 1:44 PM, Neto wrote:

Hi guys, I need a help here:


*settings.py*

 TIME_ZONE = 'America/Sao_Paulo'


*view.py:*
 task = Task.objects.get(id=id)
 task.start = request.GET['task_start']
 tarefa.save()

Terminal:

RuntimeWarning: DateTimeField Task.start received a naive datetime
(2014-07-21 07:39:14) while time zone support is active.


Wherever you are getting that datetime from needs to be adjusted so it 
provides a non-naive datetime ie., with UTC offset corresponding to Sao 
Paulo.


I googled your error and saw a Stack Overflow discussion which might 
help ...


http://stackoverflow.com/questions/21038881/datetimefield-received-a-naive-datetime

Good luck

Mike






   RuntimeWarning)


What is it? Any solution?

--
You received this message because you are subscribed to the Google
Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to django-users+unsubscr...@googlegroups.com
.
To post to this group, send email to django-users@googlegroups.com
.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/e06f3e0f-e3f2-4c74-8161-411a668a6928%40googlegroups.com
.
For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/53BF88A6.7090902%40dewhirst.com.au.
For more options, visit https://groups.google.com/d/optout.