Re: embedding an HTML file.

2013-06-22 Thread Nigel Legg
Thanks Goran, that does exactly what I need. Regards, Nigel Legg 07914 740972 http://twitter.com/nigellegg http://uk.linkedin.com/in/nigellegg On 22 June 2013 15:42, Goran wrote: > Try to use "safe" filter in which case table will be interpreted as HTML > > {{ dftable|safe }} or as second sol

Re: embedding an HTML file.

2013-06-22 Thread Nigel Legg
That would be unnecessarily complicated and time consuming On 22 Jun 2013 21:30, "Javier Guerra Giraldez" wrote: > On Sat, Jun 22, 2013 at 9:42 AM, Goran wrote: > > Try to use "safe" filter in which case table will be interpreted as HTML > > or better, don't write html in Python. collect and or

Re: embedding an HTML file.

2013-06-22 Thread Nigel Legg
Thanks will try this. On 22 Jun 2013 15:42, "Goran" wrote: > Try to use "safe" filter in which case table will be interpreted as HTML > > {{ dftable|safe }} or as second solution, call dftable.allow_tags=True in > the view. > > On Saturday, June 22, 2013 9:35:01 AM UTC+2, Nigel Legg wrote: >> >>

Re: How to divide my apps? Good practices?

2013-06-22 Thread galgal
I've made a quick schema of couple of main tables. As you can see, there are many relations, so I think putting it all in one app. There will be a couple of additional models. There will be 1 more thing: a play systems. Some seasons can have simple table games but others - of example 2 rounds

Re: embedding an HTML file.

2013-06-22 Thread Javier Guerra Giraldez
On Sat, Jun 22, 2013 at 9:42 AM, Goran wrote: > Try to use "safe" filter in which case table will be interpreted as HTML or better, don't write html in Python. collect and organize the data in the view functions/classes, and express into html in the template. -- Javier -- You received this m

Re: Build SEO friendly url with {% url 'detail' object.id %} ?

2013-06-22 Thread thomaaaas
Found the answer: http://stackoverflow.com/questions/11879416/pretty-and-seo-friendly-urls-in-django On Saturday, June 22, 2013 8:10:07 PM UTC+2, thoms wrote: > > Hello, > > In my index.html, I have something like this that displays a list of > drawings, with links to the drawings: > >

Build SEO friendly url with {% url 'detail' object.id %} ?

2013-06-22 Thread thomaaaas
Hello, In my index.html, I have something like this that displays a list of drawings, with links to the drawings: {% for drawing in latest_drawings_list %} {{ drawing.title }} {% endfor %} When I look at the html generated, I see this type of url: which is not SEO friendly. I'

Re: Unique image name with timestamp?

2013-06-22 Thread der_fenix
For timestamp in int you should use time() from time package (not datetime.time). It return float number, but can be easy convert to int. > Hello, > > I'm new to Django, and I have a question. > I have a ImageField() in my model, and I obviously want that each image has > a unique name in my fil

Re: Count the number of drawings each artist has?

2013-06-22 Thread thomaaaas
Awesome, it works, thanks! On Saturday, June 22, 2013 4:52:34 PM UTC+2, Goran wrote: > > Just add related name to the artist field in the Drawinds model artist = > models.ForeignKey(Artist, related_name='drawings') > > Then you can use X.drawings.count() when is needed. It also works in the > t

Re: Count the number of drawings each artist has?

2013-06-22 Thread Goran
Just add related name to the artist field in the Drawinds model artist = models.ForeignKey(Artist, related_name='drawings') Then you can use X.drawings.count() when is needed. It also works in the template, Let say that you have list with some artists named 'foo' so in the template you can coun

Re: embedding an HTML file.

2013-06-22 Thread Goran
Try to use "safe" filter in which case table will be interpreted as HTML {{ dftable|safe }} or as second solution, call dftable.allow_tags=True in the view. On Saturday, June 22, 2013 9:35:01 AM UTC+2, Nigel Legg wrote: > > I want to allow users to upload a file and then view the data from it.

Count the number of drawings each artist has?

2013-06-22 Thread thomaaaas
Hello, In my model I have artists and drawings. Each drawing has a ForeignKey(Artist) I'm trying to count the number of drawings each artist has, but I don't know how to do it... Below a simplified version of my code. class Artist(models.Model): name = models.CharField(max_length=140) def numb

Re: Having an issue with Minimal File Upload utility

2013-06-22 Thread Matt Lind
Updating with full error: Request Method:GETRequest URL:http:///uploader/list/Django Version:1.3.7Exception Type:TemplateSyntaxErrorException Value: Caught ImportError while rendering: No module named urls Exception Location:/usr/lib/python2.6/site-packages/django/utils/importlib.py in import_

Deployment problem with google bots

2013-06-22 Thread frocco
Hello I get error messages from time to time because a google bot try's to view a product that no longer exists. How do I prevent this? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails f

Unique image name with timestamp?

2013-06-22 Thread thomaaaas
Hello, I'm new to Django, and I have a question. I have a ImageField() in my model, and I obviously want that each image has a unique name in my filesystem. How to do this? My idea was to include the timestamp in the name of the image (I'll never have more than one image uploaded per second). S

Repository files

2013-06-22 Thread paul kenyon
Hi all, I'm new to django so please excuse my lack of knowledge I'm still learning! :-) I recently hired a freelancer to create a django powered website for me from my html files that i had originally created, which he completed and I'm happy with. He has sent me all of the python files from h

Re: Doubt the split()

2013-06-22 Thread Michael
This is a Python specific question as opposed to a Django one, so I'd recommend that similar questions be asked elsewhere. Regarding your problem: the quickest way to do what you want is probably: s[s.index(':')+2:-2] That'll return the hex string. On Friday, 21 June 2013 11:29:02 UTC+1, Héli

Re: CachedStaticFilesStorage with database cache backend - static file not found (404)

2013-06-22 Thread Denis Cornehl
Hi Luke, 2013/6/21 luke lukes : > [snip] why do you think this is related to the database cache-backend? Have you tried another? > I've also launched manage.py collectstatic, but I get some errors in an app. > May be that the error? Two thoughts on this: - which errors occur on collectstatic? -

Re: File Path Question

2013-06-22 Thread Nigel Legg
MEDIA_ROOT = 'c:\\stats_portal\\myproject\\myproject\\media\\' doesn't work. I've parsed the path to get this working for the time being, thanks for your help. Regards, Nigel Legg 07914 740972 http://twitter.com/nigellegg http://uk.linkedin.com/in/nigellegg On 21 June 2013 19:09, Jacky Tian