UnboundLocalError: local variable 'KeyError' referenced before assignment

2012-04-09 Thread Casey Greene
I have this very baffling error that I'm dealing with at the moment.
I'm maintaining someone else's code and I'm getting this error for
some queries with a try, except block in a view.  It seems that the
queries that lead to the error are ones where there is, in fact, a
KeyError.  I've actually manged to narrow it down to a pretty simple
test case though.  Within the view, I can do this (first few lines):

def gene_view(request, slug=None, gene=None, org=None, template=None):
   print(KeyError)

and I get this exception with django 1.4 (if it matters):
UnboundLocalError at /predictions/gene/
local variable 'KeyError' referenced before assignment



In ./manage.py shell though, I can do:
./manage.py shell
Python 2.7.2+ (default, Oct  4 2011, 20:06:09)
[GCC 4.6.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> print(KeyError)

>>> import urls
>>> print(KeyError)

>>> import predictions.views
>>> print(KeyError)

>>> import predictions.urls
>>> print(KeyError)


I was expecting that if there was some redefinition of KeyError that
one of those would also give the exception.  I've also tried this,
just for kicks:

>>> from urls import *
>>> print(KeyError)

>>> from predictions.views import *
>>> print(KeyError)

>>> from predictions.urls import *
>>> print(KeyError)

>>>

I'm not really sure where to start tracking this down.  I'm under the
impression that KeyError is one of the built in python exceptions, and
so it should really never be unbound.

Thanks for your help!
Casey

-- 
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: UnboundLocalError: local variable 'KeyError' referenced before assignment

2012-04-09 Thread Casey Greene
Great point Karen.  It hadn't occurred to me that it could be a later
occurrence that could lead to python thinking it was local.  Later:
except ValueError, KeyError

After changing it to:
except (ValueError, KeyError)
the issue is resolved.

Thanks so much!
Casey

On Mon, Apr 9, 2012 at 11:20 AM, Karen Tracey  wrote:
> On Mon, Apr 9, 2012 at 11:09 AM, Casey Greene  wrote:
>> I have this very baffling error that I'm dealing with at the moment.
>> I'm maintaining someone else's code and I'm getting this error for
>> some queries with a try, except block in a view.  It seems that the
>> queries that lead to the error are ones where there is, in fact, a
>> KeyError.  I've actually manged to narrow it down to a pretty simple
>> test case though.  Within the view, I can do this (first few lines):
>>
>> def gene_view(request, slug=None, gene=None, org=None, template=None):
>>   print(KeyError)
>>
>> and I get this exception with django 1.4 (if it matters):
>> UnboundLocalError at /predictions/gene/
>> local variable 'KeyError' referenced before assignment
>
> Python thinks KeyError is a local variable, thus it sounds like code
> in the view subsequent to where KeyError is caught makes an assignment
> to KeyError. So search later in the view for where KeyError is
> mis-assigned.
>
> Karen
> --
> http://tracey.org/kmt/
>
> --
> 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: newbie question on activating the automatic admin

2011-09-09 Thread Casey Greene

Is admin in INSTALLED_APPS?

https://docs.djangoproject.com/en/dev/ref/settings/#std:setting-INSTALLED_APPS

Casey

On 09/09/2011 07:04 PM, nara wrote:

Hi,

I am a newbie, and I am trying a very basic blog site to get familiar
with the latest development release. I followed the directions in the
tutorial (part 2) to try and get the automatic admin going. However,
here is what I get on the url localhost:8000/admin/

DoesNotExist at /admin/

Site matching query does not exist.

Request Method: GET
Request URL:http://localhost:8000/admin/
Django Version: 1.4 pre-alpha SVN-16741
Exception Type: DoesNotExist
Exception Value:

Site matching query does not exist.

Further, syncdb, even on a brand new database, does not create tables
for the admin, just for django and my blog model.

Ideas, suggestions?

Thanks
Nara



--
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: Admin Site appending letter "s" to end of each model\table name

2011-09-12 Thread Casey Greene

http://www.the-dig.com/blog/post/customize-plural-name-django-admin/

Casey

On 09/10/2011 05:40 PM, Gillwill wrote:

Apparently the Django default is to append the letter "s" to the end
of the model name for each listed under a given application on the
Site Administration page. (It does this in the tutorial sample site as
well - e.g. naming "poll" "polls", etc...)

Is there any way to get rid of that?

I would think there would be, but I've yet to find in the default
admin templates or code where it is doing this.

Any help appreciated.

-Gil



--
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: Admin Site appending letter "s" to end of each model\table name

2011-09-12 Thread Casey Greene
I did not realize that my email client had not grabbed new mail from 
today and this was 2 days old.  Sorry for the reply ad nauseum.


Casey

On 09/12/2011 09:24 AM, Casey Greene wrote:

http://www.the-dig.com/blog/post/customize-plural-name-django-admin/

Casey

On 09/10/2011 05:40 PM, Gillwill wrote:

Apparently the Django default is to append the letter "s" to the end
of the model name for each listed under a given application on the
Site Administration page. (It does this in the tutorial sample site as
well - e.g. naming "poll" "polls", etc...)

Is there any way to get rid of that?

I would think there would be, but I've yet to find in the default
admin templates or code where it is doing this.

Any help appreciated.

-Gil





--
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: How do you pinpoint a performance issue?

2011-10-22 Thread Casey Greene
My impression here is that the django-debug-toolbar wouldn't help here 
though, because the issue wasn't with the request.  It was during 
initialization of the gunicorn processes.


You can have logging.debug at function enter/exit points, so that you 
can switch to that log level if necessary (or, I suppose, a function 
decorator that does that).  It is always fairly easy to come up with the 
proper logging to discover the problems that you've already experienced 
though.  Another potential solution would be a larger database during 
testing, which probably would have created the same issue (so you would 
have noticed it at that phase).


Perhaps your development database could be a copy of some realistic 
state (at least size-wise) of your production database?


I would love to see an article/blog post/documentation about "logging 
best practices and why" focused on django, but I haven't come across one 
yet.


Hope this helps,
Casey

On 10/21/2011 03:15 PM, Javier Guerra Giraldez wrote:

On Fri, Oct 21, 2011 at 2:08 PM, Shawn Milochik  wrote:

What's the best way to start looking for a problem like this? I


Django-debug-toolbar is the first line of defense (well, second.  the
first is to use good algorithms).  in the vast majority of cases, any
performance issue is because too many queries, or a single one that
linearly scans huge tables.

what i do is to check the number of queries performed by any request,
as soon as i have it working.  if i see a repeated one, it's usually
tiem to rethink it.

then, i also check the EXPLAIN plan for the heaviest ones, and if the
view includes significant Python code, also the timing reports.



--
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: custom queryset with calculated field

2011-10-22 Thread Casey Greene
The database isn't going to know about your property because that's all 
on the python side (thus the error).  Why do you need the formatted time 
when looking in the database?  I think Pedro is right, if this is only 
for display, it'd be better to do it with a template tag/filter.


Casey

On 10/22/2011 06:18 PM, dr.phil wrote:

Thank you for the response. I added a function to the model to convert
a datetime field into the needed format (def convert_time). Then I set
new_time = property(convert_time). If I iterate over the queryset I
can access each.new_time BUT I need the value in the queryset
(Model.objects.filter().values('new_time')). Unfortunately Iget an
attribute error.

Thank you.

On Oct 22, 2:10 pm, Pedro Vasconcelos  wrote:

Hello,

A possible solution is create a specific method in your model class to do
this calculation. Take a look 
at:https://docs.djangoproject.com/en/1.3/topics/db/models/#model-methods

If you only want to do this calculations to show it in templates you may
consider creating a specific template custom tag/filters.

Regards,









On Sat, Oct 22, 2011 at 1:31 AM, dr.phil  wrote:

Is this possible? I have a model that includes a datetime field.  When
creating a queryset of this model, I want to include a calculated
field of the time difference (in hours:minutes compared to
datetime.now).



Currently, when creating a queryset the datetime is included. I can
iterate through the queryset to calculate the time difference and
replace the value. HOWEVER, when I act on this queryset, the original
(with datetime oject) is used, not the new dictionary I created.



Help is apppreciated.



--
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.


--
Pedro Vasconcelos85 8767.1843
ptronico (skype)




--
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: custom queryset with calculated field

2011-10-23 Thread Casey Greene
What is the error that that function gives you?  It may be possible to 
just fix that function.


Casey

On 10/23/2011 07:42 AM, dr.phil wrote:

The reason for this exercise is to produce suitable output for the
jquery plugin datatables.  I am trying to use the following code
http://rus.hk/django-data-parser-for-jquery-datatable/

There are no problems until I include a datetime field. Then
'datatabilize' fails because it cannot jsonify a datetime object.

Probably the easiest solution is to avoid this generic utility
function and build my own?

On Oct 22, 11:15 pm, Pedro Vasconcelos  wrote:

If you post the relevant part of your code inhttp://dpaste.com/will be
more easy to help you!

On Saturday, October 22, 2011, dr.phil  wrote:

Thank you for the response. I added a function to the model to convert
a datetime field into the needed format (def convert_time). Then I set
new_time = property(convert_time). If I iterate over the queryset I
can access each.new_time BUT I need the value in the queryset
(Model.objects.filter().values('new_time')). Unfortunately Iget an
attribute error.



Thank you.



On Oct 22, 2:10 pm, Pedro Vasconcelos  wrote:

Hello,



A possible solution is create a specific method in your model class to do
this calculation. Take a look at:


https://docs.djangoproject.com/en/1.3/topics/db/models/#model-methods










If you only want to do this calculations to show it in templates you may
consider creating a specific template custom tag/filters.



Regards,



On Sat, Oct 22, 2011 at 1:31 AM, dr.phil  wrote:

Is this possible? I have a model that includes a datetime field.  When
creating a queryset of this model, I want to include a calculated
field of the time difference (in hours:minutes compared to
datetime.now).



Currently, when creating a queryset the datetime is included. I can
iterate through the queryset to calculate the time difference and
replace the value. HOWEVER, when I act on this queryset, the original
(with datetime oject) is used, not the new dictionary I created.



Help is apppreciated.



--
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.



--
Pedro Vasconcelos858767.1843
ptronico (skype)



--
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.



--
Pedro Vasconcelos85 8767.1843
ptronico (skype)




--
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 Gig

2011-11-12 Thread Casey Greene
He means, "are you interested in job applicants that are not on-site 
(i.e. people working remotely)?"


Hope this helps,
Casey

On 11/12/2011 08:52 AM, mo.mughrabi wrote:

We are located in Kuwait as for the second question am not quite sure
what you mean.

On Nov 12, 6:07 am, Russell Keith-Magee
wrote:

On Fri, Nov 11, 2011 at 9:49 PM, Mo Mughrabi  wrote:

Hello fellows django developers,

...

Please email me back if you are interested and I could share more details,
Best regards,


Hi Mo,

Two very important details that you might want to share:

  * Where is your company located?

  * Are you interested in applicants that want to telecommute?

Remember -- django-users is a mailing list with an international
audience. Just saying "Who wants a job" isn't very helpful unless you
are genuinely willing to hire anyone, anywhere.

Yours,
Russ Magee %-)




