Re: Avoiding code repetition in views

2012-06-28 Thread kenneth gonsalves
On Fri, 2012-06-29 at 01:07 +0200, Christophe Pettus wrote: > > I hope i have been clear > > I'm going to take a guess and surmise that you have a lot of different > view functions, each one of which needs to pass a list of gigs into > the context for the template and then render that page, and yo

how to manage range of hours in models and forms in django1.4

2012-06-28 Thread Nikhil Verma
Hi I am developing an event app which has users who publish events , other users also. Now users have their profile info for which i have made a very common UserProfile Model with all the necessary details in it. I have a requirement where in UserProfile model i need to display a field institue_h

Re: Avoiding code repetition in views

2012-06-28 Thread Ryan Nowakowski
Or a custom template context processor that adds gigs to every request context. On Thu, Jun 28, 2012 at 10:40:30PM -0400, J. Cliff Dyer wrote: > It looks like what you want to do is create a templatetag. Then you can > just include a snippet like: {% gig_schedule %} in your template. The > docum

Re: django 1.4 + grappelli 2.4: missing css, img files.

2012-06-28 Thread bruce
Thank!! It works! I checked the grappelli's admin base file: /usr/local/lib/python2.6/dist-packages/grappelli/templates/admin/base.html It shows that the grappelli is using {% admin_media_prefix %}. The DeprecationWarning message made me confused. Thanks!! On Thursday, June 28, 2012 3:04

Re: Avoiding code repetition in views

2012-06-28 Thread J. Cliff Dyer
It looks like what you want to do is create a templatetag. Then you can just include a snippet like: {% gig_schedule %} in your template. The documentation can point you in the right direction. On Thu, 2012-06-28 at 15:20 -0700, grimmus wrote: > Hi, > > > I am doing a site for a DJ that lists

Re: Avoiding code repetition in views

2012-06-28 Thread David Lam
On Jun 28, 2012, at 3:20 PM, grimmus wrote: > 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 th

Re: Avoiding code repetition in views

2012-06-28 Thread Christophe Pettus
On Jun 29, 2012, at 12:20 AM, grimmus wrote: > 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 i

Re: locating the functionality behind the HTML element

2012-06-28 Thread Smaran Harihar
Hey Clifford, Thanks, this is what I am looking for, where can I locate this django-debug-toolbar? Do i need to add it like it is stated in the git hub? or is there a UI which i can use? Thanks, Smaran On Thu, Jun 28, 2012 at 2:38 PM, CLIFFORD ILKAY wrote: > On 06/27/2012 08:55 PM, Smaran Harih

Re: Avoiding code repetition in views

2012-06-28 Thread Aaron C. de Bruyn
On Thu, Jun 28, 2012 at 3:20 PM, grimmus wrote: > 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 Not really. We can't guess what you're doing. :) Paste a sample of the code you're referring to

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: locating the functionality behind the HTML element

