Re: Having some problems with admin css and such

2011-01-23 Thread Wes Wagner
Figured it out...

STATICFILES_DIRS = ( STATIC_ROOT,)

Had to add my static root directory to the static files dir...

Am I doing something kludgy or is the current documentation revision
in the SVN wrong?

-Wes


On Jan 23, 10:32 am, Wes Wagner <wes.wag...@gmail.com> wrote:
> I just started building a new app in 1.3 and I am having some static
> files problems (I read the new documentation)
>
> I am using pycharm as an IDE.
>
> If I run a collectstatic it will actually dump all the admin static
> files into my /static directory under my project but I can't get it so
> serve any of them under runserver. (not found)
>
> Thus admin runs without any css or graphics
>
> Settings:
> MEDIA_ROOT = ''
> MEDIA_URL = ''
> STATIC_ROOT = "C:/Users/Wes Wagner/PycharmProjects/APP/static/"
> STATIC_URL = '/static/'
> ADMIN_MEDIA_PREFIX = '/static/admin/'
>
> in URLS I added:
> from django.contrib.staticfiles.urls import staticfiles_urlpatterns
> and to the end of my file:
> urlpatterns += staticfiles_urlpatterns()
>
> If I just hit the base directory my urls list looks like this:
> Using the URLconf defined in APP.urls, Django tried these URL
> patterns, in this order:
>     ^admin/
>     ^static\/
>
> The backslash prior to the / creeps me out a little... this is a
> windows 7 x64, python 2.6 using the tarball of 1.3 from today.
>
> So what noobish mistake did I make this time? 8)
>
> -Wes Wagner

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



Having some problems with admin css and such

2011-01-23 Thread Wes Wagner
I just started building a new app in 1.3 and I am having some static
files problems (I read the new documentation)

I am using pycharm as an IDE.

If I run a collectstatic it will actually dump all the admin static
files into my /static directory under my project but I can't get it so
serve any of them under runserver. (not found)

Thus admin runs without any css or graphics

Settings:
MEDIA_ROOT = ''
MEDIA_URL = ''
STATIC_ROOT = "C:/Users/Wes Wagner/PycharmProjects/APP/static/"
STATIC_URL = '/static/'
ADMIN_MEDIA_PREFIX = '/static/admin/'

in URLS I added:
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
and to the end of my file:
urlpatterns += staticfiles_urlpatterns()


If I just hit the base directory my urls list looks like this:
Using the URLconf defined in APP.urls, Django tried these URL
patterns, in this order:
^admin/
^static\/

The backslash prior to the / creeps me out a little... this is a
windows 7 x64, python 2.6 using the tarball of 1.3 from today.

So what noobish mistake did I make this time? 8)

-Wes Wagner

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



General question about NOT EXISTS...

2010-12-06 Thread Wes Wagner
This is a generic question because I am a newbie and things are not
gelling quite 100% on how to write Q statements to get a filter to do
everything one wants.

Let's say you have Table A and Table B and Table C, where Table B has
a foreign key to table A and Table C (a manually constructed many to
many because it has extra data elements)

Now I want to build a list of all elements from table A, where not
exists a record in Table B that is related to table A and also has a
couple values = to something, and related to a particular table C
record)

In SQL this would look like:

select * from a where not exists (select * from B,C where
a.id=b.aforeignkey and c.id=b.cforeignkey and b.filter1=blah and
c.filter2=blah)

How does that look when you are building an object list in the Q( )...
style format? Where I am hung up is finding syntax examples of how to
do the functional equivalent of a sql where not exists clause.

Is there a way to do this without using .extra() and using just normal
django?

-Wes Wagner

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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 make base.html a little more useful?

2010-10-31 Thread Wes Wagner
That switched the lightbulb on above my head. Thanks!

-Wes


On Oct 31, 8:16 am, Shawn Milochik  wrote:
> Context processors, or a custom template tag, as described in James Bennett's 
> book, "Practical Django Projects."

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



How to make base.html a little more useful?

2010-10-31 Thread Wes Wagner
I am somewhat new to Django, but I have been able to figure out the
form, model, view, session flow etc fairly well. I am going to ask
this question in an abstract sense, because I really think a simple
abstract answer is enough to get my mind in the right place.

I have a base.html that has a header, left nav bar, main content area,
footer, etc. Of course some views override these sections to
drastically alter their content, etc (the main content being the most
common of course).

One thing that I would like to do is put some more useful nav links in
the left sidebar for users who are authenticated. Such as a list of
their friends who are also online (even if the data is pulled from
third party) or a list of projects they are currently working on so it
has hyperlinks to take them directly to those project editing pages.

What I am mentally missing is how to get that data fed into base.html
with every view call. Each time the left nav in base.html would be
rendered it would need to draw data from a couple different apps I
have installed on the site.

Can someone point me in the right direction?

-Wes Wagner

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