--
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: Which Linux distro to use on EC2?

2011-11-13 Thread Casey Greene
I would suggest that you use whatever your sysadmin (or if no sysadmin, 
developer (or if it's just you, you)) are most familiar with.  I assume 
the packages that you are using (at least the ones you've listed) will 
be in the package management systems for any of the distros that you 
have listed.


I'm also pretty sure that gentoo is not a variant of debian.

Casey

On 11/13/2011 03:58 PM, Charles Cossé wrote:

The main difference with Ubuntu is that it's a binary distribution
(pre-compiled binaries for a standardized platform).  I use Gentoo,
personally, which is a variant of Debian with "portage" rather than
"apt".   LAMP server stuff is readily available on all distros of Linux.
  If you're hardcore then use Gentoo.  If you're medium-core then use
Debian.  If you're softcore then use Ubuntu.  If you like RedHat style
more than Debian, then go CentOS.  Whichever you choose, you'll
immediately need to familiarize yourself with it's package manager and
how things are done on that platform.  good luck :-)

On Sun, Nov 13, 2011 at 12:56 PM, ydjango mailto:neerash...@gmail.com>> wrote:

I am setting up nginex, apache, python django, mysql based application
on EC2. I expect high web traffic and high mysql query usage. Mysql
and web server will on seperate servers.

Which linux distro should I use for heavy production use - Ubuntu,
Centos or Debian?

Does it matter?

I see most instructions on web is using Ubuntu and it seems it is
considered easiest to set up. But I read somewhere that Ubuntu is not
for server use. What is the downside if I chose ubuntu?

--
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.




--
AsymptopiaSoftware|Software@theLimit
http://www.asymptopia.org

--
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.



Citing Django

2013-03-20 Thread Casey Greene
Does anyone have a standard way of citing Django? This ticket:
https://code.djangoproject.com/ticket/15379
seems to indicate that the preferred way might be:
Django core team (2011). Django: A Web framework for the Python
programming language. Django Software Foundation, Lawrence, Kansas,
U.S.A. URL http://www.djangoproject.com

I'm happy to go with that, but I'd like confirmation that that's the
preferred way to go. Thus far we've used Django quite a bit (e.g. its
used by both http://imp.princeton.edu and http://pilgrm.princeton.edu
) but it hasn't been cited or discussed in the technical parts of
these papers. We do, however, cite R and its packages when we use
those methods, since there's a commonly accepted way to do so.
Providing this readily might help Django gain additional traction in
the academic community (i.e. with regular mentions of the framework
and evidence of its appropriateness for various tasks).

Thanks!
Casey

-- 
Casey Greene
Assistant Professor
Department of Genetics
Institute for Quantitative Biomedical Sciences
Norris Cotton Cancer Center
The Geisel School of Medicine at Dartmouth
Hanover, NH

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Citing Django

2013-03-21 Thread Casey Greene
Sorry -- I guess I didn't mean the manual of style part, but instead
the various fields. Thanks for your help. Embarrassingly I just
realized that apparently that bug is one that I filed a couple years
ago.

Thanks again!
Casey

On Wed, Mar 20, 2013 at 7:58 PM, Russell Keith-Magee
 wrote:
>
>
> On Thu, Mar 21, 2013 at 5:18 AM, Casey Greene 
> wrote:
>>
>> Does anyone have a standard way of citing Django? This ticket:
>> https://code.djangoproject.com/ticket/15379
>> seems to indicate that the preferred way might be:
>> Django core team (2011). Django: A Web framework for the Python
>> programming language. Django Software Foundation, Lawrence, Kansas,
>> U.S.A. URL http://www.djangoproject.com
>>
>> I'm happy to go with that, but I'd like confirmation that that's the
>> preferred way to go. Thus far we've used Django quite a bit (e.g. its
>> used by both http://imp.princeton.edu and http://pilgrm.princeton.edu
>> ) but it hasn't been cited or discussed in the technical parts of
>> these papers. We do, however, cite R and its packages when we use
>> those methods, since there's a commonly accepted way to do so.
>> Providing this readily might help Django gain additional traction in
>> the academic community (i.e. with regular mentions of the framework
>> and evidence of its appropriateness for various tasks).
>>
>
> There isn't an "official" citation format, for two reasons: citation formats
> can vary wildly between publications, and citation standards for software
> are still a matter of some debate.
>
> APA style [1], for example, would dictate something like:
>
> Django (Version 1.5) [Computer Software]. (2013). Retrieved from
> http://djangoproject.com
>
> However, the only true guide is what your publisher will accept. I'd suggest
> getting hold of your publishers guidelines, and filling in the gaps as best
> you can.
>
> If your referencing style guide requires a publisher name, use "Django
> Software Foundation".
>
> If you need a publishing location, use "Lawrence, Kansas".
>
> If you need a web address, use http://djangoproject.com
>
> If you need a name, just use "Django", without any tagline.
>
> If you need a publication date, use the year of release of the version
> you're referencing (e.g., 2013 for v1.5)
>
> Beyond, that, fill in as seems appropriate for your needs.
>
> [1]
> http://www.usq.edu.au/library/referencing/apa-referencing-guide#Other_electronic_media
>
> 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?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>