2012-06-28 Thread CLIFFORD ILKAY
On 06/27/2012 08:55 PM, Smaran Harihar wrote: Hi Guys, I am new to Django and have completed the initial basic tutorials in the django doc. I am presently working on a pre-customized django application. I was wondering how I can use FireBug to locate the code in a specific element (like butto

Re: locating the functionality behind the HTML element

2012-06-28 Thread Smaran Harihar
Thanks Jon On Thu, Jun 28, 2012 at 12:41 AM, Jon Black wrote: > If I understand you correctly, you want to find the django code > responsible for rendering the view. Rather than look at the html, the most > obvious place is to look at the url. There should be an entry in one of > your urls.py f

Re: WebService WSDL

2012-06-28 Thread Anurag Chourasia
Try using gSOAP if that fits your needs. http://www.cs.fsu.edu/~engelen/soap.html Regards, Guddu On Thu, Jun 28, 2012 at 2:47 PM, Rene wrote: > Pessoal, > > Preciso montar um webservice que gere um wsdl, mas não achei algo que > fosse mais direto na web, alguém tem um caminho para indicar. > >

WebService WSDL

2012-06-28 Thread Rene
Pessoal, Preciso montar um webservice que gere um wsdl, mas não achei algo que fosse mais direto na web, alguém tem um caminho para indicar. Abraço -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit htt

Re: 'CSRF verification failed." from django.contrib.comments. can you help solve it? django 1.3

2012-06-28 Thread Ian Clelland
On Thu, Jun 28, 2012 at 9:14 AM, brycenesbitt wrote: > I'm using django.contrib.comments and get 'CSRF token missing or > incorrect.' when previewing or submitting a comment. I have: ... The HTML looks like it has the csrf security_hash in the proper place: > > /> > > > ... The "secu

Re: 'CSRF verification failed." from django.contrib.comments. can you help solve it? django 1.3

2012-06-28 Thread Jonas Geiregat
On do, jun 28, 2012 at 09:14:36 -0700, brycenesbitt wrote: > http://127.0.0.1:8000/comments/post/>" method="post"> >/> >id="id_timestamp" /> >value="6e85e1c846861c80575ce435b21a855706725b00" id="id_security_hash" > /> After the starting form tag add {% csrf_token %} More

Re: replace or regex

2012-06-28 Thread Tim Chase
On 06/28/12 01:42, pakyazilim wrote: > i have text ; > ** >A > > B > > > ** > * > * > *i want to remove first end for text end tag. * > *how can i it?* Depends on what you want to happen in various odd edge-cases: - what happens if other tags surround the outside bl

'CSRF verification failed." from django.contrib.comments. can you help solve it? django 1.3

2012-06-28 Thread brycenesbitt
I'm using django.contrib.comments and get 'CSRF token missing or incorrect.' when previewing or submitting a comment. I have: *MIDDLEWARE_CLASSES = (* *'django.middleware.csrf.CsrfViewMiddleware',* *'django.middleware.common.CommonMiddleware',* *'django.contrib.sessions.middleware.Se

Re: have an object available in every templates

2012-06-28 Thread Bastian
Well, I was curious to see if it worked with a context processor so I tried and indeed it works. After all it's only returning an object or list of objects in a dictionary. Now I don't know which method is the most efficient. On Thursday, June 28, 2012 2:11:37 PM UTC+2, Bastian wrote: > > Hi, >

Re: have an object available in every templates

2012-06-28 Thread Bastian
Well, I was curious to see if it worked with a context processor so I tried and indeed it works. After all it's only returning an object or list of objects in a dictionary. Now I don't which method is the more efficient. On Thursday, June 28, 2012 2:11:37 PM UTC+2, Bastian wrote: > > Hi, > > I d

Re: django 1.4 + grappelli 2.4: missing css, img files.

2012-06-28 Thread bruce
Thanks Karl for your reply. It would appear that ADMIN_MEDIA_PREFIX is Deprecated in django 1.4 root@lablinux:~/django/mysite# python manage.py runserver 0.0.0.0:8000 /usr/local/lib/python2.6/dist-packages/django/conf/__init__.py:75: DeprecationWarning: The ADMIN_MEDIA_PREFIX setting has been r

settings and constants on a reusable app

2012-06-28 Thread Marc Aymerich
Hi, I'm developing a reusable application and I'm having troubles with constant values on settings. Imagine that the reusable application comes with the following settings.py # MY_APP/settings.py from django.conf import settings MY_CONSTANT = 'C1' MY_OTHER_CONSTANT = 'C2' MY_SETTING = getattr(se

Re: replace or regex

2012-06-28 Thread Kurtis Mullins
You could use regular expressions to parse the string, break it up into chunks and simply remove the first and last chunk (or whatever you're looking for) Also, you could use a DOM Parser to parse this tree and remove the outer-most . Just make sure you don't remove the entire DOM Tree within the U

Testing with LiveServerTestCase and Selenium

2012-06-28 Thread Paul Childs
Hello, I'm using Django 1.4 and was really excited to learn about the new testing features. I am totally new to this. I seem to have hit a bump in the road. If I overcome this I'm hopeful it will be smooth sailing and I will experience some great testing goodness. I've been mucking around with th

Re: many "Broken INTERNAL link" with end string "/undefined/"

2012-06-28 Thread ferran
Hello Melvyn, Ohhh in the javascript!. you're good I view my libraries and update it's necessary (Jquery, etc.). see you with the response of the re-code javascript Thanks On Thursday, June 28, 2012 2:59:12 PM UTC+2, Melvyn Sopacua wrote: > > On 27-6-2012 18:37, ferran wrote: > > > In th

Re: have an object available in every templates

2012-06-28 Thread Daniel Roseman
On Thursday, 28 June 2012 13:11:37 UTC+1, Bastian wrote: > > Hi, > > I don't know if this is possible or how to do it. I would like to write a > sort of context processor where I pass an object to the template. I have > always passed strings to these variables. Let's say I have a Book model and

Re: have an object available in every templates

2012-06-28 Thread Karl Sutt
I think you can do it with Middleware. https://docs.djangoproject.com/en/1.4/topics/http/middleware/#writing-your-own-middleware Specifically, I think it's worth looking into the "process_template_response" method. Tervitades/Regards Karl Sutt On Thu, Jun 28, 2012 at 3:11 PM, Bastian wrote: >

Re: many "Broken INTERNAL link" with end string "/undefined/"

2012-06-28 Thread ferran
Hello Russ, In the view code of this pages I don't found de keyword "undefined" Thanks in advanced On Thursday, June 28, 2012 1:38:22 AM UTC+2, Russell Keith-Magee wrote: > > On Thu, Jun 28, 2012 at 12:37 AM, ferran wrote: > > Hello django users, > > > > In the last 3 weeks I'm receiving in

Re: many "Broken INTERNAL link" with end string "/undefined/"

2012-06-28 Thread Melvyn Sopacua
On 27-6-2012 18:37, ferran wrote: > In the last 3 weeks I'm receiving in my email a many "Broken INTERNAL link" > how this: > > " > Referrer: http://www.marquezshop.com/es/catalogo/sales/ > Requested URL: /es/catalogo/sales/undefined/ ^ That's javascri

have an object available in every templates

2012-06-28 Thread Bastian
Hi, I don't know if this is possible or how to do it. I would like to write a sort of context processor where I pass an object to the template. I have always passed strings to these variables. Let's say I have a Book model and in a view I list the latest books I've added to the database. In the

Translation hooks in custom template tag

2012-06-28 Thread Владислав Митов
Hello, I can't make this feature > *{% some_special_tag _("Page not found") value|yesno:_("yes,no") %} * to work with this custom template tag - http://djangosnippets.org/snippets/1289/ with django 1.4. The result from {% breadcrumb _("Create") %} is _("Create") in the HTML. What could be t

Re: locating the functionality behind the HTML element

2012-06-28 Thread Jon Black
If I understand you correctly, you want to find the django code responsible for rendering the view. Rather than look at the html, the most obvious place is to look at the url. There should be an entry in one of your urls.py files, which will tell you which view is being used. You can then trace tha

Re: replace or regex

2012-06-28 Thread Abdulkerim KELEŞ
first is s='** A B **' s.replace('' ,' ', 1 ) but i dont remove last tag. 2012/6/28 pakyazilim > i have text ; > ** >A > > B > > > ** > * > * > *i want to remove first end for text end tag. * > *how can i it?* > *thanks you...* > > -- >

Re: interpretting urls

2012-06-28 Thread kenneth gonsalves
On Thu, 2012-06-28 at 03:25 -0700, bruno desthuilliers wrote: > ROOT_URLCONF > > setting. > > > > > > > It's also in the FineManual. If you look at the doc's home page, > you'll > find a very explicit reference to middl

Re: interpretting urls

2012-06-28 Thread bruno desthuilliers
On Wednesday, June 27, 2012 11:53:56 PM UTC+2, Sam007 wrote: > > > Going thru the doc link you gave, I did not understand the term middleware > request processing? > > but if the incoming HttpRequest object has an attribute called urlconf (set > by middleware *request > processing*

SimpleListFilter filter UserProfile

2012-06-28 Thread yillkid
Hi all ! I want filter a field of UserProfile (field name: timestamp), models.py: http://dpaste.com/764723/ admin.py: http://dpaste.com/764724/ But when I press the filter, browser show: http://dpaste.com/764725/ --- --- --- --- --- --- --- --- --- --- According the error message, I can

Re: interpretting urls

2012-06-28 Thread Jani Tiainen
Hi, Quote from URL dispatcher documentation: "To design URLs for an app, you create a Python module informally called a URLconf (URL configuration). This module is pure Python code and is a simple mapping between URL patterns (as simple regular expressions) to Python callback functions (your v

Re: django 1.4 + grappelli 2.4: missing css, img files.

2012-06-28 Thread Karl Sutt
Ali, Given that your static directory is STATIC_URL = '/static/' and STATIC_ROOT is something like os.path.join(PROJECT_PATH, "static"), add > ADMIN_MEDIA_PREFIX = '/static/grappelli/' (or whatever your static > directory is) to your settings.py That should do the trick. Tervitades/Regards Kar