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
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 wh
*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
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
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 describing is more of a r
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
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. Th
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 a
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.auth.models
>
&g
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 strin
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,
*
request.user.user_permissions.add('auth.d
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,
*
request.user.user_permissions.add('auth.d
Thanks!
On Aug 17, 11:53 am, David Zhou wrote:
> On Mon, Aug 17, 2009 at 6:39 AM, Adonis wrote:
> > My problem is that even if the 'projects' queryset is empty, it still
> > includes the projects.html
> > Is there another way to do it?
>
> If you're
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 r
31, 9:32 am, Adonis 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/django/core/management/
> __init__.py"
r: name 'LayersOfUsers' 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 wrote:
> Hi.
> You really dont give much information, when this
> happens traceb
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):
speciesNam
". I
either had to give them a Global URL or put them in the "blah" folder.
cheers,
On Feb 26, 3:08 pm, Adonis wrote:
> hello dear djangonauts,
>
> Could anyone explain what is wrong here and i am getting an error 32:
> broken pipe?
> I am using this
separate folder--> "mesa/images/sth.jpg".
If you have sth to add be my guests!
thanks again!
On Feb 26, 11:58 am, Adonis wrote:
> Thank you for your replies,
>
> Kevin,
> Adding a slash does no good when it comes to calling static files
> using serve(). It works di
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 LineStr
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', {'do
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
wrote:
> Adonis wrote:
> > (r
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',
{'document_roo
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 weird problem reversing
r() or
> .wkt necessary.
>
> Try GPolygon(polycoords_from_database.geometry)
>
> Adam
>
> 2009/2/16 Adonis :
>
>
>
> > Hello,
>
> > -being facing a non-givin-back-errors problem...
>
> > view.py
>
> > poly = GPolygon(fromstr
> >
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 GLa
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 e
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(", "
28 matches
Mail list logo