Django 1.4 admin. Calendar widget appears for DateTimeField but not DateField

2012-08-16 Thread grimmus
I have checked for missing resources (jquery etc.) but all external assets are being loaded correctly. It's just that nothing appears beside the textbox for the DateField ! Anyone any ideas why this might be happening ? Thanks -- You received this message because you are subscribed to the Goo

Avoiding code repetition in views

2012-06-28 Thread grimmus
Hi, I am doing a site for a DJ that lists upcoming gigs on each page. There's an include file in each page template to output the list of gigs. I am wondering how i can pass the gig information to every page without having to repeat the code in every page view. I hope i have been clear Thanks

Re: Displaying events by month

2012-06-24 Thread grimmus
cs.djangoproject.com/en/1.4/ref/templates/builtins/#ifchanged): > > {% for event in events %} > {% ifchanged event.date.month event.date.year %} > month here > {% endifchanged %} > item here > {% endfor %} > > _Nik > > On 6/20/2012 2:22 PM, grimmus

Displaying events by month

2012-06-20 Thread grimmus
Hi, I am trying to output upcoming events in the following format *June 2012* 12th - Event 1 15th - Event 2 *July 2012* 1st - Event 3 *August 2012* 20th - Event 4 My model is very simple with just a title and dateTime field. I am unsure how i could output the months followed by the events in

Re: Year dropdown in Django admin

2012-02-20 Thread grimmus
Excellent, Thanks very much -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/VfjSLhXCkPcJ. To post to this group, send email to django-users@googlegroups.co

Year dropdown in Django admin

2012-02-20 Thread grimmus
Hi, I have a car model that contains many fields including a 'year' field. I need the dropdown for this field to display the current year as the first option and also display the previous 25 years as individual options. I was thinking i could create a list object and then populate the list bas

Re: Looking For A Solid Learning Tutorial

2011-04-14 Thread grimmus
I just found a site full of great tutorials - http://www.lightbird.net/dbe/index.html Learning lots of things and new techniques too ! On Apr 13, 5:49 pm, 小白 wrote: > Yes I think "Practical Django Projects" is very good for newbie, after > reading that i > start my own job using Django to setup

Determining profile completeness

