Re: help for creating relationship between User model an another model !!

2016-11-23 Thread adonis simo
uot;/home/adonis97/Documents/codages/mysite/lib/python3.5/site-packages/django/db/models/fields/__init__.py" , line 946, in get_prep_value return int(value) TypeError: int() argument must be a string, a bytes-like object or a number, not 'datetime.datetime' Le mardi 22 novembre 2016 0

help for creating relationship between User model an another model !!

2016-11-21 Thread adonis simo
Hi django users, I am new to django and i am using django 1.10, i follow up all the tutorial in the documentation and now i have build an blog application with models like : Article , Commentaire(comment in english) and Tag. It's working but now i want to add an relation between User (the one

F() expression not compatible with __range field look up

2014-03-18 Thread Adonis Liu
*platform:* Django-1.5, python2.7 *code:* class TestModel(models.Model): a = models.SmallIntegerField() b = models.SmallIntegerField() TestModel.objects.filter(a__range=(F('b')-1, F('b')+1) *result:* django.db.models.fields in get_prep_value TypeError: int() argument must be a string or

Re: django formwizard NoFileStorageConfigured

2013-10-04 Thread Adonis Nafeh
I ran into the same error. Using files in formwizard requires configuring File Storage, according to docs https://docs.djangoproject.com/en/dev/ref/contrib/formtools/form-wizard/#handling-files initializing file_storage fixed it for me. from django.core.files.storage import FileSystemStorage

Re: add permission to new model instances

2010-04-23 Thread Adonis
FYI, I have been looking to django authority as well http://packages.python.org/django-authority/index.html Which apparently supports per-object-permissions (row-level). I just can't get it to work yet... Regards, On Apr 22, 6:04 pm, Shawn Milochik wrote: > What you're

Re: add permission to new model instances

2010-04-22 Thread Adonis
Thank you for your answer Shawn. I have been reading through Signal documentation and related examples...It is quite useful and it helps keep your code tidy. My problem continues because i cannot find a way to use a signal to add a permission to the meta class of the Layer model every time a user

add permission to new model instances

2010-04-21 Thread Adonis
hi, I think that what i am trying to do is NOT doable with django existing authentication or authority tools. Before developing my own code i thought of sharing it with the django community. I have a model called 'Layers'. I want a new permission to be created for each new entry in that table.

many permission sets for same user

2009-12-10 Thread Adonis
Hi, I am trying to figure out the best way to do this. I have built a django application where users are members in projects. Thus, i need to assign users different permission sets that correspond to different projects. The django core permission system cannot solve this by itself. I took a look

Re: add permission by name instead of number

2009-12-04 Thread Adonis
u could alternatively do a lookup with the "codename='some_name'" > instead of the human-readable name.  The codename is arguably less > prone to change than the straight "name" parameter. > > Just be sure to import thePermissionmodel.  It in > django.contrib.au

permissions in templates

2009-12-04 Thread Adonis
Hi, I am trying to compare some existing permissions with the permissions that a project member has. From views.py i am giving a list with all available permissions. The problem is that the permission format is different and i cannot think of a slick way to compare them..My mind hovers around

add permission by name instead of number

2009-11-26 Thread Adonis
Hi, I have been going through the permission documentation and i know i can assign users with permissions like this, * request.user.user_permissions.add(1) * But having 100 or more permissions i find this method a bit weird. Is not there a way to say, *

add permission by name?

2009-11-23 Thread Adonis
Hi, I have been going through the permission documentation and i know i can assign users with permissions like this, * request.user.user_permissions.add(1) * But having 100 or more permissions i find this method a bit weird. Is not there a way to say, *

Re: django template language issue

2009-08-17 Thread Adonis
Thanks! On Aug 17, 11:53 am, David Zhou <da...@nodnod.net> wrote: > On Mon, Aug 17, 2009 at 6:39 AM, Adonis<achrysoch...@hotmail.com> wrote: > > My problem is that even if the 'projects' queryset is empty, it still > > includes the projects.html > > Is there an

django template language issue

2009-08-17 Thread Adonis
Hi all, I am doing this {% for item in projects %} {% include projects.html %} {% endfor %} My problem is that even if the 'projects' queryset is empty, it still includes the projects.html Is there another way to do it? Regards, --~--~-~--~~~---~--~~ You

Re: weird name error

2009-04-01 Thread Adonis
31, 9:32 am, Adonis <achrysoch...@hotmail.com> wrote: > well, this is the traceback, > > Traceback (most recent call last): >   File "./manage.py", line 11, in >     execute_manager(settings) >   File "/var/lib/python-support/python2.5/dj

Re: weird name error

2009-03-31 Thread Adonis
ayersOfUsers' is not defined ** and the model.py imports, from django.db import models from django.contrib.auth.models import User ** Kind regards, On Mar 30, 7:16 pm, Briel <toppe...@gmail.com> wrote: > Hi. > You really dont give much information, when this > happens trace

weird name error

2009-03-30 Thread Adonis
Hello, You will love this one, models.py * class LayersOfUsers(models.Model): name = models.CharField(max_length=50) desc = models.TextField(null=True) geouser = models.ForeignKey(User) def __unicode__(self): return self.name class Species_d(models.Model):

Re: broken pipe urlpattern

2009-02-27 Thread Adonis
al URL or put them in the "blah" folder. cheers, On Feb 26, 3:08 pm, Adonis <achrysoch...@hotmail.com> wrote: > hello dear djangonauts, > > Could anyone explain what is wrong here and i am getting an error 32: > broken pipe? > I am using this url: ...appname/mama/10

Re: optional parameter url

2009-02-27 Thread Adonis
/sth.jpg". If you have sth to add be my guests! thanks again! On Feb 26, 11:58 am, Adonis <achrysoch...@hotmail.com> wrote: > Thank you for your replies, > > Kevin, > Adding a slash does no good when it comes to calling static files > using serve(). It works different

Geodjango Linestring POST

2009-02-27 Thread Adonis
Hello, Being having trouble with linestring(). I am posting values like this: (a,b), (c,d) so the format is acceptable. When i try: * polycoords = request.POST['polygcoords'] poly = LineString(polycoords ) insert_info = polylines(geometry = poly) * i get "Invalid initialization input for

broken pipe urlpattern

2009-02-26 Thread Adonis
hello dear djangonauts, Could anyone explain what is wrong here and i am getting an error 32: broken pipe? I am using this url: ...appname/mama/10/10/ * url.py (r'^appname/mama/(?P\d+)/(?P\d+)/$', 'appname.views.mama') (r'^appname/mama/(?P\d+)/(?P\d+)/(?P.*)$', 'django.views.static.serve',

Re: optional parameter url

2009-02-26 Thread Adonis
or 32, broken pipe". I have been trying to figure out why but i did not find anything yet. The parameters though are read and printed. I can not manage to do sth with Error handling. Any further suggestions? On Feb 25, 7:23 pm, Raffaele Salmaso <raffaele.salm...@gmail.com> wrote: > A

optional parameter url

2009-02-25 Thread Adonis
Hello, I am having some trouble serving static files when i try to pass an optional parameter. For url: appname.mainpage/, the static files work fine For url: appname.mainpage/10/, the static files are not read. ** url.py (r'^appname/mainpage/(?P.*)$', 'django.views.static.serve',

Re: Geodjango GPolygon

2009-02-16 Thread Adonis
Justin, So it would seem, Thank you very much for this notice. I reversed the Glatlng() and now it works just fine. regards, On Feb 16, 4:35 pm, Justin Bronn wrote: > > Im afraid that it does not change anything by leaving out the fromstr > > and wkt. > > It is a really

Re: Geodjango GPolygon

2009-02-16 Thread Adonis
e geometry natively - no fromstr() or > .wkt necessary. > > Try GPolygon(polycoords_from_database.geometry) > > Adam > > 2009/2/16 Adonis <achrysoch...@hotmail.com>: > > > > > Hello, > > > -being facing a non-givin-back-errors problem... > > > v

Geodjango GPolygon

2009-02-16 Thread Adonis
Hello, -being facing a non-givin-back-errors problem... view.py poly = GPolygon(fromstr (polycoords_from_database.geometry.wkt),"#f33f00",3,1,"#008000",1) blah.html map.addOverlay(new {%block poly%}{%endblock%}) -the page source shows that the new GPolygon has a proper syntax BUT the new

Geodjango polygon object

2009-01-26 Thread Adonis
Hello, I am trying to pass the polygon coordinates to my JS array but i do not get numbers. I end up with a JS array in which every polygon is displayed like this : The truth is that i would rather have a numeric format...How could i parse my polygon objects and extract the coordinates? for

Geodjango POST and WKT

2009-01-23 Thread Adonis
Hello, This is my first inquery and i am very happy that this user community exists. This is the code fragment: if request.method == 'POST': #code ommited... poly_coords = request.POST['polygcoords'] if poly_coords != 0: coords = poly_coords.replace(",