-- 
Casey Greene
Assistant Professor
Department of Genetics
Institute for Quantitative Biomedical Sciences
Norris Cotton Cancer Center
The Geisel School of Medicine at Dartmouth
Hanover, NH

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Job Opportunity @ Dartmouth (Hanover, NH)

2013-08-20 Thread Casey Greene
Hi django-users,

I wanted to let you guys know about a job opportunity in my lab for a
position where we'd like to have someone with django expertise. The listing
is available through the Dartmouth jobs website:
https://searchjobs.dartmouth.edu/postings/20736

This position is on site in our lab located in Hanover, NH (
http://en.wikipedia.org/wiki/Hanover,_New_Hampshire ) in The Geisel School
of Medicine at Dartmouth (
http://en.wikipedia.org/wiki/Geisel_School_of_Medicine ).

Job Description:

In a cover letter please provide, if possible, examples of code
contributions (Bitbucket, GitHub, etc.) and/or contributions via
StackOverflow to demonstrate expertise.

Key Accountabilities:

Programming

   - Develops and writes computer programs to integrate genome-scale
   experiments and predict traits, drug treatment response, and other
   endpoints.
   - Designs, codes, tests, and documents such programs.
   - Adapts, improves, and debugs existing libraries.
   - Develops standalone programs and webservers for the analysis and
   visualization of large experimental compendia.
   - Optimizes existing systems that integrate and analyze large data
   compendia.

Skills & Knowledge:

   - Expertise in either Python and Javascript or similar languages with
   ability to rapidly transition to Python/Javascript.
   - Ability to work productively and communicate effectively with people
   of varying technical backgrounds.
   - Knowledge of or interest in genomics or molecular biology is highly
   desirable.
   - Understanding of software architecture, OO principles, and design
   patterns is desirable.
   - Expertise in web-software development is desirable.

Experience:

   - Experience with relational databases and web-development.
   - Professional experience including QA and user interface design is
   desirable.
   - Experience with D3.js, and Django is desirable.

Education:

   - Bachelor’s degree in Computer Science or a closely related field.

Additional Information/Instructions:

This position is funded by a grant. Continuation is based upon available
funds.

Employment in this position is contingent upon consent to and successful
completion of a pre-employment background check, which may include a
criminal background check, reference checks, verification of work history,
and verification of any required academic credentials, licenses, and/or
certifications, with results acceptable to Dartmouth College. A criminal
conviction will not automatically disqualify an applicant from employment.
Background check information will be used in a confidential,
non-discriminatory manner consistent with state and federal law.
Thanks!
Casey

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: forum and blog for developers

2011-05-21 Thread Casey Greene
I also feel that something of the sort would be helpful if someone else 
started it.  djangoweek.ly had its inaugural issue fairly recently and I 
enjoy reading it each week, but it relies on other people to generate 
interesting blog posts, apps, etc:


http://djangoweek.ly/

Casey

On 05/21/2011 08:57 PM, AJ wrote:

Excellent suggestion Russ!

On Sat, May 21, 2011 at 8:17 PM, Russell Keith-Magee
mailto:russ...@keith-magee.com>> wrote:

On Sunday, May 22, 2011, fei mailto:xji...@gmail.com>> wrote:
 > I have been using Django for a while. The documentation for the
Django
 > official web page is great, plus the free online django book. There
 > are enough documentations to get started using Django. However, I
feel
 > there is a missing blog for Django developers.

Django has a blog - it's linked from the homepage.

http://djangoproject.com/weblog

However, it's only used for large project announcements (releases,
conferences, and so on).

 > Having a blog for developers is very useful. The blog can publish
 > articles regarding the latest features, design decisions behind the
 > scene and useful tricks. For example, Django introduced class base
 > generic view from version 1.3. An blog article can talk about why to
 > move from function based generic view to class based.
 >
 > As Django developers, it's better not just to know how to use Django,
 > but also to understand why Django is doing this way. Learning it this
 > way can help developers write better code. Having a official blog is
 > also a form of advertising for Django, so more people will start to
 > use Django. The Android blog is a very good example (http://android-
 > developers.blogspot.com/ ). I
found out the Android blog is very
 > useful.

Is a developer blog, in principle, a good idea? Sure. however, we
simply don't have the power or resources to compel anyone to write
entries.

There's a significant difference between Android and Django - Django
is an open source project maintained by volunteers, whereas Android is
funded and is being actively promoted by Google. Google pays for
people specifically to write this sort of blog content; Django doesn't
have those resources. If we want a blog entry, someone has to
volunteer the time to write it. And that means that writing blog
entries is competing for attention with fixing bugs, answering
questions on mailing lists, and so on.

The good news is that because we are a volunteer organization,
*anyone* can help out. If you think a developer blog would be
worthwhile, start writing! You don't need to be officially blessed to
start a blog. Once you've got the blog, you can add it to the
community aggregator, so everyone knows about it. If you make a habit
of writing good blog entries, you will become known as a valuable
community resource, and the entire community will benefit.

Yours,
Russ Magee %-)

