Hi all i am not able to save the entry of sub_cat field
here is my model.py
class MainCategory(models.Model):
main_cat_code= models.CharField(max_length=20,primary_key=True)
description = models.CharField(max_length = 50,)
def __unicode__(self):
return self.main_cat_code
class SubCa
On Wed, Dec 24, 2008 at 6:33 AM, dick...@gmail.com wrote:
>
> looking at the serialization serializers, is is possible to save "new"
> instance of a model object represented in xml?
>
> i'm getting an error:
>
> node is missing the 'pk' attribute, but basically, there
> isn't one, because i don'
Use cron and custom manage.py commands
On Fri, Dec 26, 2008 at 10:58 AM, Fluoborate wrote:
>
> I have a philosophical question. How should I implement code that runs
> in the background, automatically, and continuously? What is a safe and
> kosher way to do that?
> >
>
--~--~-~--~~
On Thu, Dec 25, 2008 at 9:02 AM, bsergean wrote:
>
> Hi all,
>
> I'm populating my database manually using a script that create ORM
> objects and save them... I have a lot of datas and it's fairly slow.
> I'm wondering what is the best way to speed this up.
>
> From
> http://docs.djangoproject.c
On Thu, Dec 25, 2008 at 5:41 PM, David wrote:
>
> Dear all,
>
> I am a newbie in Django and python, now trying to construct a website
> with more than one databases on the backend.
>
> My question here is, if there any possibility that using 2 different
> databases inside one project(website)?
>
Dear all,
I'm trying to make register page, but it it cannot compare 2 password,
even if I submit different password it still run and didn't raise
ValidationError, please help me. My forms.py as per below:
class RegistrationForm(forms.Form):
username = forms.RegexField(label=("Username"), max_
On Fri, 19 Dec 2008 08:21:51 -0500, Abdel Bolanos Martinez wrote:
> Please can any one give me good references about tools for create PDF
> reports, graphs in Django besides RepoLab
I am using pdfLaTeX to generate the PDFs on the fly and serve them via
Django after dumping ReportLab.
regards,
That did it! Thanks. I also needed zlib, I think?
Rick
On Dec 25, 1:15 pm, Jarek Zgoda wrote:
> Wiadomość napisana w dniu 2008-12-25, o godz. 13:50, przez Rick Dooling:
>
> > django.core.exceptions.ImproperlyConfigured: Error loading sqlite3
> > module: No module named _sqlite3
>
> > I'm runn
I'm trying to use Django to manage an existing sqlite3 database of
quotations. I used inspectdb to generate the models. Everything
works fine, until I attempted my first generic view and first
template. Everything executes according to plan, but I get no data
outputted into the fields using obj
Hi Eric
Thanks a lot .i wraped the template in the autoescape tag, Now its working fine
Thanks & Regards
Dmitri
On Fri, Dec 26, 2008 at 2:55 PM, Eric Abrahamsen wrote:
>
>
> On Dec 26, 2008, at 10:56 AM, s4shre...@gmail.com wrote:
>
>>
>> Hi Guys,
>> I am new to Django . My Django form HTML is
Duh!
Never mind. Sorry for the trouble.
Simple Python goof.
>{% for quotes in object_list %}
> {{ table1.source2 }}
Should be {{ quotes.source2 }}
Sorry for the intrusion.
RD
On Dec 26, 10:43 am, Rick Dooling wrote:
> I'm trying to use Django to manage an existing sqlite3 datab
Hi Djangonians,
I recently had an instance where it would have been really convenient
to see the error and a traceback in the ``runserver`` console instead
of just a single line telling me that the request returned a 500
error.
In the event of blind debugging, where a 3rd party tool is performin
I'd like to create a front facing poll creation form that can
automatically handle deletion, reordering of choices.
I believe formsets are the easiest way to accomplish this. I start
with 3 choices and want to allow the user to add more.
Check the following code:
def create(request):
n
Hi all!
I'm working on an app which has two classes:
# This one records acedemic journal name and related infomation:
class Journals(models.Model):
Name = models.CharField(u'Journal', max_length=200, unique=True)
IsSelected = models.BooleanField(u'If it is a special journal',
def
I do the reports in HTML, using django templates and then instead of
send the rendered result to the browser, I filter it throught htmldoc
linux utility.
Works like a charm for me.
Abdel Bolanos Martinez wrote:
> Please can any one give me good references about tools for create PDF
> reports
Paper.objects.filter(Journal__Name='Science').order_by("-PublishedDate")
Read the documentation please.
On Fri, Dec 26, 2008 at 8:43 PM, 夏恺 wrote:
>
> Hi all!
>
> I'm working on an app which has two classes:
>
> # This one records acedemic journal name and related infomation:
> class Journals(
How much of django's code is broken with python 3.0?
I'm not that deep into Python, (yet). So, it strikes me that maybe
I'm better off installing 3.0 and learning that rather than sticking
to 2.5.
But, I don't want to find out I have to go and relearn django all over
again.
--~--~-~--~-
Alex Koshelev 写道:
> Paper.objects.filter(Journal__Name='Science').order_by("-PublishedDate")
>
> Read the documentation please.
>
>
>
Thanks!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To
On Fri, Dec 26, 2008 at 3:15 PM, waltbrad wrote:
> How much of django's code is broken with python 3.0?
The installation instructions and the installation FAQ cover this issue:
http://docs.djangoproject.com/en/dev/intro/install/#install-python
http://docs.djangoproject.com/en/dev/faq/install/#
I'm writing a library app - would like to find out if it is possible
to have a dynamically updating (returndate) field in a model?
class Loan...
...
borrowdate = models.DateTimeField(auto_now_add = True)
returndate = models.DateTimeField(timediff(borrowdate+ timedelta
(days=2))
...
--~--~--
Is there a way to calculate and store the average rating in this
example:
RATING_CHOICES = {
'3' : 'Excellent',
'2' : 'Good',
'1' : 'Poor',
}
class Loan(
...
book = models.ForeignKey(Book)
rating = models.IntegerField(choices=RATING_CHOICES)
...
class BookRatings(...
...
book = mod
Lol.
Just looking at the time between posts - did it really take 45 min to
figure that out?
I find it amazing as I often lose days like that!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
I highly recommend:
http://code.google.com/p/django-pagination/
Very easy to implement, requires no modifications to views or models,
purely template based (via template tags).
On Dec 24, 2:36 pm, kev wrote:
> Ah ok :)
>
> Thx!!
>
> On Dec 24, 5:12 pm, Brian Neal wrote:
>
> > On Dec 24, 3:54
So I need to display the data for a form field from the post or from
the instance if no post. This works but I am hoping there is a better
way:
{% if form.is_bound %}
{{ form.data.foo }}
{% else %}
{{ form.instance.foo }}
{% endif %}
Any suggestions?
--~--~-~--~~
I hope you meant "guys", heh.
On Nov 6, 3:12 am, "yuanyun.ken" wrote:
> Thanks for all gays' great help. This does help me a lot.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this
thanks
On Dec 21, 11:44 am, Malcolm Tredinnick
wrote:
> On Fri, 2008-12-19 at 19:58 -0800,Shuge Leewrote:
>
> [...]
>
> It's not really necessary to post all that SQL and Python, since you're
> only really asking about a couple of the models. If you can reduce your
> example to the smallest case
class tb1( models.Model ):
name = models.CharField(max_length=32)
tb2 = models.ForeignKey(Category)
class tb2( models.Model ):
name = models.CharField(max_length=64)
Do I have to use Manager when do cross-table querying such
SELECT
tb1.name,
tb2.name as tb2_name
FROM
tb1 I
tb1.objects.extra(select={"tb2_name": "app_tb2.name"},where=["app_tb1.name=
app_tb2.name"], tables=["app_tb2"]).values("name", "tb2_name")
On Sat, Dec 27, 2008 at 7:16 AM, Shuge Lee wrote:
>
> class tb1( models.Model ):
>name = models.CharField(max_length=32)
>tb2 = models.ForeignKey(Cat
Hmm... this is slightly different... is BookRatings and Books 1 to 1?
If I store these aggregates as part of the class that it's grouping
by. Here's how I do it for restaurants:
class RestaurantRating(models.Model):
restaurant = models.ForeignKey(Restaurant)
value = models.IntegerF
I currently serve up images via the DB vs. filesystem. I did this in
order to keep the data in one place, but I now regret it.
I'd recommend overriding the delete() of your image class to take care
of deleting the related image from your storage.
Depending on your needs and the amount of data,
I have a model that refers to a ForeignKey, e.g.:
class Template(models.Model):
type = models.ForeignKey(Type)
...
class Type(models.Model)
name = models.CharField(max_length=32)
...
I can fetch these objects fine using the model API.
t = Template.objects.get(id=1)
print t.type
>>
print t
Thank you very much Malcolm. The methods I listed above has worked for
me so far - so your response is reassuring.
I was just surprised that no one had encountered a similar need
already. The concept here is parallel to getting a list of
territories in a country, dynamically fetched based on the
32 matches
Mail list logo