I'm writing a simple CMS, it stores page file data on local file system
instead of SQL server.
I do overrides the model Page's Manager, but it not works as expected,
problems
- PageManager.all(it calls PageQuerySet?) doesn't works
- I can create Page object in Admin, but can't view it
I created a model to save map,
a map is contains many room(RoomConfig).
# model
class RoomConfig(models.Model):
room_name = models.CharField(max_length = 64)
room_to_room = models.ManyToManyField('self', through =
'RoomToRoomConfig')
class RoomToRoom(models.Model):
DIRECTION_CHOICES
;bayua...@gmail.com> wrote:
> Hi Shuge Lee,
>
> On 10/9/09, Shuge Lee <shuge@gmail.com> wrote:
>
>
>
>
>
>
>
> > Environment: ubuntu 9.04 + django 1.1 + apache 2.*
>
> > I did followinghttps://wiki.ubuntu.com/Django
>
> > however, I g
Environment: ubuntu 9.04 + django 1.1 + apache 2.*
I did following https://wiki.ubuntu.com/Django
however, I got this error message
http://dpaste.com/105064/
My configure file:
cat /etc/apache2/sites-available/online
http://dpaste.com/105065/
The file and path structure of my django project:
How to get current URL ?
--~--~-~--~~~---~--~~
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
How to make it with nice way?
I do override with stupid way:
http://dpaste.com/83943/
Anyone have better idea?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email
For user could login with email or username,
I did as what this page
http://www.djangosnippets.org/snippets/74/
said
# in settings.py
# ...
AUTHENTICATION_BACKENDS = (
'online.accounts.backends.EmailOrUsernameModelBackend',
'django.contrib.auth.backends.ModelBackend'
)
# ...
l...@lab
django.contrib.auth.models.User
I don't like models.User, but I like Admin view, and I will keep admin
view in my application.
How to overwirte models.User
Make it just look like following
class ShugeUser(User)
username = EmailField(uniqute=True, verbose_name='EMail as your
username',
I see.
Thanks.
On Aug 3, 1:54 pm, Daniel Roseman <dan...@roseman.org.uk> wrote:
> On Aug 3, 1:29 pm, Shuge Lee <shuge@gmail.com> wrote:
>
> > NO
>
> > just image add new seed in admin
>
> > upload a file with status "UNAPPROVE"
>
'
>
> def __setattr__(self, k, v):
> if k == 'status':
> self.name = v.lower()
> super(Foo, self).__setattr__(k, v)
>
> f = Foo()
> f.status = 'APPROVE'
> print f.status # will print 'APPROVE'
> print f.name # will print 'approve
I think Django could add new API for FileField
such as
FileField.change_path(new_path)
On Aug 3, 7:28 am, Shuge Lee <shuge@gmail.com> wrote:
> Please take a lookhttp://dpaste.com/74606/
>
> or here
>
> # in models.py
>
> UNAPPROVE = 0
> ACCEPT = 1
&
Please take a look
http://dpaste.com/74606/
or here
# in models.py
UNAPPROVE = 0
ACCEPT = 1
REJECT = 2
unapprove_path = os.path.join(MEDIA_ROOT, 'unapprove')
accept_path = os.path.join(MEDIA_ROOT, 'accept')
reject_path = os.path.join(MEDIA_ROOT, 'reject')
def get_filepath(instance,
Take a look here
http://dpaste.com/73953/
or following
# in models.py
class Seed(models.Model):
name = models.CharField(max_length=128)
UPLOAD_ROOT = 'uploads'
files = models.FileField(upload_to=UPLOAD_ROOT, blank=True,
null=True)
source = models.CharField(max_length=256,
://groups.google.com/group/django-users/browse_thread/thread/7b42604519c3b27e/2e01f339cdf0c3cc?lnk=gst=get+model+value+in+form#2e01f339cdf0c3cc
On Jul 30, 10:06 pm, Shuge Lee <shuge@gmail.com> wrote:
> http://dpaste.com/73301/
--~--~-~--~~~---~--~~
You
http://dpaste.com/73301/
--~--~-~--~~~---~--~~
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
# cat models.py
class Seed(models.Model):
name = models.CharField(max_length=128, unique=True)
category = models.ForeignKey(Category)
source = models.CharField(max_length=256)
now, I want
source = category + '/' + name
if user doesn't fill source field in admin view
How to do that
models.py
http://gpaste.com/p/3747b
admin.py
http://gpaste.com/p/3d432
--~--~-~--~~~---~--~~
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
I want to redirect with HttpResponseRedirect or stop and display a
error message in admin view,
when user change some record in admin view while it not means some
conditions.
I try to rewrite save() in models.py
class Seed(models.Model):
def save(self):
if
I got it
On Jun 18, 5:36 pm, Daniel Roseman <dan...@roseman.org.uk> wrote:
> On Jun 18, 9:39 am, Shuge Lee <shuge@gmail.com> wrote:
>
> > Search is used in most of CMS,
> > for avoid re-invent the wheel, please provider a search engine module.
>
> h
Search is used in most of CMS,
for avoid re-invent the wheel, please provider a search engine module.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to
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 $
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 $
For some reason, I want to create a static file after user change
record of DB with admin view, I need to use signal
http://docs.djangoproject.com/en/dev/topics/signals/#topics-signals
, or other stuff?
--~--~-~--~~~---~--~~
You received this message because you
How to doing something after change record of DB with admin view?
For some reason, I want to create a static file after user change
record of DB with admin view, I need to use signal
http://docs.djangoproject.com/en/dev/topics/signals/#topics-signals
, or other stuff?
thanks
On Dec 30 2008, 1:26 pm, "James Bennett" <ubernost...@gmail.com>
wrote:
> On Mon, Dec 29, 2008 at 3:38 AM, Shuge Lee <shuge@gmail.com> wrote:
> > return render_to_response( 'a.html', {'obj': obj, 'category':
> > Category} )
>
Is this a bug ?
On Dec 29, 9:30 pm, Shuge Lee <shuge@gmail.com> wrote:
> I sure I have wrote '(r'^comments/', include
> ('django.contrib.comments.urls')),' into /path/to/project/url.py
>
> On Dec 29, 7:47 pm, Grigory Fateyev <g...@anastasia.ru> wrote:
>
> >
I sure I have wrote '(r'^comments/', include
('django.contrib.comments.urls')),' into /path/to/project/url.py
On Dec 29, 7:47 pm, Grigory Fateyev <g...@anastasia.ru> wrote:
> Hello Shuge Lee!
> On Mon, 29 Dec 2008 01:38:26 -0800 (PST) you wrote:
>
>
&g
setting.py
...
INSTALLED_APPS = (
...
'django.contrib.comments',
...
python manage.py syncdb
...
view.py
from shuge.fap_soft.models import * #Category
return render_to_response( 'a.html', {'obj': obj, 'category':
Category} )
a.html
...
{% load comments %}
{% render_comment_form for
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
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
>
I got another idea for it now.
Thank for your reminder. :-)
On Dec 15, 2:00 pm, Malcolm Tredinnick
wrote:
> On Sun, 2008-12-14 at 21:32 -0800, lee wrote:
>
> [...]
>
> > It seems that official docs hasn't give a reference to howto define
> > 'ON DELETE CASCADE ON
# mysql.sql
CREATE TABLE IF NOT EXISTS `os` (
`id` int(11) NOT NULL auto_increment,
`name` varchar(64) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=6 ;
INSERT INTO `os` (`id`, `name`) VALUES
(1, 'All'),
(2, 'Windows'),
(3,
32 matches
Mail list logo