--
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.




--
AJ

--
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.



Annotate with a filtered Count

2011-05-24 Thread Casey Greene


I am trying to figure out how to annotate with a count that is filtered. 
 Here is a quick example of the situation and what I'm looking for:


models.py:

class A(models.Model):
name = models.CharField(...)
...

class B(models.Model):
date = models.DateField(null=False)
...

---
views.py
(proper imports)

def myview(request):

#here I would like to filter based on a date field from the form
#let's call the form 'form' and the field 'date'
a_qset = A.objects.annotate(before_val=Count(
  'b__date__lte='+form.cleaned_data['date']))

---

Basically I want the number of B as of the date 
form.cleaned_data['date'] accessible in a queryset of As.


Now I know this code isn't correct (since I don't know the proper way to 
approach it) and is vastly simplified, but hopefully it gives an idea of 
what I want to do.  Any suggestions are greatly appreciated.


Thanks!
Casey

--
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: Annotate with a filtered Count

2011-05-26 Thread Casey Greene
It looks like other people who encounter this end up going with extra, 
so I think that's the path that I'll take too:


http://www.djangofoo.com/182/filter-annotate-count

Casey

On 05/25/2011 08:34 PM, Sean McArthur wrote:

I would be very interested to know if there is a way to do this using
Django's Aggregation API. For now, the only solution I can come up with
is having to use a fat .extra() call.

--
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: primary key auto increment with PostgreSQL and non Django standard column name

2011-05-27 Thread Casey Greene
Doesn't autofield with primary_key=True handle this for you (instead of 
making it an IntegerField):


https://docs.djangoproject.com/en/1.3/ref/models/fields/#autofield

Hope this helps!
Casey

On 05/27/2011 07:22 PM, Naoko Reeves wrote:

