Good morning,
I was wondering how to implement the following without having to
hardcode each url.
I have different apps like i.e. books, authors, magazines, etc.
Normally I would call upon default views by using something like:
http://localhost/books/James_and_the_Giant_Peach
or http://localhost/
just tried it out. worked perfectly. thanks!
On Tue, Jun 16, 2009 at 3:18 PM, Rochak Neupane wrote:
> ohh, thanks, Daniel! I like your way. and i don't even my to expose the
> user_id in a form.I'll try that.
>
>
> On Mon, Jun 15, 2009 at 10:55 PM, Daniel Roseman wrote:
>
>>
>> On Jun 16, 1:12 a
On Jun 17, 7:39 am, "C. Feldmann"
wrote:
> Good morning,
>
> I was wondering how to implement the following without having to
> hardcode each url.
> I have different apps like i.e. books, authors, magazines, etc.
> Normally I would call upon default views by using something
> like:http://localho
Hi,
I have installed migration tool 'south' on windows.In settings.py,
what path I will have to give in installed apps? I just gave 'south'.
I got this error -
AttributeError: 'module' object has no attribute 'adminsouth'
thanks
--~--~-~--~~~---~--~~
You received
k, got it working
forgot a comma in setting file
On Jun 17, 2:35 pm, vishy wrote:
> Hi,
>
> I have installed migration tool 'south' on windows.In settings.py,
> what path I will have to give in installed apps? I just gave 'south'.
> I got this error -
> AttributeError: 'module' object has no att
On Jun 17, 3:52 am, DaveB wrote:
> I have what must be a common problem: there are three master files,
> and a transaction in my admin site involves selecting an item from
> each of these files. The field in the Transaction table is a foreign
> key pointer to the master file's record. The default
I have a need to define 2 models, both with a large number of fields
in common, but where in once case these common fields are completely
optional, and in the other case they are mandatory.
class XYZTemplate(Model):
field_a = TextField( blank=True)
field_b = TextField( blank=True)
I have built much time ago an app in Django (it was still pre-nfa era,
django 0.96)
now i'm updating it for django 1.1, but when I try to _reset_ the db
schema, django can't find it in the INSTALLED_APPS setting, but it's
actually there.
Any idea about what could it be?
Thanks,
Flavio Curella.
On Tue, Jun 16, 2009 at 4:43 PM, MiratCanBayrak wrote:
>
> Hi i wrote an application called category. As you guess it an
> application to hold categories. Than i wanted to use it on my site. I
> wrote a function that builds html code for displaying categories, but
> now i want to use that view as
Nevermind. Messy code :P
On Jun 17, 12:22 pm, Flavio Curella wrote:
> I have built much time ago an app in Django (it was still pre-nfa era,
> django 0.96)
>
> now i'm updating it for django 1.1, but when I try to _reset_ the db
> schema, django can't find it in the INSTALLED_APPS setting, but i
Ok, after looking through the django wiki entries for AuditTrail
(http://code.djangoproject.com/wiki/AuditTrail) and DynamicModels
(http://code.djangoproject.com/wiki/DynamicModels), I guess I can see
that there is a potential solution there.
But I'd still appreciate any comments on the desirabil
Yup. That is exactly what I wanted to do... I hadn't made up my mind
onto wether I wanted to force a redirect or stick with the original
URL. But as you mentioned the SEO aspect is important and an added
bonus would be that a canonical url would "feel" more structured.
Thanks for the quick reply.
Hi,
I have been creating a gallery, which has albums. I would like to
restrict the albums, say album1 to a set of users, say userA and userB
and album2 to userC. So userA & userB cannot view album2 and userC
cannot view album1.
>From the documentation it says: "Permissions are set globally per t
On Jun 17, 7:39 am, "C. Feldmann"
wrote:
> Good morning,
>
> I was wondering how to implement the following without having to
> hardcode each url.
> I have different apps like i.e. books, authors, magazines, etc.
> Normally I would call upon default views by using something
> like:http://local
Hi,
I would like to be able to select objects and order them by the count
of a related field
For example, I have 2 models:
class Author(models.Model)
name = models.Charfield(max_length=20)
class Article(models.Model)
author = models.ForeignKey(Author)
content = models.TextField()
You can acces a models field through Model._meta.fields. You can probably
loop through these fields in your Model's __init__ method, and change their
blank attribute to false.
TiNo
On Wed, Jun 17, 2009 at 13:32, Richard Colley wrote:
>
> Ok, after looking through the django wiki entries for Audi
Thanks TiNo,
Are there any caveats with this? e.g. to make syncdb etc. work
correctly?
On Jun 17, 10:13 pm, TiNo wrote:
> You can acces a models field through Model._meta.fields. You can probably
> loop through these fields in your Model's __init__ method, and change their
> blank attribute to
I am quite new on all these things - lighttpd(1.4.18), django(ver
1.0.2 final) and python:(. My lighttpd and django are ready. One
problem I got is the login next URL is always append to lighttpd
rewrite URL. Here is detail of my question:
My lighttpd uses fastcgi for multiple sites:
===
On Jun 17, 1:12 pm, R C wrote:
> Hi,
>
> I would like to be able to select objects and order them by the count
> of a related field
>
> For example, I have 2 models:
>
> class Author(models.Model)
> name = models.Charfield(max_length=20)
>
> class Article(models.Model)
> author = models.F
Hi everyone,
I'm looking into Grappelli's awesome admin interface, but my login is
missing any sort of branding, and it looks like I'd have to override
their template and add some CSS to fix it. Am I just missing
something? or are other people seeing the same thing?
Kind regards,
Brandon
--~--~-
> Your question is very difficult to read - needs paragraphs.
>
> But I think the answer to your problem is to define a __unicode__
> method on the target model.
> --
> DR.
I will try to be clearer and briefer:
Django's built-in admin system automatically generates data-entry
forms for the fiel
The answer was given to you in the previous post.
Whatever __unicode__() returns from your model is what will be
displayed.
So, on your model, define a __unicode__ method:
e.g.
class Person(...):
def __unicode__(self):
return self.name
On Jun 18, 12:03 am, DaveB wrote:
> > Your
On Wed, Jun 17, 2009 at 14:42, Richard Colley wrote:
>
> Thanks TiNo,
>
> Are there any caveats with this? e.g. to make syncdb etc. work
> correctly?
I don't know, as I never tried, and I am not very experienced with messing
with the inner meta class, but: blank has nothing to do with syncdb, o
Yeah, I stripped out the nulls=True/False out of the example. I do
want the database to enforce this constraint. I'll give it a try
tomorrow and report back whether syncdb etc. are happy. If anyone
has any wise words in the meantime... :)
On Jun 18, 12:20 am, TiNo wrote:
> On Wed, Jun 17, 20
Is there a generally accepted workaround for the problem of sorting
relational models by more than one field? I have a model that
represents recurring payments between a person and an object and it
would be really nice to order by the object, year, and creation date
in the admin app change list.
-
On Jun 17, 1:25 pm, Joshua Russo wrote:
> Is there a generally accepted workaround for the problem of sorting
> relational models by more than one field? I have a model that
> represents recurring payments between a person and an object and it
> would be really nice to order by the object, year,
On Jun 9, 9:19 am, Sean Brant wrote:
> "Did MediaTemple change something about the file system you have
> access to? It sounds like they must have changed something so that
> the file locking code that used to work for your setup is no longer
> working."
>
> That is what it sounds like to me, ho
Nope, there customer support takes to long so I just gave up. Please
post if you have any updates. Last I remember it might be a NFS issue
on there end. Not really sure.
On Jun 17, 2009, at 9:43 AM, mmarshall
wrote:
>
> On Jun 9, 9:19 am, Sean Brant wrote:
>> "Did MediaTemple change some
Thanks for your fast reply
I realize that there is no "count" field in my article model. However
in my templates I am able to do things like:
Author.article_set.count
I just can't do the same thing in my views when building a
queryset.I would really like to be able to select Authors and
Well, here's what I know: I had this issue several months back and
'solved' it by disabling the in memory upload handler. I wrote a
little about it at the bottom of this thread:
https://forums.mediatemple.net/viewtopic.php?id=2514
But it looks like in Django 1.1beta the TemporaryFileUploadHand
On Wed, Jun 17, 2009 at 10:00 AM, R C wrote:
>
> Thanks for your fast reply
>
> I realize that there is no "count" field in my article model. However
> in my templates I am able to do things like:
> Author.article_set.count
>
> I just can't do the same thing in my views when building a
> que
Thanks, it worked!
Both of you have been very helpful.
On Jun 17, 5:04 pm, Alex Gaynor wrote:
> On Wed, Jun 17, 2009 at 10:00 AM, R C wrote:
>
> > Thanks for your fast reply
>
> > I realize that there is no "count" field in my article model. However
> > in my templates I am able to do thi
This was because I had bad sys.path.append directories hidden in a global
file. Fixed this to point to right directory and all problems went away.
Wish I had the last 24 hrs back though :(
On Tue, Jun 16, 2009 at 6:26 PM, thesheff wrote:
> I have cleaned up my model view and I thought for sure
Does Django have to run with Python-2.5 ?
l...@lab ~/online $ python2.6 manage.py runserver
Traceback (most recent call last):
File "manage.py", line 2, in
from django.core.management import execute_manager
ImportError: No module named django.core.management
l...@lab ~/online $
--~--~---
On Wed, Jun 17, 2009 at 11:44 AM, Shuge Lee wrote:
>
> Does Django have to run with Python-2.5 ?
>
>
> l...@lab ~/online $ python2.6 manage.py runserver
> Traceback (most recent call last):
> File "manage.py", line 2, in
>from django.core.management import execute_manager
> ImportError: No
Does Django have to run with Python-2.5 ?
l...@lab ~/online $ python2.6 manage.py runserver
Traceback (most recent call last):
File "manage.py", line 2, in
from django.core.management import execute_manager
ImportError: No module named django.core.management
l...@lab ~/online $
--~--~---
On Wed, Jun 17, 2009 at 12:44 PM, Shuge Lee wrote:
>
> Does Django have to run with Python-2.5 ?
>
>
> l...@lab ~/online $ python2.6 manage.py runserver
> Traceback (most recent call last):
> File "manage.py", line 2, in
>from django.core.management import execute_manager
> ImportError: No
Django 1.1 rev 11018
stores = ReleaseStoreLink.objects.filter(release=self) \
.select_related('store','store__contact') \
.only('url','store__name','store__contact__url')
ss = stores[0]
ReleaseStoreLink has a method logo, it is not a db field
when using t
I have this in my model:
class Machine(models.Model):
name = models.CharField(max_length=100)
cpuInfo = models.ForeignKey(Cpu, blank=True, null=True)
class Cpu(models.Model):
l = models.CharField(max_length=50)
num = models.IntegerField()
so basically I add machines to the Machi
Check out the article on developerworks:
http://www.ibm.com/developerworks/opensource/library/os-django-admin/index.html
The method they show changes the redirect after saving changes, but
should be easily modifiable to simply create a popup preview window
when the user clicks the "Save and cont
Hey guys,
I have a lot of data from various testing samples (simple 2D
plotting points) in .csv format. I am looking to design a system to
manage things like plotting, calculations, selecting individual
samples and tests, etc. by creating a data manager with an intuitive
interface.
My question
On Wed, 2009-06-17 at 12:55 -0500, Dan Sheffner wrote:
> I have this in my model:
>
> class Machine(models.Model):
> name = models.CharField(max_length=100)
> cpuInfo = models.ForeignKey(Cpu, blank=True, null=True)
>
> class Cpu(models.Model):
> l = models.CharField(max_length=50)
>
Yes so I start with machines and then I find out what CPU's they have and
add them to the database.
I get this error: TypeError: 'Cpu' object is not iterable
So this is what I have so far:
def processor(self):
self.machineList = Machine.objects.values_list('name',
flat=True).filter(type
Defined the this model:
class ModifyGroup(models.Model):
user = models.ForeignKey(User, verbose_name='User',
related_name='group_mod_request', null=True, blank=True) #account to
be modified
date = models.DateField('Request Date', auto_now_add=True)
group_from = models.CharField('From
ok Fixed it. Thanks for the help your example def helped. I have been
banging my head for awhile :)
def processor(self):
self.machineList = Machine.objects.values_list('name',
flat=True).filter(typeInfo__l__exact="Linux Server")
for server in self.machineList:
numProc
On Wed, Jun 17, 2009 at 2:46 PM, dj wrote:
>
> Defined the this model:
>
> [snip]
> When the data table (sqlite) is empty, I can save an instance of this
> object with no errors.
> However, once there is an existing instance of the object in the data
> table, saving another
> instance of this obj
ok so I have a list of servers that have a one to one relationship with a
table called cpu. When I delete a server from the server table it should
also delete it one to one relationship with the cpu entry. right? do I
need to pass something extra in the models.py to have this happen?
--~--~
I have a nice test fixture that loads my local database without
incident. I'm using postgresql 8.3 at home on ubuntu. I use the
fixture at home all the time. Trying to run it on webfaction, I get
the following error:
[key...@web58 schoolicity]$ python2.5 manage.py loaddata
full_load.json
Installi
On 17-Jun-09, at 12:48 PM, Keyton Weissinger wrote:
> backends/util.py", line 19, in execute
>return self.cursor.execute(sql, params)
> DataError: value too long for type character varying(4)
>
>
> Any ideas?
The unhelpful answer is that the field is too long. One way to get
this is to hav
Hello,
When I try to send an e-mail via mail_admins method, I receive an
SMTPDataError with the value: (503, '5.5.1 RCPT first. e9sm3788894muf.
32').
Here is the code:
def send_mail(self):
from django.core.mail import mail_admins, send_mail
mail_admins(self.cleaned_data['su
Thanks, I'll look into it and post back if I solve this.
Rodrigo
On Jun 17, 1:32 pm, Liam Chasteen wrote:
> Check out the article on developerworks:
>
> http://www.ibm.com/developerworks/opensource/library/os-django-admin/...
>
> The method they show changes the redirect after saving changes, b
This is just a shot in the dark, but you might try setting the "message"
property on your exception object. It could be that django's pretty
exception printing is calling that directly instead of casting to a string.
If that's the case, you should file a bug because Exception.message is
deprecat
Nope, you'll need to set a variable in your view. You can also try creating
your own filter such that {% if friend|is_in_group %} would work (it's
pretty easy to do, just check out the docs for custom template filters)
On Tue, Jun 16, 2009 at 2:40 PM, CrabbyPete wrote:
>
> Is there a way do so
On Jun 17, 7:41 am, pagetribe wrote:
> Hi,
>
> I have been creating a gallery, which has albums. I would like to
> restrict the albums, say album1 to a set of users, say userA and userB
> and album2 to userC. So userA & userB cannot view album2 and userC
> cannot view album1.
>
> From the docum
Thanks, Andy.
New problem...
I've recreated the problem locally on postgres. But I've gone back to
sqlite3 and the loaddata works from scratch. Is there a way I can tell
which items from the sqlite3 db is giving me problems in postgres?
Thank you!
Keyton
On Jun 17, 3:51 pm, Andy McKay wrote:
Another option is to install the snippet below, which supports "in":
http://www.djangosnippets.org/snippets/1350/
On Jun 17, 1:53 pm, Ben Davis wrote:
> Nope, you'll need to set a variable in your view. You can also try creating
> your own filter such that {% if friend|is_in_group %} would wo
For those of you who, like me, have enjoyed SmileyChris's excellent
smart if tag, you may find the following extension useful:
http://www.djangosnippets.org/snippets/1572/
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Gro
Hi Josh,
On Jun 17, 10:25 am, Joshua Russo wrote:
> Is there a generally accepted workaround for the problem of sorting
> relational models by more than one field? I have a model that
> represents recurring payments between a person and an object and it
> would be really nice to order by the obj
I believe what you are looking for is a custom authentication backend. I
had to do this for one of my sites that used an XMLRPC api to authenticate
against a remote server. You'll want to create a class that extends
django.contrib.auth.backends.ModelBackend , and add it to the
AUTHENTICATION_BAC
On Jun 17, 2:06 pm, blaine wrote:
> Hey guys,
> I have a lot of data from various testing samples (simple 2D
> plotting points) in .csv format. I am looking to design a system to
> manage things like plotting, calculations, selecting individual
> samples and tests, etc. by creating a data ma
Here is the essentials from my models.py file:
class Event (models.Model):
contact = models.CharField(max_length=100)
email = models.CharField(max_length=100)
url = mod
I've recreated this behavior with the following examples. (using
1.0)
#models.py
class Building(models.Model):
name = models.CharField(max_length=10)
floors = models.IntegerField()
class Unit(models.Model):
unit_number = models.IntegerField()
bedrooms = models.IntegerField()
building
On Wed, Jun 17, 2009 at 8:49 PM, IanR wrote:
>
> I've recreated this behavior with the following examples. (using
> 1.0)
>
> #models.py
> class Building(models.Model):
> name = models.CharField(max_length=10)
> floors = models.IntegerField()
>
> class Unit(models.Model):
> unit_number = mode
I would prefer my own views.
On Jun 18, 6:58 am, Rajesh D wrote:
> On Jun 17, 7:41 am, pagetribe wrote:
>
> > Hi,
>
> > I have been creating a gallery, which has albums. I would like to
> > restrict the albums, say album1 to a set of users, say userA and userB
> > and album2 to userC. So userA
Awesome, __unicode__() works fine. Thanks very much for your help!
-Dave
--~--~-~--~~~---~--~~
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 uns
That sounds like a great idea. Something i have been meaning to try
for a while but haven't gotten around to.
For a class website i did try to use matplotlib to create graphs from
user provided data within django but couldn't figure out how to get it
to work smoothly. Ended up using Jacobs google
if request.method == 'GET':
if listing_id > '0':
listing=Listing.objects.get(pk=listing_id)
form = ListingForm(instance=listing)
else:
print "In listings GET source=",
request.session
A friend of mine is using Django with matplotlib to create graphs from CSV
files, and it's turning out pretty well. I haven't yet tried googlecharts,
but it looks promising.
The main difficulty he had with Matplotlib was transitioning to
Apache/mod_python after working with the Django development
Oops werong action - incomplete message.
I have a ModelForm:
class ListingForm(ModelForm):
class Meta:
model = Listing
that has a method that, for a new record, should set the ForeighKey
field "source" to an object identified in the UserProfile. The "date"
value is store
Hi,
Does restarting apache or fast cgi server help? Do you access the page
through a proxy?
Thomas
neri...@gmail.com schrieb:
> Hello,
>
> I'm trying to make changes to views and forms but when I refresh the
> browser to view/try the changes nothing seems to have changed. I
> normally do "tou
http://code.djangoproject.com/wiki/DjangoSpecifications/Core/Threading
states that "as of 1.0.2, Django has no known threading bugs," and
then promptly goes on to list a lot of annoying things you have to do
in a multithreaded system. Do you or don't you have to do that stuff
in a multithreaded ap
71 matches
Mail list logo