Newbie django/python with C++ background wants enums

2012-02-01 Thread NENAD CIKIC
Hello, the subject expresses my discomfort with certain python characteristics, given my background, and my lack of python knowledge. Specifically lets say that I have a model with a Text field and char field. The char field is length 1 and says "use or do not use the text field". The char field

Re: Newbie django/python with C++ background wants enums

2012-02-02 Thread NENAD CIKIC
thanks, to all. I have now some code to study and understand. Nenad -- 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/-/WZCA-XCSg_IJ. To post to this group, sen

problem installing PIL

2012-02-02 Thread NENAD CIKIC
I came across this problem (the problem is that i can not install PIL on my windows 7 64 bit machine) when I have tried to use ImageField. I have first tried to use C++ Express but I came across http://bugs.python.org/issue7511. Then I have tried to use mingw and cygwin but the gcc complied abo

Re: problem installing PIL

2012-02-03 Thread NENAD CIKIC
Thanks, I have downloaded the instalation and I have managed to include the Imagefield in the model. Now will try it:) -- 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/dja

Filter admin inlines

2012-02-05 Thread NENAD CIKIC
Hello, I have three models X Lang Y where the purpose of Y is to provide X fields in other languages. So I have Y as Y x foreignkey on X lang ForeignKey on Lang additionalfields... I have created the ModelAdmin for Lang. For X I have the ModelAdmin and added the inlines = [ YInline,

Re: Filter admin inlines

2012-02-05 Thread NENAD CIKIC
Thanks. So to summarize the solution to filter inlines in admin interface based on userprofile was: define the form on Y model as: class YForm(forms.ModelForm): request=None #NOTE THIS lang=forms.ModelChoiceField(queryset=lang.objects.all()) #first get all def __init__(self, data=N

newbie django hosting question

2012-03-12 Thread NENAD CIKIC
I now need to put on web the small project i have developed. To test and to skill me on linux, I have created virtualbox ubuntu VM and deployed the project and used nginx to serve it (all from scratch). May someone provide me clarification on the following: - what is the difference between "django

Re: newbie django hosting question

2012-03-13 Thread NENAD CIKIC
y (they do detect and kill such back ends > reasonably promptly).  The benefit is that you don't have to do os > management, but you are also more restricted than you would be in a > VPS. > > Bill > > On 3/13/12, NENAD CIKIC wrote: > > > > > > >

Re: newbie django hosting question

2012-03-14 Thread NENAD CIKIC
downs if one of  your machine mates starts taking more than his > allotment of time or memory (they do detect and kill such back ends > reasonably promptly).  The benefit is that you don't have to do os > management, but you are also more restricted than you would be in a > VPS. &g

Creating pdf files

2012-03-25 Thread NENAD CIKIC
Hello! I am novice django user, and now i want to create pdf documents. Following the official docs at https://docs.djangoproject.com/en/dev/howto/outputting-pdf/ it seems the reportlab is suggested to be used. The problem is that the installer does not work for python 2.7.2, for windows. I have s

Re: Creating pdf files

2012-03-25 Thread NENAD CIKIC
Thanks, the install worked. On 26 ožu, 02:37, Matthias Mintert wrote: > This should help with reportlab issues on > windows:http://www.lfd.uci.edu/~gohlke/pythonlibs/#reportlab -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this g

Re: Creating pdf files

2012-03-25 Thread NENAD CIKIC
, NENAD CIKIC wrote: > Thanks, the install worked. > > On 26 ožu, 02:37, Matthias Mintert wrote: > > > > > > > > > This should help with reportlab issues on > > windows:http://www.lfd.uci.edu/~gohlke/pythonlibs/#reportlab -- You received this message becau

Re: Hosting tutorials

2012-03-28 Thread NENAD CIKIC
Hi, i am also new to django. I have put alive my first django project on linode VPS. First I have created on my development machine the virtual box with last ubuntu. Then I have put alive the django project following instruction on https://code.djangoproject.com/wiki/DjangoAndNginx i.e. I have used

django ORM basic question

2012-04-08 Thread NENAD CIKIC
Hello! I have two tables. The second one is the extention of the first so i used OneToOneField Both tables have the automatic constructed pk. When I am adding the row from the first table I automatically add the corresponding row to the second table. Basically I have put in first table FirstTable

Re: django ORM basic question

2012-04-08 Thread NENAD CIKIC
OK, I got it myself. Django ORM is using postgre sequences and if i manually change some data i should run manage.py sqlsequenreset and execute the needed sql statement from there. Bye Nenad -- You received this message because you are subscribed to the Google Groups "Django users" group. To po

basci question about queryset for retrieving top element

2012-04-14 Thread NENAD CIKIC
Hello! I want to get just the top element of one queryset. SO I have something as qs=MyModel.objects.filter(...).order_by(..) and then use qs[0] and check some value I wonder now if i did the right thing or it is better to use .extra on queryset. Is the queryset object allocated for all objects,

Re: basci question about queryset for retrieving top element

2012-04-16 Thread NENAD CIKIC
which will display > every query made in real time. > > thanks, > -pavan > > On Apr 14, 9:56 pm, NENAD CIKIC wrote: > > > > > > > > > Hello! > > I want to get just the top element of one queryset. SO I have > > something as > > qs=

Re: basci question about queryset for retrieving top element

2012-04-17 Thread NENAD CIKIC
OK, thanks Always learning. What I miss from my other programming is MSDN like style of help pages. I tend more and more to use the django pdf documentation because I can't get used to the web interface for this. On 17 Apr, 07:42, HarpB wrote: > Both patterns will produce same query. You can al

Re: basci question about queryset for retrieving top element

2012-04-17 Thread NENAD CIKIC
Thanks, I will check On 18 Apr, 04:34, HarpB wrote: > Like > thishttp://readthedocs.org/docs/django/en/latest/py-modindex.html?highlig... > or perhaps thishttp://djangoapi.quamquam.org/trunk/? > > There is also a great book:http://www.djangobook.com/en/2.0/ -- You received this message because

serving client uploaded files

2012-05-01 Thread Nenad Cikic
Hello, how can i serve the file uploaded files (images)? What I mean I have few model with images, and I see images in the change form. The problem is that I can see the same images by writing directly the media path in the web address. And since the model is designed to have data split between

Re: serving client uploaded files

2012-05-01 Thread Nenad Cikic
OK, thanks -- 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/-/SCat4Yqd-gkJ. To post to this group, send email to django-users@googlegroups.com. To unsubscribe

Re: serving client uploaded files

2012-05-01 Thread Nenad Cikic
This looks interesting, thanks Il giorno martedì 1 maggio 2012 17:37:33 UTC+2, Tino de Bruijn ha scritto: > > You probably want to implement this with X-Sendfile (or X-Accel-Redirect > for Nginx) headers. Those tell the frontend server to serve a specific file. > > This explains it a bit. > http

limit row in change view

2012-05-08 Thread Nenad Cikic
Hello! I am trying to undestand how to limit visible rows in change view. It seems to me a common need, but can not find info in django docs. I am using the admin interface. So I have one model and his admin is something as: ordering = ('-datum','krajnjikorisnik','tipimpulse','impulsecijena')

Re: limit row in change view

2012-05-09 Thread Nenad Cikic
I have managed to solve it by myself so reporting here if anyone is interested. I have checked and the sql Log shows statements are generated with LIMIT clause (postgre). You have to subclass the ChangeList class ass class MyChangeList(ChangeList): def get_query_set(self): return supe

setting debug to false

2012-06-08 Thread Nenad Cikic
Hello, is there any known reason why I can not see my static files when setting debug to false in the settings.py? Just setting debug to True all is OK. Thanks Nenad -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on th

Re: setting debug to false

2012-06-08 Thread Nenad Cikic
Yes, I know about that, but I just wanted to test with runserver and debug=False (I have done my 404.html and with debug=True it does not shows up) Isn't the collectstatic command when you want to pass to deployment server? Thanks Nenad -- You received this message because you are subscribed to

Re: setting debug to false

2012-06-08 Thread Nenad Cikic
I have managed to solve using the http://stackoverflow.com/questions/6363728/why-cant-i-get-my-static-dir-to-work-with-django-1-3 by adding to url url(r'^static/(?P.*)$', 'django.views.static.serve', {'document_root': settings.STATIC_ROOT } ), where I have first collected to STATIC_ROOT with col

Template inheritance

2013-03-09 Thread Nenad Cikic
Hello, I am using django admin for my project so I am not writing much templates by myself, therefore I am not very skilled with them, so excuse me if I ask dumb question. I have extended base_site.html to add browser refresh in block extrahead. I do not want however to do refresh while I am inse

Re: Template inheritance

2013-03-09 Thread Nenad Cikic
Thanks, yes, this is what I did. I just wanted to know if there is a better way. In the case I add something more to base_site extrahead I would be in trouble. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and

Re: Template inheritance

2013-03-09 Thread Nenad Cikic
Many thanks I new it should exist better way. Nenad -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this gr