Re: Connecting to the django app from outside the server

2011-08-13 Thread Landy Chapman
>The application runs  when I remote into the server and run > the web pages with localhost on the 8000 port. > How do I connect to this web page for demonstration purposes when I am > not remoting into the virtual server. > > I tried just replacing localhost with the IP address with port 8000 >

Re: template newlines

2011-08-13 Thread Python_Junkie
I think that if you performed the logic to determine if there actually is something in the interest for that row in the view and then only pass those components from the view, and not in the template then your problem goes away. On Aug 13, 8:53 pm, CrabbyPete wrote: > I'm

Connecting to the django app from outside the server

2011-08-13 Thread Python_Junkie
I have placed my django application on the virtual server from go daddy. The application runs when I remote into the server and run the web pages with localhost on the 8000 port. How do I connect to this web page for demonstration purposes when I am not remoting into the virtual server. I

template newlines

2011-08-13 Thread CrabbyPete
I'm using the django template system for format a text email. I send it a dictionary and it formats the output. The problem is that it inserts lots of newlines Here is the template, and reports is a dictionary that contains an event and a dictionary of interests Weekly Contact List For {{date}}

Re: Ynt: Re: Could not parse the remainder: |slice

2011-08-13 Thread Chintan Tank
*can you paste the entire error stacktrace? use http://dpaste.de/ or equivalent to share it. * On Sat, Aug 13, 2011 at 8:01 PM, electrocoder wrote: > my syntax is *{% autoescape off %} {{ myobje.mypage|slice:":150" }} {% > endautoescape %}* > * > * > > -- > You received

Ynt: Re: Could not parse the remainder: |slice

2011-08-13 Thread electrocoder
my syntax is *{% autoescape off %} {{ myobje.mypage|slice:":150" }} {% endautoescape %}* * * -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit

Re: Could not parse the remainder: |slice

2011-08-13 Thread Chintan Tank
are you sure you used proper syntax? {{ sliceable|slice:":2" }} https://docs.djangoproject.com/en/dev/ref/templates/builtins/?from=olddocs#slice On Sat, Aug 13, 2011 at 7:28 PM, electrocoder wrote: > Blog on my local PC with "Could not parse the remainder: | Slice" I

Could not parse the remainder: |slice

2011-08-13 Thread electrocoder
Blog on my local PC with "Could not parse the remainder: | Slice" I get the error message. How can I fix. -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit

Re: question about template engine jinja

2011-08-13 Thread Reinout van Rees
On 13-08-11 14:41, Phang Mulianto wrote: and i read about jinja template, why it can be faster than django template engine ? Jinja basically uses django's syntax, but (if my memory is correct) it allows you to do more things than django's templates allows you to. Is it faster? I thought

Re: ManyRelatedManager.add() acting funny?

2011-08-13 Thread Jeff Blaine
Nevermind. I get it. 'tags' has another field, description, which is what the extra u'' is for. -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit

ManyRelatedManager.add() acting funny?

2011-08-13 Thread Jeff Blaine
What happened here? Do I not understand .add()? I would have expected to see [(u'rcf_clients',)] not [(u'rcf_clients', u'')] >>> print d.tags.values_list() [] >>> d.tags.add('rcf_clients') >>> d.save() >>> print d.tags.values_list() [(u'rcf_clients', u'')] >>> -- You received this message

inherit adminSite and get 404 when click model

2011-08-13 Thread brian
I have multiple models. I'm trying to create an admin site for all models (using admin.site) and an admin site for each model (by inheriting from AdminSite). The admin.site is working as expected. The AdminSite will load the app as normal but when I click on the model, I get a 404 error. I'm

Re: How do I apply a filter in a custom template tag?

2011-08-13 Thread Doug Ballance
I'd like to see you model structure, but based on what I think it is: class Entry(model.Model): categories=models.ManyToManyField(Category) class Content(models.Model): entry=models.ForeignKey(Entry) You have a Content Instance You want to see other entries belonging to one or more of