Hi, I have a Django newbie question.
My goal is to auto increment primary key with non Django standard column
name.
We are converting from existing database and primary key schema is
"tablename_key" and not "id".
I googled it and end up reaching to this ticket:
https://code.djangoproject.com/ticket/13295
So I understand that there is work in progress but I wanted find work
around..

1. My first try was to let postgres handle it.

my postgreSQL table looks like this:

CREATE TABLE poll
(
   poll_key integer NOT NULL DEFAULT nextval('poll_key_seq'::regclass),
   poll_question character varying(200) NOT NULL,
   poll_pub_date timestamp with time zone NOT NULL,
   CONSTRAINT poll_pkey PRIMARY KEY (poll_key)
)

My model look like this:
class Poll(models.Model):
 poll_key = models.IntegerField(primary_key=True)
 poll_question = models.CharField(max_length=200, default='')
 poll_pub_date = models.DateTimeField('date published',
default=datetime.date.today())
 class Meta:
 db_table = u'poll'

I was hoping that with this, I could
p = Poll(poll_question="Question 1?")
p.save()

but this fails because Django is actually sending the following statement:
INSERT INTO "poll" ("poll_key", "poll_question", "poll_pub_date")
VALUES (NULL, 'Question 1?', NULL)


2. My Second attempt is then to add default to model

Created a function to return sequence value
from django.db import connection
def c_get_next_key(seq_name):
""" return next value of sequence """
 c = connection.cursor()
 c.execute("SELECT nextval('%s')" % seq_name)
 row = c.fetchone()
 return int(row[0])

Calling like below works just fine. Everytime I call it, I get new number.
c_get_next_key('poll_key_seq')

Then I modify Poll_key in Poll model as follows:
Poll_key = models.IntegerField(primary_key=True,
default=c_get_next_key('poll_key_seq'))

I went to Django Shell and created first record.
p1 = Poll(poll_question="P1")
p1.poll_key
# this will return let's say 37
p1.save()
# saves just fine.

# instantiating new object
p2 = Poll(poll_question="P2")
p2.poll_key
# this also return 37.

I know I must be doing something wrong... but could you pint me to right
direction? I am expecting p2.poll_key to return 38.
Thank you very much for your help in advance.

Naoko





--
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: DEBUG=False issue

2011-06-02 Thread Casey Greene
You are probably registering your models for the admin section in 
models.py instead of an admin.py file.  This works in DEBUG where all of 
the models files but not when DEBUG is off.


https://docs.djangoproject.com/en/dev/ref/contrib/admin/#modeladmin-objects

Hope this helps,
Casey

On 06/02/2011 02:23 PM, Bobby Roberts wrote:

hey -

i've got a weird issue with a django app.  The app runs great on both
the front end and in the /admin section when DEBUG=True in my
settings.py file.  However, whenever I set DEBUG=False in the settings
file so that i get tracebacks by email, the entire /admin section
404s.  Any idea what could be causing this?



--
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: Posible Django Admin BUG

2011-02-02 Thread Casey Greene

Hi Jorge,

The Django code repository and bug report system is here:
http://code.djangoproject.com/

Hope this helps,
Casey

On 02/02/2011 09:30 AM, Jorge Kleinerman (WindBack) wrote:

With the last Django 1.2 I have the following problem trying to render
the admin interface: Exception Value: Caught ValueError while
rendering: invalid literal for int() with base 10: 'psi102'.
I didn't have this problem in a previous version of django.

This is my models.py: http://pastebin.com/eJqUXm4Y and this is my
admin.py: http://pastebin.com/pdWZK5q1 . When I add the first
callrecord from admin interface I have the following render problem:
http://pastebin.com/7yGvjpK9. This is a problem just rendering
callrecord. I checked manually and the object was succesfully added to
database. Also removing int(), from /usr/local/lib/python2.6/dist-
packages/django/db/models/fields/__init__.py in get_prep_value, line
479, works perfect.

Seems to be a DJANGO Admin BUG

I asked in freenode, django channel and they told me that it should be
a bug an I should report it

Thanks

Jorge



--
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: jquery grid and django

2011-02-03 Thread Casey Greene
I have not specifically used jquerygrid but it looks like it will 
request the data from a URL and all that you need to do is set up a view 
there to return the proper json objects to it.


It is basically like any other django view, just that you would be 
returning json instead of html.  I have been using datatables:

http://www.datatables.net/
with the same strategy and have found it relatively straightforward, so 
if you already know how to use django it shouldn't be too much different 
-- just json instead of html gets returned.


Hopefully this helps,
Casey

On 02/03/2011 07:50 PM, Tony wrote:

I found a plugin that combines the two but you cant look at the source
unless you have been approved by the creator.  Is there any viable,
simple way to use the jquery grid plugin with django fairly quickly?



--
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: automated query if already exists

2011-03-09 Thread Casey Greene

Hi Patrick,

Does get not do what you want?

http://docs.djangoproject.com/en/dev/topics/db/queries/#retrieving-a-single-object-with-get

Hope this helps,
Casey

On 03/09/2011 08:03 AM, Szabo, Patrick (LNG-VIE) wrote:

Hi,

Since django is able to do so much so easy i was wandering if there was
some kind of possibility to check if an entry with the same values
already exists.

I’ve tried unique_together but this only does the job on the database
end and if i want to store an not unique object i get an error.

I’d rather not show that error but return my own message.

Is there a simpler way to do this thatn check alle the entries ”manually”

Kind regards

. . . . . . . . . . . . . . . . . . . . . . . . . .

**

Patrick Szabo
XSLT Developer

LexisNexis
Marxergasse 25, 1030 Wien

patrick.sz...@lexisnexis.at 

Tel.: +43 (1) 534 52 - 1573

Fax: +43 (1) 534 52 - 146



--
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: CSRF Cookie in IE

