A model is just a class, so the methods just "go there", yes.
You could check out apps in django.contrib for styling best practices (the
django doc itself also covers this I think*,* but I can't remember where)
Le 17 juil. 2012 19:49, "jeffsarge" a écrit :
> Hi,
> I'm learning Django and Python
Did you visit the page where the broken link exists with the same browser
as your user and searched for :
+ JS warnings
+ JS errors
+ Requests on the broken link
+ The actual broken url somewhere in the DOM tree
Chrome has an integrated full featured debugger, you could use it.
The proble
In my models.py I override the save method like this:
def save(self, *args, **kwargs):
self.directiondb = get_direction_db(self.nod_id1.id,
self.nod_id2.id)
get_direction_descr(self.nod_id1.id, self.nod_id2.id)
get_vrd_code(self.nod_id1.id, self.nod_id2.id)
self.vr
Here you're trying to upload to a directory, whose path starts with a / :
/images.
On *nix, / means system root. Obviously your django process does not have
permission to write there unless you set that up so.
You should remove the leading slash in your upload to path. Your files will
then uploa
CachedStaticFiledStorage will work, only it will not append the hashes as
it usually does and behave like a standard file storage.
The use case for this storage is to set very long expires dates on the
static files and rely and their url changing (due to the hash changing )
whenever you change the
You may autopopulate created_by field via admin interface following this
guideline:
http://stackoverflow.com/questions/3986963/prepopulate-an-admin-field-from-logged-in-user
Hope it helps!
El viernes, 24 de junio de 2011 22:00:28 UTC+2, django_cd escribió:
>
> Hey,
>
> I am very new to Django j
Hi, I'm new with Django and in this Groups; I have the next models and
question
class Empresa(models.Model):
usuario = models.ForeignKey(User)
empresa = models.CharField(max_length=100, unique=True)
slogan = models.TextField()
logotipo = models.ImageField(upload_to='logos')
descripcion = models.
Hi there,
You need to create a 404.html page in order to Django's generic view to
display the 404 when DEBUG mode is false. Otherwise, it will display a 500
error.
Put the 404.html in your app's template directory and try again.
Best wishes,
Masud
On Wednesday, 18 July 2012 11:04:49 UTC+1, nf
Well, as far as I know, we can't signup for amazon ECS without credit card.
Regarding my project: Its a personal project.
Right now I am on RedHat OpenShift (developers preview version) currently
has some beautiful offers..
On Wednesday, July 18, 2012 1:26:08 AM UTC+5:30, Kurtis wrote:
>
> Jus
"Openshift?" .. what are you trying to say..
On Thursday, July 19, 2012 4:06:03 AM UTC+5:30, doogster wrote:
>
> Openshift?
>
> On Monday, July 16, 2012 8:27:23 PM UTC-7, surya wrote:
>>
>> I am building a facebook application where I have to use database models
>> (very small size ~ 1MB - 2MB).
Yeah I think CachedStaticFiledStorage totally rocks too. In my case I'm
using apache mod wsgi as my development environment, so the appropriate
expires headers on the static files are all set correctly. I just can't get
the hashing functionality when I run it in debug mode. But I've solved the
prob
You may have an error in your 404 view or template. Configure logging
and then take a look at the logs.
_Nik
On 7/18/2012 3:04 AM, nffdiogosilva wrote:
> Hello folks.
>
> Just for the record, this is my first project in Django.
>
> The problem is this:
>
> When i have the debug on true and i sear
> {Empresa1, Sucursal1, Platillo1, Horario1},
> {Empresa1, Sucursal1, Platillo2, Horario1},
> {Empresa2, Sucursal1, Platillo1, Horario1}...
I'm guessing the Sucursal1 in the first and third lines are not the same? I
mean, each Sucursal points to only one Empresa, so I'm guessing you want
only the
I am new to Django and to the group as well, but I am in. Should be
interesting.
On Saturday, June 30, 2012 10:10:27 AM UTC-5, Cal Leeming [Simplicity Media
Ltd] wrote:
>
> Hi all,
>
> As some of you know, I did a live webcast last year (July 2011) on our LLG
> project, which explained how we o
> In my models.py I override the save method like this:
>
> def save(self, *args, **kwargs):
> self.directiondb = get_direction_db(self.nod_id1.id,
> self.nod_id2.id)
> get_direction_descr(self.nod_id1.id, self.nod_id2.id)
> get_vrd_code(self.nod_id1.id, self.nod_id2.id)
>
Hi
my model is like this-
class Students(models.Model):
--
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/-/j3cittrFmXkJ.
To post to this group, send email to
Hi,
my models is-
class Students(models.Model):
country = models.ManyToManyField( Country )
I want to calculate the total number of student objects for each of the
country objects.
I need the count of students interested in each country so far in my
database.
I was trying something w
On Thu, Jul 19, 2012 at 5:00 PM, karan wrote:
> Hi,
>
> my models is-
>
> class Students(models.Model):
> country = models.ManyToManyField( Country )
>
> I want to calculate the total number of student objects for each of the
> country objects.
>
> I need the count of students interested i
within the head section of my base.html I am using
{% block title %}
{% if request.path_info == '/' %}
home
{% else %}
{{ request.path_info | slugify }}
{% endif %}
{% endblock
Rarr, I meant OpenShift not Open Cloud
>.<
On Thu, Jul 19, 2012 at 10:54 PM, surya wrote:
> "Openshift?" .. what are you trying to say..
>
>
> On Thursday, July 19, 2012 4:06:03 AM UTC+5:30, doogster wrote:
>>
>> Openshift?
>>
>> On Monday, July 16, 2012 8:27:23 PM UTC-7, surya wrote:
>>>
>>> I
Redhat's cloud hosting service. They offer a free tier, and they're
Django-compatible.
On Thursday, July 19, 2012 5:54:03 AM UTC-7, surya wrote:
>
> "Openshift?" .. what are you trying to say..
>
> On Thursday, July 19, 2012 4:06:03 AM UTC+5:30, doogster wrote:
>>
>> Openshift?
>>
>> On Monday, J
If you are comfortable with sql syntax, just pull the data you want with
sql joins.
You already have the keys set up
On Thursday, July 19, 2012 5:16:42 AM UTC-4, Julio Galvez wrote:
>
> Hi, I'm new with Django and in this Groups; I have the next models and
> question
>
> class Empresa(models.Mo
Shouldn't that be a prefetch related and not select related?
Le 19 juil. 2012 16:52, "Tomas Neme" a écrit :
>
> > {Empresa1, Sucursal1, Platillo1, Horario1},
> > {Empresa1, Sucursal1, Platillo2, Horario1},
> > {Empresa2, Sucursal1, Platillo1, Horario1}...
>
> I'm guessing the Sucursal1 in the fir
Hi all! I'm learning python-django and I really like. Can anyone
recommend a "static website generator" for use with python-django?
Greetings and thank you very much from now.
--
You received this message because you are subscribed to the Google Groups "Django
users" group.
To post to this gro
You could create a custom template tag to do this. Then just do something
like
{% load page_title %}
...
{{ page_title }}
Or create a context middleware that will always creates a variable with the
proper data.
On Thu, Jul 19, 2012 at 12:36 PM, Markus Gattol wrote:
> within the head section of
Is this the sort of thing you're looking for?
http://datadesk.latimes.com/posts/2012/03/introducing-django-bakery/
-Original Message-
From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On
Behalf Of fernando iocca
Sent: 19 July 2012 18:56
To: django-users@googlegro
Maybe you could use parse.com. Has available a REST API that seems to be
good, I have not tried it yet.
El 19/07/12 14:20, doogster escribió:
Redhat's cloud hosting service. They offer a free tier, and they're
Django-compatible.
On Thursday, July 19, 2012 5:54:03 AM UTC-7, surya wrote:
"
Is there a tutorial describing how to do this somewhere please ?
Because right now, geodjango is unusable with PostGreSQL 9 + PostGIS 2
--
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.goo
Thanks, the first example is exactly that i want. I try it in the Django
Shell and it works, but; How I show the results in the template?
Maybe I'm wrong, but I try to pass like { 'empresas':
Empresa.objects.all().select_related() } ,and only can show the 'Empresa'
attributes on the loop.
I
> Thanks, the first example is exactly that i want. I try it in the Django
> Shell and it works, but; How I show the results in the template?
>
> Maybe I'm wrong, but I try to pass like { 'empresas':
> Empresa.objects.all().select_related() } ,and only can show the 'Empresa'
> attributes on the lo
That works awesome!!. I'm new in this, and I don't know many things about
how works django.
Thanks all for help me
El jueves, 19 de julio de 2012 15:07:44 UTC-5, Tomas Neme escribió:
>
> > Thanks, the first example is exactly that i want. I try it in the Django
> > Shell and it works, but; How
>
> Is it now possible what get_direction_descr() and get_vrd_code() return to
> be displayed on the template on the fly just after the user selects nod_id1
> and nod_id2 from a dropdown list?
> Or how I could accomplish sth like this?
>
>
Hello,
the Model save() method is not connected like t
>
> url(r'^$',
> ListView.as_view(
> queryset=Poll.objects.order_by('-pub_date')[:5],
> context_object_name='latest_poll_list',
> template_name='polls/index.html')),
>
>
Here you are setting template_name='polls/index.html'
>
> TemplateDoesNotExis
Thanks .. I had the same problems and it worked too.
On Saturday, June 12, 2010 4:54:34 AM UTC-3, Joel Klabo wrote:
>
> I finally got it to work by adding the RequestContext to my
> render_to_response. I think the issue was that it was redirecting and
> the csrf_token wasn't getting sent to the
thanks Christopher!
El 19/07/12 15:06, Christopher Hinds escribió:
Is this the sort of thing you're looking for?
http://datadesk.latimes.com/posts/2012/03/introducing-django-bakery/
-Original Message-
From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On
Behalf
On Fri, Jul 20, 2012 at 2:06 AM, Christopher Hinds
wrote:
> Is this the sort of thing you're looking for?
> http://datadesk.latimes.com/posts/2012/03/introducing-django-bakery/
I've also gotten some good milage out of django-medusa:
https://github.com/mtigas/django-medusa/
Medusa takes a slight
Dear All,
I am trying to use the ImageField in my model, and use get_thumbnail in the
forms.py.
The problem is:
If I don't use get_thumbnail, it works well. The image was uploaded
successfully and the thumbnail shows on the admin page. It works well.
However, If I try to use the get_thumbnail t
oh.
I forgot the complete error message:
IOError at /admin/labcv/person/2/
[Errno 2] No such file or directory: u'/root/django/mysite_new/media/www.jpg'
Request Method:POSTRequest
URL:http://192.168.1.1:8000/admin/labcv/person/2/Django
Version:1.4Exception Type:IOErrorException Value:
[Errno
get_direction_descr does something like this:
def get_direction_descr(nod_id1, nod_id2):
cursor = connection.cursor()
cursor.execute("SELECT
GetDirectionDescr("+str(nod_id1)+","+str(nod_id2)+") from sys.dual")
result = cursor.fetchall()
return result[0][0]
39 matches
Mail list logo