Hello all!
Is it possible to find out current user id form "myapp/models.py" file
so i can customize the way it is saved from the admin interface?
I'd like to do something like
class Myapp(models.Model):
...
...
def save(self):
if user.is_superuser:
On Tue, Jul 8, 2008 at 10:02 AM, moos3 <[EMAIL PROTECTED]> wrote:
>
> does any know why the auto_rename loses the file name but not the
> extension?
Not familiar with auto_rename but maybe if you show a little code and
explain what you are trying to do then someone can help.
--
Milan
Hi,
I would need to do a query like
SELECT * FROM mytable WHERE match (a) against("+AAA" in boolean mode)
and match (b against("+BBB" in boolean mode)
and match (a,b) against("+AAA +BBB" in boolean mode)
If I would omit the last line (which seems to be redundant) I could do
this easily with the
On Tue, Jul 8, 2008 at 10:00 AM, Milan Andric <[EMAIL PROTECTED]> wrote:
> On Mon, Jul 7, 2008 at 6:22 AM, d-rave <[EMAIL PROTECTED]> wrote:
>>
>> Has anyone successfully got formtools.preview working with
>> forms.ModelForm so that the form fields are populated from the model.
>>
>> If so, do
does any know why the auto_rename loses the file name but not the
extension?
--~--~-~--~~~---~--~~
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
On Mon, Jul 7, 2008 at 6:22 AM, d-rave <[EMAIL PROTECTED]> wrote:
>
> Has anyone successfully got formtools.preview working with
> forms.ModelForm so that the form fields are populated from the model.
>
> If so, do you have an example??
Dave, I'm not familiar with formtools but if all you want
You'll want to check out django.db.models.fields,
django.db.models.fields.subclassing, and django.core.validators as
starting points for creating a new Field type with a custom validator.
In addition, there's a js attribute for class Admin you can use to
bring in the necessary JavaScript into
On Jul 8, 2:40 pm, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> On Tue, 2008-07-08 at 06:22 -0700, Stuart Grimshaw wrote:
> > I'm getting this error when trying to view my admin interface ...
>
> > In template /usr/lib/python2.5/site-packages/django/contrib/admin/
> >
Resolved.
Answer for those interested:
def sort_by_attr(seq, attr):
import operator
intermed = map(None, map(getattr, seq, (attr,)*len(seq)),
xrange(len(seq)), seq)
intermed.sort()
return map(operator.getitem, intermed, (-1,) *
Problem solved. Just need to copy in my local version of Django
On Jul 7, 6:29 pm, Jon Loyens <[EMAIL PROTECTED]> wrote:
> Hi everyone,
>
> I've got a problem and I don't even know where to start debugging
> it... there seems to be a difference between the way my app is
> behaving between my
Ok i have a list of form fields, i want to sort the list by the
".label" of the fields.
I have tried a many different ways but i cant seem to make this work.
I know this is more of a python question but this is the best resource
I've found for these questions.
Can anybody throw an example up
On Tue, 2008-07-08 at 06:22 -0700, Stuart Grimshaw wrote:
> I'm getting this error when trying to view my admin interface ...
>
> In template /usr/lib/python2.5/site-packages/django/contrib/admin/
> templates/admin/base.html, error at line 28
> Caught an exception while rendering: Tried
I'm getting this error when trying to view my admin interface ...
In template /usr/lib/python2.5/site-packages/django/contrib/admin/
templates/admin/base.html, error at line 28
Caught an exception while rendering: Tried showSides in module
teamsheet.sheets.views. Error was: 'module' object has
I looked at the 3captus.com/download/django_calendar, but found it to
be somewhat cumbersome in terms of functionality. I don't want
anonymous users to create or delete calendar of events. Any more
suggestions or ideas?
-Mario
On Jul 7, 11:29 pm, bedros <[EMAIL PROTECTED]> wrote:
> I was
André,
I'm assuming that you are using the Trunk version of Django because
subclassing isn't supported in previous versions.
Assuming that.
You can either have Item be an Abstract class which does not act like
a table but just a parent class containing common items. (this is not
what you are
Hello all,
maybe there are some newforms-admin experts out there:
What's the right way to change the ordering of ManyToMany-fields
(displayed as select widgets) in newforms-admin? I need to change the
ordering *without* changing the respective model class.
Background: The default ordering of
If your REQUIRE_LOGIN_PATH is different in settings you can use this
middleware
http://www.djangosnippets.org/snippets/136/
Satheesh
On Jul 8, 2:25 pm, Daniel Hepper <[EMAIL PROTECTED]> wrote:
> Writing a middleware is probably a good solution.
>
> You can use this
>
On Tue, 2008-07-08 at 11:49 +0200, Marek Stępniowski wrote:
> How to create a field that is not stored in database, but is visible
> in Django newforms-admin? (I'm assuming there is a way)
A model "field" is something that is stored in the database, by
definition. If it's not stored in the
On Tue, Jul 8, 2008 at 4:33 AM, allisongardner
<[EMAIL PROTECTED]> wrote:
> Will look further into problem as it does not accept any of my user
> logins that have been created by the admin site, even though I know i
> am using the correct username and password. I do have shell access as
> I am
How to create a field that is not stored in database, but is visible
in Django newforms-admin? (I'm assuming there is a way)
I would like to define a field which acts as a kind of proxy. Setting
and getting value of this field actually runs some defined operation
(for example executes custom SQL
Hi Daniel,
No i didn't consider salted hashes (I have never heard of them is the
reason lol).
I have now reset it to the hash as you suggested and I can now login
in. THANK YOU!!!
Will look further into problem as it does not accept any of my user
logins that have been created by the admin site,
Sorry just to add I am a newbie. I looked up previous questions and
found:
"I'm greatly enjoying this excellent project.
However, I have a problem with users created through the admin web
interface being able to log into the admin site.
I get "Please enter a correct username and password." Even
Writing a middleware is probably a good solution.
You can use this one:
http://superjared.com/entry/requiring-login-entire-django-powered-site/
HTH,
Daniel
Am Dienstag, den 08.07.2008, 02:13 -0700 schrieb [EMAIL PROTECTED]:
> Django offers @login_required to redirect user to login method.
>
> so it's odd that my new project works with "python manage.py
> runserver" but gives me an error when i do "django-admin.py
> runserver." how is this possible?
Is it?
Have a look inside manage.py:
"
try:
import settings # Assumed to be in the same directory.
except ImportError:
import
Hi!
When you change the password with phpmyadmin, did you consider that
passwords are not stored in plaintext, but as salted hashes?
You can try to set it to this value:
sha1$3a68b$7fbea95491a9d04e3cf647d5c8e675da69e1d458
This should set your password to 'passwort' (without apostrophes).
Django offers @login_required to redirect user to login method.
But, If the site force user to login at first before they can do
something, I have to add @login_required to every views.
How to solve this problem with a more elegent way?
--~--~-~--~~~---~--~~
You
Hi! I went away for the weekend, when all was working fine, and having
come back to work I have found that I cannot login to the admin site.
Checked the database users passwords and they had automatically
changed themselves to random strings. I changed the user password back
in phpmyadmin but
Thx to both of you, I'll do it with AJAX then.
I'll have to find a way to make this work anyway if the user doesn't
have Javascript enabled.
Bibi
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users"
You can use the choices option in your model.
http://www.djangoproject.com/documentation/model-api/#choices
class Details(models.Model):
...
PROJECT_TYPES = (
('A', 'Type A'),
('B', 'Type B'),
)
project_type = models.CharField(max_length=30,choices=PROJECT_TYPES)
On Mon, 2008-07-07 at 21:50 -0700, bharathi wrote:
> I am creating one Django application with jquery..
> In that Jquery function am using One Ajax script.. Django code cant
> taken that ajax code...
>
> My code is:
>
> $(document).ready(
> function () {
>
On Jul 8, 9:50 am, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
>
> Django does not do any model field validation by default at the moment.
> Admin does it using an old system (essentially, oldforms and Add- and
> ChangeManipulators) that is being removed. We are adding more coherent
> model
Hi!
> on saving a Post
> wish to set created_on and updated_on
You can use a date time field with auto_now_add one with and auto_now
for that.
http://www.djangoproject.com/documentation/model-api/#datetimefield
Regards,
Daniel
--~--~-~--~~~---~--~~
You received
On 08-Jul-08, at 10:20 AM, bharathi wrote:
> I am creating one Django application with jquery..
> In that Jquery function am using One Ajax script.. Django code cant
> taken that ajax code...
this code must be put in the HEAD section of the html - so create a
block 'head' in the head
I am creating one Django application with jquery..
In that Jquery function am using One Ajax script.. Django code cant
taken that ajax code...
My code is:
$(document).ready(
function () {
$("#sortme").Sortable(
{
Hi
Just a quick query
Can url tags work with single quoted strings?
Another words why {% url my.view 'some_string' %} doesn't work but
{% url my.view ''some_string" %} works fine?
Could you add a small example about using quoted strings with tags,
like the above one, to
hi all
is it possible to determine the subclass of a model instance?
what i mean is this:
if you have a (n abstract) model class and two subclasses, like
class Item(models.Model):
pass
class Task(Item):
pass
class Event(Item):
pass
and you retrieve
items = Item.objects.all()
101 - 136 of 136 matches
Mail list logo