Re: same form model with separate admins and data

2011-08-13 Thread brian
Hi Landy, I'm seeing separate database tables created. The tables that are created are _. I've tested in the latest Django, python 2.7 and on windows with a sqlite3 database. Thank you for your help You have given me a lot of great ideas. Brian -- You received this message because you

Re: Redisplay form with different field value?

2011-08-13 Thread Jonas H.
On 08/13/2011 05:00 PM, Karen Tracey wrote: Plus, afaik, fields can not access form instances so this code would have to live in the form subclass -- not practical in my use case. Where I have done this (reluctantly) has been in the form (or perhaps it was the field) clean method, where self

Re: Using South HOWTO create an instance of a model from a different app during DataMigration

2011-08-13 Thread Chintan Tank
*UPDATE:* * * I was able to resolve the problem by looking up the contenttype manually so, ct = orm['contenttypes.ContentType'].*objects.*get(app_label="blog", model="Post") Thanks Tom & Andrew (at south user listserv) for helping with this. On Sat, Aug 13, 2011 at 1:14 PM, Chintan Tank

Re: Using South HOWTO create an instance of a model from a different app during DataMigration

2011-08-13 Thread Chintan Tank
Tom, I tried looking up the content_type and then using it, but it still throws errors. *1. I tried* ct = ContentType.objects.get_for_model(Post) chapter = orm.Chapter(rank=1, content_type=ct, object_id=blog.id) *It gave error,* ValueError: Cannot assign "": "Chapter.content_type" must be a

How do I apply a filter in a custom template tag?

2011-08-13 Thread Josh
I'm trying to retrieve a m2m relation from a blog entry. It should give a list of entries with the same categories. Below works when I work in the shell. from content.models import Entry qs = Entry.objects.all() obj = qs[0] related = Entry.objects.filter(categories=obj.categories.all()) The

Re: Displaying form from app in other view.

2011-08-13 Thread Karen Tracey
On Sat, Aug 13, 2011 at 8:18 AM, Petey wrote: > I have a login/logout application - it works within its defined view > (login/views.py) and templates (templates/login/index.html). > > I want to port this app so it will be displayed in base.html. The main > problem is that I

Re: Redisplay form with different field value?

2011-08-13 Thread Karen Tracey
On Sat, Aug 13, 2011 at 4:41 AM, Jonas H. wrote: > On 08/13/2011 06:33 AM, Karen Tracey wrote: > >> On Thu, Aug 11, 2011 at 7:03 AM, Jonas H. wrote: >> >> On 08/09/2011 12:45 AM, Jonas H. wrote: >>> >>> Hello list! Is there any way to use a

Re: Showing per-user information in admin

2011-08-13 Thread Isaac XxX
Thanks a lot derek! It's just all I was looking for :) On Fri, Aug 12, 2011 at 4:03 PM, Derek wrote: > On Aug 12, 1:29 pm, Isaac wrote: > > Hi dudes, > > > > I'm having trouble at finding a solution for my problem. All I want to > > do is tune django

question about template engine jinja

2011-08-13 Thread Phang Mulianto
Hi all, i need sugestion about templating. if i use many include in django template, is it a good practice and effect the load performance of the application ? and i read about jinja template, why it can be faster than django template engine ? how many of you prefer jinja, and why ? thanks

Displaying form from app in other view.

2011-08-13 Thread Petey
I have a login/logout application - it works within its defined view (login/views.py) and templates (templates/login/index.html). I want to port this app so it will be displayed in base.html. The main problem is that I don't really know how to import this app correctly to base.html. If I use

Re: Redisplay form with different field value?

2011-08-13 Thread Jonas H.
On 08/13/2011 06:33 AM, Karen Tracey wrote: On Thu, Aug 11, 2011 at 7:03 AM, Jonas H. wrote: On 08/09/2011 12:45 AM, Jonas H. wrote: Hello list! Is there any way to use a different value for a field when re-displaying a form? I.e. if a user enters '42' into an