2011-03-09 Thread Casey Greene

Everything makes sense about this except for:

> If the user hasn't visited a page that has #csrfmiddlewaretoken on it
> then there is also no cookie, in IE only.

I am looking in firefox as well and I cannot see that cookie until I 
visit a page that has the csrf_token on it -- afterwards it persists. 
Can you confirm that your cookie settings are the same in firefox and IE?


Also, I use the csrf_token with any form that POSTs to my domain, (ajax 
or otherwise), which prevents this issue.


Hope this helps,
Casey


On 03/09/2011 09:24 AM, cootetom wrote:

I have got the jQuery that does the ajaxSetup. However the problem is
when #csrfmiddlewaretoken isn't on the page. My jQuery is as the
Django documentation suggests which is to read the cookie value which
is meant to be set at every request.

If the user hasn't visited a page that has #csrfmiddlewaretoken on it
then there is also no cookie, in IE only.

I can solve my issue by putting {% csrf_token %} on every page of the
web site but something is telling me there is a deeper problem.




On Mar 9, 2:12 pm, krzysiekpl  wrote:

Did you try add custom header X-CSRFToken ? Try this solution if youre
using jquery

$.ajaxSetup({
 beforeSend: function(xhr, settings) {
 if (!(/^http:.*/.test(settings.url) || /
^https:.*/.test(settings.url))) {
 // Only send the token to relative URLs i.e. locally.
 xhr.setRequestHeader("X-CSRFToken",
  $("#csrfmiddlewaretoken").val());
 }
 }
 });

http://www.djangoproject.com/weblog/2011/feb/08/security/

On 9 Mar, 14:59, cootetom  wrote:








I am experiencing some off behaviour with CSRF but only in IE
browsers. Using Django 1.2.5 (final).



I have a page that has no form and no use of {% csrf_token %} but it
does make a POST request using JavaScript. I have implemented the
jQuery code to grab the CSRF cookie value for all AJAX requests. The
strange thing is that in IE browsers there is no CSRF cookie but in
all other browsers, on the same page that cookie exists. So IE
browsers get 403 for AJAX requests and other browsers work just fine.



I'm just using the django.middleware.csrf.CsrfViewMiddleware
middleware.



Here is the scenario to replicate this:



1. Visit a page that does have a form and so does have a {% csrf_token
%}
2. Move onto a page that doesn't make use of {% csrf_token %} but does
still do a JavaScript POST. The JavaScript POST will work this time
around.
3. Close the web browser down, re-open it but go directly to the web
page that doesn't use {% csrf_token %} but does make a JavaScript
POST. This will now fail as no cookie has been set for CSRF.



The documentation says the cookie is set for every request so I don't
understand this?




--
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: How to delete ONLY m2m relation?

2011-03-09 Thread Casey Greene

If you are using django 1.2 or lower you will have to override delete.
http://docs.djangoproject.com/en/dev/topics/db/models/#overriding-predefined-model-methods

For 1.3 you can use the new on_delete:
http://docs.djangoproject.com/en/dev/ref/models/fields/#django.db.models.ForeignKey.on_delete

Hope this helps,
Casey

On 03/09/2011 09:46 AM, galgal wrote:

model:
class Province(models.Model):
user = models.ManyToManyField(User, blank=True)
name = models.CharField(max_length=30, unique=True)

How can I delete relation when I know user_id and province_id? If i user
delete() method it also removes province and I want to avoid it.

--
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: How to delete ONLY m2m relation?

2011-03-09 Thread Casey Greene

In that case, I believe you can remove it with

user.province_set.remove(province)
user.save()

if you have the user and province objects.

I am going from memory here.  I tried to find this in the docs to make 
sure but couldn't.


Hope this helps,
Casey

On 03/09/2011 10:02 AM, galgal wrote:

Thanks, but I don't want to delete any "main" objects. I want to delete
ONLY 1 specific relation - I know user and province, and want to unlink
the user from province.

--
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: Error 503 Service Unavailable from 127.0.0.1

2011-03-09 Thread Casey Greene

Do you have DEBUG = True in your settings.py?

If not, set it to true and that should provide additional information.

Hope this helps,
Casey

On 03/09/2011 12:35 PM, pjstunna wrote:

Hi,

I just recently discovered Django and I'm following the Django
tutorial as it is written on the website ( 
http://docs.djangoproject.com/en/dev//intro/tutorial01/
) but when i start the development server and view http://127.0.0.1:8000
from my browser I get this error

Error 503 Service Unavailable from 127.0.0.1

I just installed Django 1.2.5 and I'm using the SQlite3 backend on a
Windows 7 laptop

Please help!!!

Thanks



--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-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: /admin weirdness

2011-03-17 Thread Casey Greene
Where are you registering your models for the admin site and what does 
that code look like?


Casey

On 03/17/2011 03:14 PM, chris hendrix wrote:

yeah the urls file looks fine... it only happens randomly but seems tied
to DEBUG=False for some reason... not sure why that would make a difference.



On 03/17/2011 03:09 PM, werefr0g wrote:

Hi Bobby,

Maybe some mistake on your url.py, for example if you have an app
named "app" and a model named "model", you'll try to get this url to
add a new "model"

/admin/app/model/add/

Usually, you'll write your urls.py like this:

(r'^app/', include('app.urls')),
(r'^admin/', include(admin.site.urls)),

If you forget the "^" before app/, the url for adding a new model will
match the regex 'app/', and the admin will be shorcut, Just a guess
against the material you brought ;)

Regards,

--
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: /admin weirdness

2011-03-18 Thread Casey Greene
It is because your admin models are registered in models.py.  If you 
register them in admin.py you will not observe this problem.  Just move 
the RecordAdmin class and the registration into admin.py (although if 
you want to, I'm pretty sure only the registration has to be in admin.py 
if you import the Record and RecordAdmin).


