Like the code for ArtworkForm
On 7/26/12, Babatunde Akinyanmi wrote:
> Looks good to me. Are you sure have shown us all the relevant parts of
> your code?
>
> On 7/25/12, Deathweasel wrote:
>> Hello, guys.
>> This is Django 1.4.
>>
>> I have this code from my view:
>>
>> my_art = ArtworkMode
Looks good to me. Are you sure have shown us all the relevant parts of
your code?
On 7/25/12, Deathweasel wrote:
> Hello, guys.
> This is Django 1.4.
>
> I have this code from my view:
>
> my_art = ArtworkModel.objects.get(id=pk)
> comments = CommentModel.objects.filter(artwork=pk)
> artForm = Ar
Hi Kit
I've been working with a similar problem to solve. I was using Django 1.3.0.
In my case, the legacy database could not be either created nor loaded with
fixtures as it had lots of composite keys - which is something Django can't
handle.
The workaround I used to run tests was to override t
On Jul 25, 2012, at 3:11 PM, fnando wrote:
> Hello, beginner here. I'm getting an error at the IF statement, line 2 of
> this snippet:
Could it be that you're using object as the loop variable, and object is also
the global var? I might change it to:
for item in object.list
And use {{ item
HI daniel, thanks for the reply
After your comments, I have used ModelForm to simplify my code. I have also
achieved redirecting the desired url by using the redirect() function. My
issues are still basically the same however:
- I do not know how to tell Django to render a template at the redir
Hello fellow Django developers,
So here is my model that interfaces with my Artists database:
from django.db import models
class Artist(models.Model):
name = models.CharField(max_length=30)
genre = models.CharField(max_length=30)
city = models.CharField(max_length=30)
It seems to me that two fields might be the simple solution?
class SomeForm(Form):
internal = forms.ModelMultipleChoiceField(
,
widget=forms.CheckboxSelectMultiple)
externa = forms.ModelMultipleChoiceField(
,
widget=forms.CheckboxSelectMultiple)
Then y
Hello, beginner here. I'm getting an error at the IF statement, line 2 of
this snippet:
{% for object in object.list|slice:":5" %}
{% if object.person == "String" and forloop.counter0 == 5 %}
{% else %}
{{ object.paper }}
Hello, guys.
This is Django 1.4.
I have this code from my view:
my_art = ArtworkModel.objects.get(id=pk)
comments = CommentModel.objects.filter(artwork=pk)
artForm = ArtworkForm(instance=my_art)
...
These models:
class ArtworkModel(models.Model):
"""
This class contains the informat
I have a url which I want to save into the MySQL database using the
"cursor" tool offered by django, but I keep getting the "not enough
arguments for format string" error because this url contains some escaped
characters (non-ascii characters). The testing code is fairly short:
#test.py#
>
Please read the following bits of documentation:
https://docs.djangoproject.com/en/dev/topics/db/sql/#performing-raw-sql-queries
https://docs.djangoproject.com/en/dev/ref/models/querysets/#django.db.models.query.QuerySet.extra
Cheers,
AT
On Tue, Jul 24, 2012 at 9:03 PM, jondbaker wrote:
> I'v
Hi
I have set up a login page, using "django.contrib.auth.views.login"
and user's would be forwarded to their own web page after being
authenticated, but they can access to their web page directly with
placing the related uri.
how can I prevent direct access to those page ?
Thanks
--
You r
It is possible to override the save() method in a model to add functionality:
https://docs.djangoproject.com/en/dev/topics/db/models/#overriding-model-methods
Another choice would be to register a receiver for the pre_save or
post_save signals:
https://docs.djangoproject.com/en/dev/ref/models/inst
On Wed, Jul 25, 2012 at 12:34 PM, Sithembewena Lloyd Dube wrote:
> Hi all,
>
> I have the following code:
>
> class Points(models.Model):
> blah blah
>
> class TrainingSession(models.Model):
> confirmed = models.BooleanField()
> points = models.ForeignKey(Points, null=True, blank
Hi all,
I have the following code:
class Points(models.Model):
blah blah
class TrainingSession(models.Model):
confirmed = models.BooleanField()
points = models.ForeignKey(Points, null=True, blank=True)
When a training session is saved, if confirmed is True I wish to create and
your get absolute url method is in the wrong format::
if should be.
@models.permalink
def get_absolute_url(self):
return ("view_name", #view name,
(), #tuble of positional args
{}, #dict of name kwargs
)
In your case, this is what the method should look like:
Your get_absolute_url method is in the wrong format:::
it should be:
@models.permalink
def get_absolute_url(self):
return ("view_name", #view name
)
On Tuesday, July 24, 2012 1:58:26 PM UTC-4, Jeff Green wrote:
>
> I am stuck in trying to figure out why the get_absolute_url call
Karen,
All sorted now.
Thanks! Well (tail between legs), the problem was not the template that
was being called, but a template being "included" inside that template.
That second template is loaded based on a few "if" statements, and a
bug/flaw in my logic (undetected until now ... code in p
I agree I can have the user input city and state and do a lat lon as a basic
search and let the user put in their home address or pan on a map for an
advanced search. However given the large amounts of data Im striving for pure
speed and efficiency. By possibly deciding againist geolocation and
Hi there,
I would like to test a django 1.2.3 application that uses both a sqlite db
for auth/users, and an *unmanaged* postgres database for the application
itself. Given that the models are unmanaged, and the postgres database has
a very involved, long running set of scripts to build, the rig
On Wednesday, 25 July 2012 08:02:14 UTC+1, Alex Strickland wrote:
>
> On 2012/07/23 03:08 PM, Alex Strickland wrote:
>
> > https://docs.djangoproject.com/en/dev/topics/forms/formsets/ ?
>
> No.
>
> This is my html that shows a nice looking control using bootstrap, with
> lists of users broken u
On Wednesday, 25 July 2012 02:42:45 UTC+1, Matthew Meyer wrote:
>
> Hello all,
>
> I'm trying to load the url of a model created with get_absolute_url()
> programmatically in my view. There are basically three steps I need to
> accomplish this:
>
> 1. make sure @permalink is working correctly.
On 2012/07/23 03:08 PM, Alex Strickland wrote:
https://docs.djangoproject.com/en/dev/topics/forms/formsets/ ?
No.
This is my html that shows a nice looking control using bootstrap, with
lists of users broken up into their groups:
{% for group in group_list %}
23 matches
Mail list logo