*You need SlugField or even check the AutoSlugField app.
*
On Sun, Oct 16, 2011 at 7:29 AM, Tsung-Hsien wrote:
> I want to build a gallery which connects to different photo sets.
> I have been completed the gallery main page, however, I meet two
> problems:
> 1) Use title name of cover image as t
I have some gnarly AND/OR logic combining Q() objects but deep
within the logic, I need to do a comparison of two constants. In
an ideal world, the logic would look something like
def age(self, age):
... & Q(12=as_of.month) & ...
but that's invalid python.
I *can* break out this rats
I want to build a gallery which connects to different photo sets.
I have been completed the gallery main page, however, I meet two
problems:
1) Use title name of cover image as the URL of photo page, but if the
name include blank, then The URL is not complete. For example: the
cover image named sum
On 13-10-11 23:57, Andriyko wrote:
class Article(models.Model):
..
# with django 1.2 was
@models.permalink
def get_absolute_url(self):
return ('article_detail', (), { 'year':
self.pub_date.strftime("%Y"),
'month':
self
Hi
I was wondering if anyone had a similar problem when trying to use
pango in django running under mod_wsgi on apache.
I am running
|20:11:06|# cat /etc/debian_version
6.0.3
When I run a runserver on the same server it works fine but the moment
I "import pango" in any of my modules the mod_wsg
Hi
I was wondering if anyone had a similar problem when trying to use
pango in django running under mod_wsgi on apache.
I am running
|20:11:06|# cat /etc/debian_version
6.0.3
When I run a runserver on the same server it works fine but the moment
I "import pango" in any of my modules the mod_wsg
Thank you for the response.
As stuart wrote, i should give more details about the website.
Currently let's suppose I have 2 interesting tables (I'm not sure that
the relationship between these 2 tables is well designed):
1. Details, that contains all the possible information that should be
provid
I guess I should apologize myself. To alter how managers return
objects the get_query_set method should be overloaded.
On 10/15/11, Daniel Roseman wrote:
> On Saturday, 15 October 2011 15:12:17 UTC+1, Piotr Hosowicz wrote:
>>
>> Hello,
>>
>> I still do not understand how things are connected i
> Unfortunately, you have received a lot of very bad advice in this thread,
> for which I can only apologise on behalf of Django-users ...
>
> The references to your custom Managers are misleading. Although it's true
> that you don't need them, because they're not changing anything, you aren't
> in
On Saturday, 15 October 2011 15:12:17 UTC+1, Piotr Hosowicz wrote:
>
> Hello,
>
> I still do not understand how things are connected in Django. In
> models.py I have:
>
> class CampaignManager(models.Manager):
> pass
>
> class CampPeople(models.Model):
> person = models.ForeignKey(Per
Piotr,
You need to remove the custom manager from your code since you are not
making use of it.
You also need to read the custom manager documentation so you can
understand managers and how they work
On 10/15/11, Thomas Orozco wrote:
> Just don't assign anything to objects and leave that line ou
Just don't assign anything to objects and leave that line out of your code ;
use the default manager.
Le 15 oct. 2011 17:54, "Piotr Hosowicz" a écrit :
> On 15 Paź, 17:40, Piotr Hosowicz wrote:
> > Carlos, of course I have data in the DB. Babatunde, the managers is
> > the thing that my friend,
Yes your context is correct but the problem is with what the context
does contain.
Managers return querysets but yours does not do anything or return
anything. It will be very clear to you if you go to the django in
built shell and do PersonPhones.objects.all(). You'll find out that it
contains no
On 15 Paź, 17:40, Piotr Hosowicz wrote:
> Carlos, of course I have data in the DB. Babatunde, the managers is
> the thing that my friend, local Django guru, didn't answer me. I
> believe you are right, I just copied the manager with empty body from
> previous pieces of code that worked. I'll try i
Carlos, of course I have data in the DB. Babatunde, the managers is
the thing that my friend, local Django guru, didn't answer me. I
believe you are right, I just copied the manager with empty body from
previous pieces of code that worked. I'll try it, thanks a lot.
Regards,
Piotr Hosowicz
--
Y
> Models contain code for the ORM and what will be used to create tables
> for your database. View is where you can process logic and data from
> your models or database before output to the client. Models are not
> directly linked to templates and templates get their context from the
> view.
Yes
Hi Piotr,
The problem is with your custom managers. You defined PersonPhones
manager (and all your other managers) to do nothing and hooked it to
objects effectively confusing everything.
Ideaally you should have:
objects = models.Manager()
But in your case its:
objects = PersonPhonesManager()
By
Also don't forget to load your data in the database, otherwise the
results of the query will be empty, you can use the django-admin to
help you get started and fill some data in (as outlined on the
tutorials from django docs).
--
You received this message because you are subscribed to the Google
Hi Piotr,
Models contain code for the ORM and what will be used to create tables
for your database. View is where you can process logic and data from
your models or database before output to the client. Models are not
directly linked to templates and templates get their context from the
view. Cont
On 15 Paź, 16:53, Carlos Daniel Ruvalcaba Valenzuela
wrote:
> Perhaps the problem lies on the view code, are you passing the query data to
> the template? Is que query returning any data? Try posting the relevant code
> from your views.
Here is the relevant part of views.py:
def campaign(request
Perhaps the problem lies on the view code, are you passing the query data to
the template? Is que query returning any data? Try posting the relevant code
from your views.
Regards,
Carlos Ruvalcaba
El 15/10/2011 14:12, "Piotr Hosowicz" escribió:
> Hello,
>
> I still do not understand how things a
Hello,
I still do not understand how things are connected in Django. In
models.py I have:
class CampaignManager(models.Manager):
pass
class CampPeople(models.Model):
person = models.ForeignKey(Person)
camp = models.ForeignKey(Campaign)
docall = models.BooleanField(True)
calle
> Based on your previous mail, CampPeople instances have a docall field.
> piplok is a CampPeople instance, since you have passed in a queryset of
> CampPeople in the 'camppeople' variable and are iterating through it in the
> for loop. So I expect this should be:
>
> {% if piplo.docall %}
Yeah, t
On Sat, Oct 15, 2011 at 8:51 AM, Piotr Hosowicz wrote:
> Hello,
>
> This is in views.py :
>
> def campaign(request, campaign_id):
>ctx = {'phones': PersonPhones.objects.all(), "camppeople":
> CampPeople.objects.all() }
>return render_to_response("campaign.html", ctx,
> context_instance=Re
Hello,
This is in views.py :
def campaign(request, campaign_id):
ctx = {'phones': PersonPhones.objects.all(), "camppeople":
CampPeople.objects.all() }
return render_to_response("campaign.html", ctx,
context_instance=RequestContext(request))
This is the template :
{% for piplok in camp
25 matches
Mail list logo