Hope this helps,
Casey

On 03/17/2011 05:35 PM, chris hendrix wrote:

admin models are registered in models.py for each app. Some people say
to use an admin.py file but I've never had to do that before. currently
using:

Django 1.2.3 (mod_wsgi 3.2/Python 2.6) and hosting at webfaction

There's nothing special about the model view. Here's one of them:




from datetime import datetime
from Client.models import Record as CRecord

class Record (models.Model):
id = models.AutoField (primary_key=True)
title = models.CharField (max_length=128, blank=False)
date = models.BigIntegerField (blank=False)
client_id = models.ForeignKey(CRecord,db_index=True, blank=False)
specialEventDate = models.IntegerField (blank=False)
comments = models.TextField (blank=False)
al_number = models.CharField (max_length=128, blank=False)
lastOpened = models.BigIntegerField (blank=False)
whenSubmitted = models.BigIntegerField (blank=False)
source = models.CharField (max_length=255, blank=False)

class RecordAdmin(admin.ModelAdmin):
def Client_Firstname(self, obj):
return obj.client_id.firstName

def Client_Lastname(self, obj):
return obj.client_id.lastName

def OrderDate(self, obj):
return datetime.fromtimestamp(obj.date)

def DateSubmitted(self, obj):
return datetime.fromtimestamp(obj.whenSubmitted)

list_display =
('id','Client_Firstname','Client_Lastname','client_id','OrderDate','DateSubmitted')

search_fields =
['client_id__firstName','client_id__lastName','client_id__id','title','status','comments','source']


admin.site.register(Record,RecordAdmin)





any ideas?

On 03/17/2011 03:50 PM, Casey Greene wrote:

Where are you registering your models for the admin site and what does
that code look like?

Casey

On 03/17/2011 03:14 PM, chris hendrix wrote:

yeah the urls file looks fine... it only happens randomly but seems tied
to DEBUG=False for some reason... not sure why that would make a
difference.



On 03/17/2011 03:09 PM, werefr0g wrote:

Hi Bobby,

Maybe some mistake on your url.py, for example if you have an app
named "app" and a model named "model", you'll try to get this url to
add a new "model"

/admin/app/model/add/

Usually, you'll write your urls.py like this:

(r'^app/', include('app.urls')),
(r'^admin/', include(admin.site.urls)),

If you forget the "^" before app/, the url for adding a new model will
match the regex 'app/', and the admin will be shorcut, Just a guess
against the material you brought ;)

Regards,

--
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 1.3

2011-03-22 Thread Casey Greene
While the tone of the e-mail isn't really appropriate, I think the 
question is a good one.  The most recent update 
(http://www.djangoproject.com/weblog/2011/mar/03/13-rc/) was from March 
3rd and said that "Barring major issues discovered with this package, 
the final Django 1.3 release will follow a little over a week from now," 
but now it is 19 days later and there has not been a more recent update. 
 Does this mean that major issues were discovered in the RC?


Even a quick note in the weblog about the revised date would be helpful. 
 The earlier updates about the February release of 1.3 getting pushed 
back were helpful in this way.


Casey

On 03/22/2011 12:09 PM, Ovnicraft wrote:



On Tue, Mar 22, 2011 at 10:43 AM, django_user :)
mailto:srb-stefan...@hotmail.de>> wrote:

hey,
can someone tell me when the final version of django 1.3 appears???
i need it immediately!
thank you


Hello you can read about here:
http://www.djangoproject.com/weblog/2011/feb/16/django-1_3-release-schedule-update-4/
So if you can wait more you can get the code from repository (you will
find the access in django site.)  and test the RC and update asap
following the django policy for this.

Regards,

--
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.




--
Cristian Salamea
@ovnicraft

--
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: Group by date: Annotate & Aggregate Query

2011-03-24 Thread Casey Greene

Aggregation for dates is a feature that has a trac ticket:
http://code.djangoproject.com/ticket/10302

One option would be to implement this (it's also listed for google SoC 
2011 so maybe someone else will do it 
http://code.djangoproject.com/wiki/SummerOfCode2011#Improveannotationandaggregation 
).


Casey

On 03/24/2011 01:34 PM, James Taylor wrote:

Hi,
We're trying to do some reports of various things, and one of the 
common issues we have is to do statistics on a per day or per-month basis - A 
google search for various terms finds quite a few stackoverflow people trying 
to do the same thing and not a lot of people are getting any success without 
reverting to rawsql, which I don't really want to do.

I've made the smallest example I can here (on the end of this email), which is 
a model file and a management command that goes with it. I've created two 
linked (one to many) models, 'Article' with many 'Comments' - I want to know 
how many comments have been made on each article per day (and preferably 
efficiently without having to do a query per day with a specific filter).

Effectively, the code that I think *should work* is is:

query = Comment.objects.values( "article__title",  
"made_at__year").annotate(comments=Count("pk"))

The error i get is:

" django.core.exceptions.FieldError: Cannot resolve keyword 'made_at__year' into 
field. Choices are: article, author, id, made_at, message"

What are my options?

Best Regards
JT

--
Smallest app demonstrating issue:

Models (stest/models.py)


from django.db import models

# Create your models here.

class Article (models.Model):
title = models.TextField()
body = models.TextField()

class Comment (models.Model):
message = models.TextField()
author = models.TextField()
made_at = models.DateTimeField()
article = models.ForeignKey(Article)

Command (stest/management/commands/stats.py)


from django.core.management.base import BaseCommand, CommandError
from django.db.models import Count
from stest.models import Article, Comment
from datetime import datetime

class Command(BaseCommand):
args = ''
help = 'Testing stats run'

def handle(self, *args, **options):
print "Running Stats"

# Can use a filter to narrow down - but don't really mind in this 
instance
# base_query = Comment.objects.filter(
#made_at__gte=date_from,
#made_at__lt=date_to
#)

