On Jan 22, 4:50 am, "Joni @ mindpulse" wrote:
> Comparing all of them, It looks like PyAMF is the way to go, having
> oficial sopport for django and all.
>
> Though I'm concerned about one particular issue... Suppose I have two
> django models related by a FK.
>
> class Category(models.Model):
>
Hi,
I was wondering whether there any freelancers/companies who offer
code-review as a service.
IMHO, a code review helps in almost all occasions, but the faced paced life
seems to have
put this in the back burner.
Would like your code to be reviewed? If yes, what would be the ideal per
hour rate
You probably want to look at abstract models in Django. It's also known as
concrete inheritance in some ORMs
--
Jani Tiainen
On Tuesday 25 January 2011 09:42:08 akaariai wrote:
> Hello all,
>
> My problem is as follows: I have content (for simplicity, lets say
> articles), and some content re
On 24 jan, 21:20, Filip Gruszczyński wrote:
>
> > You could write a custom descriptor then. But the whole idea of a
> > class-level pseudo-constant pointing to a model instance still looks
> > rather backward to me.
>
> What is a custom descriptor? I have never used it. Is it something
> like a pr
why do you want to create the dual tables, instead of only having one table
with a current tag that holds the old version and the current ones? and then
handle access to those via different managers?
have you also had a look at the available versioning apps?
--
You received this message because
On Jan 25, 12:08 pm, Juergen Schackmann
wrote:
> why do you want to create the dual tables, instead of only having one table
> with a current tag that holds the old version and the current ones? and then
> handle access to those via different managers?
> have you also had a look at the available v
On Thu, Jan 6, 2011 at 11:07 PM, Jennifer Bell wrote:
> Is this a really weird thing to want to do? You can TDD almost
> everything else in django through TestClient except for the end result
> of how stuff looks.
>
> Jennifer
>
Not that weird: http://en.wikipedia.org/wiki/Selenium_(software)
I
Hi,
I have a lot of admin customization. Queryset overriding, custom urls per
object, per admin site, save methods overriding and calling some external
services, template changes, you name it.
So, In my application, I like to have another instance of admin I call
"bare-tables" in which I auto reg
Hi,
can I use methods of methods in Django?
Like so:
class Car(models.Model):
producer = models.ForeignKey(CarProducer)
country_of_origin = producer.country_of_origin
This doesn't seem to work. Is there a special syntax for this?
Jaroslav
--
You received this message because you are
On 25 jan, 11:57, Jaroslav Dobrek wrote:
> Hi,
>
> can I use methods of methods in Django?
What's a "methods of methods" ???
> Like so:
>
> class Car(models.Model):
> producer = models.ForeignKey(CarProducer)
> country_of_origin = producer.country_of_origin
What is CarProducer.country
2011/1/4 Jennifer Bell
> Hi,
>
> I'm trying to figure out the best way of doing something I'd like
> to partially automate staging testing by generating a sequence of
> human verifiable views, with the goal of making sure my app views/css/
> 3rd-party javascript etc. are drawing the way they
I agree with the previous poster - the title is misleading as the word
"method" is incorrect in both places.
It seems that the original poster is talking about denormalizing data.
However, this is unnecessary as the ORM allows for this type of data
to be retrieved any how, e.g.
Car.objects.all().s
Hi,
I've recently been working on an open source project to augment the
inheritance of models in Django. This project, called "djeneralize"
allows you to declare specializations on your models and then query
the general case model and get back the specialized instances. A
simple example of the mod
Hi Euan,
Impressive work.
On Tue, Jan 25, 2011 at 5:13 PM, Euan Goddard wrote:
> Hi,
>
> I've recently been working on an open source project to augment the
> inheritance of models in Django. This project, called "djeneralize"
> allows you to declare specializations on your models and
>> What happens ?
I get this error message when I run manage.py syncdb:
AttributeError: 'ForeignKey' object has no attribute 'producer'
>> And what did you expect to happen ?
I want the 'country_of_origin' of cars to be the string that is stored
in their producer's 'country_of_origin':
class C
On 25 Jan., 12:36, Euan Goddard wrote:
> I agree with the previous poster - the title is misleading as the word
> "method" is incorrect in both places.
O.k. sorry. Should have been "attribute of attribute", right?
--
You received this message because you are subscribed to the Google Groups
"
Hello,
I'm using a current SVN checkout of django an I'm having difficulties
creating a custom field.
class ForeignKeyAX(models.ForeignKey):
__metaclass__ = models.SubfieldBase
description = "ForeignKey field prepared for Ajax Autocompletion"
def __init__(self,*args,**kwargs):
Hi there,
Are you sure that you want to denormalize your schema like that ?
I now this is a totally different issue and question but in this case
do you really need to perform this operation ? Have considered the
problems that this approach will bring?
Imagine this simple use case:
If one changes
On 25 jan, 12:41, Jaroslav Dobrek wrote:
> >> What happens ?
>
> I get this error message when I run manage.py syncdb:
>
> AttributeError: 'ForeignKey' object has no attribute 'producer'
>
> >> And what did you expect to happen ?
>
> I want the 'country_of_origin' of cars to be the string that is
see here
http://djangopackages.com/grids/g/versioning/
ore there is also a interesting chapter on versioning on page 263 here:
http://books.google.com/books?id=lJwOcsZq5g4C&printsec=frontcover&dq=django+pro&hl=de&ei=TdA-TdSyH4GA4Aat1fGwCg&sa=X&oi=book_result&ct=book-thumbnail&resnum=1&ved=0CCwQ6w
HI
Now i am getting some way but i still cant parse the incoming request my
view looks like this at present i am trying to send the request i am getting
from xml.dom import minidom
import urllib
import socket
from django.http import HttpResponse
from django.core import serializers
import urlli
A new and strange error for me...
A model that has a CharField:
comment = models.CharField(max_length=100,db_column='Comment',
blank=True, null=True)
that is defined in a MySQL database:
`Comment` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
is depicted by the Admin in both the cha
Yes, I think this is a great idea.
Ideally, the charge-rate would be "per lines of code" (excluding
blanks, of course!). Hours are just, too, "amorphous" in this
particular case.
On Jan 25, 11:42 am, Venkatraman S wrote:
> Hi,
>
> I was wondering whether there any freelancers/companies who offe
On Tue, Jan 25, 2011 at 11:41 AM, Jaroslav Dobrek
wrote:
>>> What happens ?
>
> I get this error message when I run manage.py syncdb:
>
> AttributeError: 'ForeignKey' object has no attribute 'producer'
>
>>> And what did you expect to happen ?
>
> I want the 'country_of_origin' of cars to be the s
On Tue, Jan 25, 2011 at 11:43 AM, Euan Goddard wrote:
> Hi,
>
> I've recently been working on an open source project to augment the
> inheritance of models in Django. This project, called "djeneralize"
> allows you to declare specializations on your models and then query
> the general case model a
Wonderful idea
Are you going to open business like that?
On Tue, Jan 25, 2011 at 10:18 PM, Derek wrote:
> Yes, I think this is a great idea.
>
> Ideally, the charge-rate would be "per lines of code" (excluding
> blanks, of course!). Hours are just, too, "amorphous" in this
> particular case.
>
Hi Tom,
I hadn't seen that. django_polymorphic looks pretty fully featured and
from a quick look, I'd say it accomplishes everything we set out to
do. I guess a use case for djeneralize would be to handle the simple
specializations and generalizations and nothing more. The impetuous to
write the p
Have a look at:
http://groups.google.com/group/django-users/browse_thread/thread/eaafb5c60108f3bd/50d871a1627453f5?fwc=1
On Jan 24, 9:22 pm, arlen nascimento
wrote:
> Hi all,
> i'm trying to do a simple thing, but it seems not so simple in django.
>
> I have the following models
>
> class Monit
On Tuesday, January 25, 2011 9:42:59 AM UTC, Venkatraman.S. wrote:
>
> Hi,
>
> I was wondering whether there any freelancers/companies who offer
> code-review as a service.
> IMHO, a code review helps in almost all occasions, but the faced paced life
> seems to have
> put this in the back burner
Hello,
I have a model that has a field of the type BigIntegerField(). When inserting
something into that field the value must not have been used before but upon
inserting it's possible to insert the same value twice.
Is there a way to do this using django ?
I could generate a random number ch
Do you have 'unique = True' in the field definition in the model?
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to
django-users+uns
I don't know if this will make you happy but when I researched this some
months ago I found no good solution.
During my search I came upon the following pages that sort of relate to
this...
- http://github.com/dcramer/django-idmapper
-
http://appengine-cookbook.appspot.com/recipe/hi
The id field (which is added by django by default has this) other then that the
field doesn't have unique=True
I was also thinking of a better solution.
I have a Gig model which contains gigs with a ForeignKey to Artist.
I have a Artist model which contains artists.
One Gig can have multiple ar
I have some issues with getting hold of the instance of a Model to which a
RelatedManager got contributed to.
Is that at all possible and if so, how?
>From *my_method* below I can get hold of the model *RelatedStuff* by calling
self.model but that really doesn't get me there.
class MainStuff(mo
Hi all,
Afraid I've got another newbie question. I've been doing some
development on a project using sqlite3. All is working well, and I'd
like to use the same database file in another project, data intact.
I've copied the database file, and the models.py file to the
appropriate locations in th
Do you have suitable file system permissions on the db file for use in
the new context?
Are the two usages (if they are on different machines, or in different accounts)
using the same version of sqlite? (I don't know enough about sqlite to know if
this is a problem, but it's worth checking.)
Doe
The database tables are named {{app_label}}_{{model_name}}, so in order
to use the same database you will need to use the same application name
(or specify db_table in the model's Meta).
--
Michael
On Tue, 2011-01-25 at 07:36 -0800, Ben Dembroski wrote:
> Hi all,
>
> Afraid I've got another ne
> 've copied the database file, and the models.py file to the
> appropriate locations in the new project.
Have you adjusted the settings.py database settings to the correct values ?
If so, maybe try the full path to your database file.
Regards,
Jonas.
--
You received this message beca
On Tue, Jan 25, 2011 at 10:36 AM, Ben Dembroski wrote:
> When I run syncdb, the
> only result is 'no fixtures found.'
in Django-speak 'fixtures' are external files with data to be inserted
in the database, could be in XML, JSON or YAML. do you use them?
maybe you should copy those too from your
can't you do self.model.main?
On Jan 25, 3:34 pm, kmpm wrote:
> I have some issues with getting hold of the instance of a Model to which a
> RelatedManager got contributed to.
> Is that at all possible and if so, how?
>
> From *my_method* below I can get hold of the model *RelatedStuff* by callin
Thanks.
I suspect this is the issue, as I just changed the settings.py file on
the original project to point to the copied database file. It has no
problem accessing the data. I'll play around with the meta settings
and see what I can come up with.
Thanks!
On Jan 25, 3:46 pm, Michael wrote
On Tue, Jan 25, 2011 at 10:28 AM, Jonas Geiregat wrote:
> The id field (which is added by django by default has this) other then that
> the field doesn't have unique=True
>
> I was also thinking of a better solution.
>
> I have a Gig model which contains gigs with a ForeignKey to Artist.
> I have
Great packages ...
I was looking for something exactly similar for a project I am working
on. I will surely use one of those !
On Jan 25, 4:49 pm, Euan Goddard wrote:
> Hi Tom,
>
> I hadn't seen that. django_polymorphic looks pretty fully featured and
> from a quick look, I'd say it accomplishe
On Tuesday, January 25, 2011 3:34:03 PM UTC, kmpm wrote:
>
> I have some issues with getting hold of the instance of a Model to which a
> RelatedManager got contributed to.
> Is that at all possible and if so, how?
>
> From *my_method* below I can get hold of the model *RelatedStuff* by
> calling
Attempting to add the db_table name to the model made things a bit
more confusing.
The original app's name was 'sample_app' (not my choosing)
The app that I'm trying to get to access the data is 'trajectories'
I just added the following the Meta class for one of the models:
class Meta:
I believe table names are all lower-case, so try 'sample_app_person'
--
Michael
On Tue, 2011-01-25 at 08:33 -0800, Ben Dembroski wrote:
> Attempting to add the db_table name to the model made things a bit
> more confusing.
>
> The original app's name was 'sample_app' (not my choosing)
>
> The
That solved the syncdb error, but I'm still getting the same error
inside the shell when I am trying get to the data.
Progress!
Thanks again!
On 25/01/11 16:36, Michael wrote:
I believe table names are all lower-case, so try 'sample_app_person'
--
You received this message because you are
Hello,
I'm designing a model which is a collection of texts. Some of the
texts will be things like books, with a date of publication, and
some of them will be articles or transcripts with a mmddyyy date of
publication/broadcast.
I'd like to structure it somehow so that when I view the list
A developer sometimes has to access and present data that existed
before his application. Common practice is for a database
administrator to define a database view (with a CREATE VIEW sql
command, not to be confused with the V in MVC) and give the Django
developer access to this. This is only a rea
On Tue, Jan 25, 2011 at 3:34 PM, kmpm wrote:
> I have some issues with getting hold of the instance of a Model to which a
> RelatedManager got contributed to.
> Is that at all possible and if so, how?
> From my_method below I can get hold of the model RelatedStuff by calling
> self.model but that
What steps will reproduce the problem? 1. install the above programs
2. create a project 3. run syncdb
Note: I have installed mySQL to support UTF 8. I also create the
mysite_db database using CREATE DTABASE mysite_db CHARACTER SET =
UTF8;
What is the expected output? What do you see instead?
sy
On Tue, Jan 25, 2011 at 7:03 AM, Daniel Roseman wrote:
> On Tuesday, January 25, 2011 9:42:59 AM UTC, Venkatraman.S. wrote:
>>
>> Hi,
>>
>> I was wondering whether there any freelancers/companies who offer
>> code-review as a service.
>> IMHO, a code review helps in almost all occasions, but the f
Hi Karen,
I did with two fields - storing a date and a date resolution.
The values could be:
date / resolution - display value
1984-12-31 / Exact Date - 31st December 1984
1984-12-01 / Month - December 1984
1984-01-01 / Year - 1984
So I just used the first of the month where unknown, and Janua
class CertForm(forms.Form):
agree = forms.BooleanField(required=True, label="I confirm the above and
agree.")
cert = forms.BooleanField(required=False, label="I require a
certificate")
class UserAccountForm(ModelForm):
class Meta:
model = UserAccount
class VideoAccountForm(Mo
It's ok by me to return something generic or even raise an exception if I'm
calling directly using RelatedStuff.objects.my_method().
Is it possible for my_method to access MainStuff instance or at least find
out which way it is accessed?
Imagine I got a instance of MainStuff like this...
main =
I am running Django with uwsgi and Cherokee,
the pages load fine, even those with database access.
As you can see, they usually render with like 100 msec but when I go to the
Login view which is provided by Django, It takes 10 seconds an more to load.
I have only one uwsgi process and I am usin
> The descriptor protocol is the mechanism that allows both property and
> method:
> http://docs.python.org/reference/datamodel.html#implementing-descriptors
> http://users.rcn.com/python/download/Descriptor.htm
>
> In your case, something like the following could do:
This looks awesome. I had no
I would like to understand how Warning/Exception are treated in the
MySQL backend because I have a weird bug.
When I run the test suite of django-reversion on my production server
(Ubuntu 10.04) one test fail because MySQL give a warning instead of
an exception. If I run the same test on my testin
Malcolm Tredinnick gave a talk at Djangocon last year that touched on
this. He used a similar approach to Tim. Essentially he had a model
that had a DateField and a precision.
Malcolm has his slides up:
https://github.com/malcolmt/django-modeling-examples/blob/master/slides/modeling-challenges.pdf
Is there a reason why you inherit from forms.Form, but not forms.ModelForm ?
Is it successfully finding ModelForm without the reference to forms?
-Rob
On Tue, Jan 25, 2011 at 12:41 PM, MikeKJ wrote:
>
> class CertForm(forms.Form):
>agree = forms.BooleanField(required=True, label="I confirm
On Tuesday, January 25, 2011 5:41:35 PM UTC, MikeKJ wrote:
>
>
> class CertForm(forms.Form):
> agree = forms.BooleanField(required=True, label="I confirm the above
> and
> agree.")
> cert = forms.BooleanField(required=False, label="I require a
> certificate")
>
> class UserAccountForm(Mode
I'm trying to write the code and implement a file upload screen based
on this document:
http://docs.djangoproject.com/en/1.2/topics/http/file-uploads
I'm getting the following error:
Forbidden (403)
CSRF verification failed. Request aborted.
Help
Reason given for failure:
CSRF token missin
I have three models like so:
class Person(models.Model):
name = models.CharField(max_length=128)
class Group(models.Model):
name = models.CharField(max_length=128)
members = models.ManyToManyField(Person, through='Membership')
class Membership(models.Model):
person = models.ForeignKey(Pe
> In that form, I'd
> like to see a checkbox for each Person (member) and a text field for
> 'date_joined'. Anyway to do this?
You can create forms from models. See this page for more information:
http://docs.djangoproject.com/en/dev/topics/forms/modelforms/
You can always override the default
Am Dienstag, 25. Januar 2011, 19:48:48 schrieb etienned:
> I would like to understand how Warning/Exception are treated in the
> MySQL backend because I have a weird bug.
>
> When I run the test suite of django-reversion on my production server
> (Ubuntu 10.04) one test fail because MySQL give a w
Hey,
I've also struggled with CSRF for a while.
Maybe I can give you some guidance.
> you need to ensure:
>
> •The view function uses RequestContext for the template, instead of
> Context.
> •In the template, there is a {% csrf_token %} template tag inside each
> POST form that targets an intern
> In your case it would become something like:
>
> class Membership(ModelForm):
> class Meta:
> model = Membership
> fields = ('person', 'date_joined')
> widgets = {
> 'person' : CheckBox(),
> 'd
I had this need some time ago. You can check the answers of my
question on stackoverflow for different avenues:
http://stackoverflow.com/questions/2971198/how-to-deal-with-partial-dates-2010-00-00-from-mysql-in-django
Etienne
On Jan 25, 7:22 pm, David wrote:
> Malcolm Tredinnick gave a talk at D
I known that in admin.py I can put in search_fields with parameters I
want for search.
This works fine.
But I want another View just like advanced search in google.
There are boxes for me to specific each field. Like I can choose a
date etc. And I can give a range for my numeral fields. Or even do
On Wed, Jan 26, 2011 at 12:19 AM, bvdb wrote:
> A developer sometimes has to access and present data that existed
> before his application. Common practice is for a database
> administrator to define a database view (with a CREATE VIEW sql
> command, not to be confused with the V in MVC) and give
I am going nuts this should be simple but I keep getting a
verification error every time in my response in the following code. I
double checked my APP_ID and SECRET I try the following code. I'm
using python2.5. Any help appreciated.
def login( request ):
parms = { 'client_id': settings.FACE
Perhaps you could override the save method and make it like this:
def save(self,*args,**kwargs):
pass
Would that work? This is also a curiosity I have, but didn't have a chance
to test it.
Any thoughts?
George
On Wed, Jan 26, 2011 at 12:22 AM, Russell Keith-Magee <
russ...@keith-magee.com>
I am getting the following error when I try a complicated filter with a join
involving bboverlaps.
Join on field 'shape' not permitted. Did you misspell 'bboverlaps' for
the lookup type?
Here is the line that causes the problem.
saved_properties =
saved_properties.filter(property__parcel__shape
Hi,
Is your request.get_host() the same defined in Facebook app settings? (Web site
section if I can recall correctly), facebook doesn't accept 127.0.0.1 as
redirect url and might not accept localhost too.
Check social_auth/backends/facebook.py on
https://github.com/omab/django-social-auth
for a
Not sure if http://docs.djangoproject.com/en/dev/ref/contrib/admin/actions/
will be of some help. See admin.site.disable_action('delete_selected')
; but this is only via the admin app. You could build some logic in the model
by overriding the save() method, conditionally, based upon user. So your
Hi -
I'm trying to cut over my project to use the new staticfiles
application. I'm using the dev server with DEBUG = True on a recent
SVN trunk checkout. My STATIC_URL is '/static/' and my MEDIA_URL is
'http://localhost:8000/media/' in this environment.
My first confusion point:
Maybe it was just
2011/1/25 bvdb
> A developer sometimes has to access and present data that existed
> before his application. Common practice is for a database
> administrator to define a database view (with a CREATE VIEW sql
> command, not to be confused with the V in MVC) and give the Django
> developer access
Op 26-jan-2011, om 06:46 heeft Brian Neal het volgende geschreven:
> Hi -
> I'm trying to cut over my project to use the new staticfiles
> application. I'm using the dev server with DEBUG = True on a recent
> SVN trunk checkout. My STATIC_URL is '/static/' and my MEDIA_URL is
> 'http://localhost:
On Wednesday 26 January 2011 05:57:01 B. Heath Robinson wrote:
> I am getting the following error when I try a complicated filter with a
> join involving bboverlaps.
>
> Join on field 'shape' not permitted. Did you misspell 'bboverlaps' for
> the lookup type?
>
>
> Here is the line that causes t
79 matches
Mail list logo