2011-04-14 Thread grimmus
Hi, I am interested in extending the User object and implementing functionality that determines how complete the users profile is. So, if they have filled in 5 of 10 fields the profile is 50% complete. But, some fields are more important than others so i was thinking of weighting each field (a we

list out of range error

2010-09-20 Thread grimmus
Hi, On the homepage of my website i list 1 random ad in the right column. In my view i retrieve it like so: side_ad = SideAd.objects.filter(active=1).order_by("?")[0] If all ad's are inactive no object's will be returned thus creating an IndexError : list out of range I tried to wrap the above

Re: 'unicode' object has no attribute '_committed'

2010-08-10 Thread grimmus
I just found out Modeltranslation does not support ImageField :-( http://code.google.com/p/django-modeltranslation/issues/detail?id=30 On Aug 10, 10:01 pm, grimmus wrote: > I am doing it in the admin area, so i dont have any custom code. > > The issue might be with the Modeltranslati

Re: 'unicode' object has no attribute '_committed'

2010-08-10 Thread grimmus
I am doing it in the admin area, so i dont have any custom code. The issue might be with the Modeltranslation module. It creates extra columns for the different translations, so, for example, title has title, title_en, title_fr as rows in the DB. This applies to the image field too. Thanks for an

Re: 'unicode' object has no attribute '_committed'

2010-08-10 Thread grimmus
Thanks for the reply, below is my Project model from django.db import models class Project(models.Model): title = models.CharField(max_length=100) path = models.CharField(max_length=100,help_text='This should be the folder name') image = models.ImageField(upload_to='/images/projects/'

'unicode' object has no attribute '_committed'

2010-08-10 Thread grimmus
Hi, I am using Django 1.2.1 I have a model called Project that contains a char field and an image field. My project used Modeltranslation so i can have an English and French version of the 2 fields. When i try and add a project in the admin i get the error: 'unicode' object has no attribute '_

Calling some javascript for new visitors only

2010-07-07 Thread grimmus
Hi, I need to show a javascript lightbox popup for new visitors to my site. I presume using a cookie is the best way to achieve this. But how can i check whether the cookie exists in my template, so i can call some javascript code if it's a new visitor ? I hope i have been clear, Thanks -- Yo

Re: best translation solution for my project

2010-07-01 Thread grimmus
Thanks for the reply. I settled on django-modeltranslation, it's easy to install, well documented and fits into the admin area. Thanks again. On Jul 1, 3:46 pm, bruno desthuilliers wrote: > On 1 juil, 10:18, grimmus wrote: > > > > > Hi, > > > Sorry if this h

Re: Newby Question: template system doesn't render form html

2010-07-01 Thread grimmus
You dont seem to be closing your input tags, add > to the end of them On Jul 1, 4:47 am, Gene wrote: > When I put a form into my template it comes back blank. Does anyone > know why? > > what is in my template > > > >     >     > > > > what I get in my browser > > -- You received this mes

best translation solution for my project

2010-07-01 Thread grimmus
Hi, Sorry if this has been asked before, but i only seem to be finding bit's and pieces for what i am after. I have a simple website that needs to be available in English and French. I am using locale-url so all pages can have an independent url ( e.g. en/page and fr/page) There is a locale fol

ordering objects in the admin area

2010-06-08 Thread grimmus
Hi, I have a staff app that lists staff photos and their names. The client would like to be able to re-order these in the admin area easily. Ideally there would be a dropdown where the user could select between 1 and n which object should appear in what position in the list. I could add an extra

Session not working as i had hoped

2010-05-26 Thread grimmus
Hi, When the user enters a site for the first time they should see a flash version of the logo. All other times they should see a gif image. My home view looks like: if request.session.get('has_visited',True): visited = True else: visited = False t = loader.get_templa

Re: Deleted blog posts not disappearing

2010-03-30 Thread grimmus
Thanks for the replies. I am using generic date based views for the page, so i am passing other things through the extra_context : My code is here http://dpaste.com/hold/177740/ Thanks for any more info. On Mar 26, 4:06 pm, Karen Tracey wrote: > On Fri, Mar 26, 2010 at 9:32 AM, grimmus wr

Re: Deleted blog posts not disappearing

2010-03-26 Thread grimmus
{% for entry in diary %} {{entry.title}} {% endfor %} Thanks On Mar 26, 12:59 pm, Daniel Roseman wrote: > On Mar 26, 11:25 am, grimmus wrote: > > > > > Hi, > > > I have a website with 5 pages and a blog. > &g

Deleted blog posts not disappearing

2010-03-26 Thread grimmus
Hi, I have a website with 5 pages and a blog. At the bottom of every page is a list of recent blog posts. When i delete some blog posts they still appear in the recent posts list. I am not using any caching. If i restart the local dev server then they disappear. Could anyone tell me why this

Multiple querysets for dictionary

2010-03-25 Thread grimmus
Hi, For my xml sitemap i would like to show blog posts and pages from the CMS. How can i pass 2 querysets to the dictionary ? What i have so far is below, it's obviously wrong :-( info_dict = { 'queryset': Page.objects.filter(active=1), 'queryset': Entry.objects.filter(status=1), 'da

Re: Remove session on browser close

2010-03-22 Thread grimmus
Basically all i want to do is the following : Have a newsletter signup form. When the user signs up successfully the area where the form was has a thanks message instead of the form. The form or thanks message is displayed on every page of the site, so I thought using a session would be the best

Remove session on browser close

2010-03-22 Thread grimmus
Hi, I have a simple newsletter signup form. If the user submits the form and there are no errors then i set the session: request.session['signed_up'] = True Then, for all other page requests i check if the session exists if request.session.get('signed_up', True): for

Re: Form submission show 'thanks' message

2010-03-19 Thread grimmus
Excellent, thanks for the reply On Mar 19, 3:49 pm, Tom Evans wrote: > On Fri, Mar 19, 2010 at 2:08 PM, grimmus wrote: > > Hi, > > > When the form is submitted i would like to show a message above the > > form. Much like the way if there are form errors you can print

Form submission show 'thanks' message

2010-03-19 Thread grimmus
Hi, When the form is submitted i would like to show a message above the form. Much like the way if there are form errors you can print form.errors So, in my template i have entered {% if form.thanks %} thanks for submitting the form {%

Shared views

2010-03-14 Thread grimmus
Hi, I have a site with a blog area and 5 pages powered by a simple cms. On every page i show event information in the right column and social media info in the left column. I am wondering what view should contain the info for the left and right column ? I would like to keep it separate from the

Re: Django with Jquery

2010-03-01 Thread grimmus
link to the Google jQuery instead of a local file (it's really fast too) http://google.com/jsapi"; />