# If I want to query per author per article (this works):
query = Comment.objects.values( "article__title",  
"author").annotate(comments=Count("pk"))

for row in query:
print "%s : %s : %s comments" % (row["article__title"], row["author"], 
row["comments"])


# if I want to query by day per article (this fails)
query = Comment.objects.values( "article__title",  
"made_at__year").annotate(comments=Count("pk"))

for row in query:
print "%s : %s : %s comments" % (row["article__title"], row["made_at"], 
row["comments"])

# django.core.exceptions.FieldError: Cannot resolve keyword 
'made_at__year' into field. Choices are: article, author, id, made_at, message



--
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: .Net Developer Job Opening - Valencia, CA

2011-04-04 Thread Casey Greene

Can we ban/filter this entire recruiting firm?  We already got this once:
http://groups.google.com/group/django-users/browse_thread/thread/c6abb660bc3d3de

This user is obviously spamming lots of inappropriate lists:
http://groups.google.com/groups/profile?enc_user=ERmrRBcAAAC95_Iec3-8bE73ZJ_XryWvHqZiDvCVswhrZ6TQxKj0ww

Casey

On 04/04/2011 10:03 AM, Makro Tech wrote:

Hi

This is Vignesh with Makro Technologies, Inc.

We have been in business for over 10 years and we are one of the Fast
500 National IT staffing and Solution firms in USA. Our clients include
country’s top-notch IT, Healthcare, Pharmaceutical, Financial,
Telecom,Government and other industries.

Staying current with technology, finding great consultants and exceeding
our clients' expectations are our primary objectives.

Thanks for your time and attention to this e-mail.  Please let me know
if you have any candidates available, please find the Job description as
mentioned below.

*Title : .Net Developer
Location : Valencia, CA
Duration :6 Months*

*Responsibilities:*
• Work closely with business representatives and other team members to
understand business requirements that drive the analysis, design and
development of quality technical solutions that align with business and
IT strategies and comply with corporate and regulatory standards
• Direct and participate in the full software development lifecycle
• Make recommendations towards the development of new systems or reuse
of existing systems
• Work on medium to large, varied and complex projects that require
skill in multiple technical environments and knowledge in various
business areas
• Work on multiple simultaneous projects as a project team member and/or
as a project lead
• Coach and/or mentor more junior technical staff
*
Required Skills*
• Bachelor degree in Computer Science or a related area
• 7+ years of programming/systems analysis experience
• Waterfall SDLC experience
• Ability to be a self-starter in a dynamic and fast paced environment
• Microsoft technologies, including .Net, C#, VB.Net, ASP.Net, XML,
HTML, JavaScript.
• Tools: Visual Studio .Net 2008, SQL Server 2000-2008, SVN
• Database technologies: Microsoft SQL, Oracle PL/SQL
• Reporting systems: Crystal Reports Server 2008
• Regulatory software validation experience a plus
Thanks
*Vignesh
*Sr Talent Acquisation
Tel: 973-481-0100  Ext: 3069
Fax: 973 883 1488
*E mail:* vignesh.renik...@makrohealth.com

*Linkedin: **http://www.linkedin.com/in/vignesh1*

For current openings please visit
http://jobs.makrotech.com/searchjobs.aspx

Candidate HelpDesk: 973-679-5005
*
Makro Technologies Inc.*
www.makrotech.com 
Corporate Headquarters: New Jersey
One Washington Park, Suite 1502, Newark, NJ 07102
*Other Offices:* Pennsylvania, Illinois, California
** Makro is a 3-time INC 5000 company for 2007/2008/2009
** Makro is a 3-time FAST 50 firm in NJ for 2005/2006/2007 (by Deloitte)
** Makro is a 3-time FAST 500 firm in USA for 2005/2006/2007 (by Deloitte)

--
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: jQuery namespace woes - calling third-party scripts

2011-04-05 Thread Casey Greene


Also -- you are much more likely to quickly get help for a jQuery issue 
with a list/forum related to jQuery such as the jQuery forum: 
http://forum.jquery.com/


Some of us use jQuery but if we're reading a django list we're probably 
not actively thinking about it.


Casey

On 04/05/2011 01:26 AM, mcniac wrote:

Hi!

are you calling that script from the window's onload event? if not
jquery might not be ready yet. also you should load that inside a IE
conditional comment

Cheers
Esteban

On Apr 4, 6:21 pm, Andre Terra  wrote:

Hello.

I'm trying to run the supersleight jQuery plugin 
(http://allinthehead.com/retro/338/supersleight-jquery-plugin) for fixing PNG
transparency in IE6 (this is a corporate intranet project, so I must support
it).

However, I'm having trouble calling the script because it's telling me
jQuery is undefined. Could somebody please paste me an example of how I
should setup my project's main script (and references to both that and the
third-party files) so that either jQuery or $ will work anywhere they're
used?

TLDR; I just to call this 'supersleight' plugin on document ready:

django.jQuery('body').supersleight();

I know, it's incredibly simple, but I can't get it to work.

I thank you in advance for the help.

Sincerely,
André Terra (airstrike)




--
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: Caught NoReverseMatch while rendering: Reverse for 'homepage_about' with arguments '()' and keyword arguments '{}' not found.

2011-04-06 Thread Casey Greene
- and _ are different characters.  The screenshot shows - while your 
posted error message and urls.py have _.


Casey

On 04/06/2011 09:29 AM, GOUTAM KUMAR RANA wrote:


--
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: Dajaxice and CSRF issues

2011-04-08 Thread Casey Greene
Can you change the request type from POST to GET?  It sounds like this 
is not a database modifying operation.


Casey

On 04/08/2011 07:06 AM, Sam Walters wrote:

Dajaxice

 is used on both the static and Django pages to check whether the user is logged
 in


--
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.