Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I show list of available things in database against a search. Now i want to make each item fetched by database a link which can lead to another page and on that page i could show this chosen item in detail. So my problem is how can i pass this information from this page to the new page?
You can pass the id of your item, so in the new page you can query again the database for more details.
if you use include tag you can pass object also:
{% include "url/to/your/template" with object=your_object %}
and then inside your detail's template you can call as usual
{{ your_object.detail }}
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 months ago.
Improve this question
Can you please provide an example of views.py for updating(or creating) fields without using forms.py?
Here you go.
Please, next time, do some research.
Just searching "django update or create" will give you a very nice django doc to the queryset method.
obj, created = Person.objects.update_or_create(
first_name='John', last_name='Lennon',
defaults={'first_name': 'Bob'},
)
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 1 year ago.
Improve this question
i've a question and need your help
i have a empty form with about 10 input fields. all i want to do is :
if a user fill in the user's login name and hit the tab key - the other fields should be filled out with the related data stored in the database. like users location, email etc.
could some give me a cfml related example please?
Here is how to approach this:
Use javascript to check for on tab event ( key press for the tab key )
Call a cfc, passing the value of the input field to the cfc
query the database for a field that matched exactly that data
return the data as json and populate the rest of the fields.
Assuming you have basic javascript and cfml skills this would be the way I would approach this.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I'm trying to customize Sales 365. I need a field in a Lead form to multiselect items from Account View.
Is there any way to do it without coding?
Thanks
You can't have a field but you can have a subgrid, relationship between Lead and Account will be N:N, in this way the user can select multiple records from the Account entity.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
As of now i am facing some problem with field bind issue while get the response from coveo, inside the this method ToCoveoFieldName is implemented. Any one can help me on this.
Code snippet
raw.<%= ToCoveoFieldName("field Name", false)
Since you are having issues with this call, I am assuming that you might be migrating to the Coveo for Sitecore Hive Framework implementation, which mostly shifted from a back-end implementation to a front-end one for all of its major field logic.
This means that ToCoveoFieldName is not available any more on the server side. Instead, there is a JavaScript implementation of the same logic.
For instance, if you want to translate a field to the Coveo format, you can use CoveoForSitecore.Context.fields.toCoveo("field name").
I can see in your question that you are within a result template, there are already two helpers to get you either the field name or the value.
<div data-field={{= coveoFieldName("field name") }}>
and
<div>{{= coveoFieldValue("field name") }}</div>. (This one is the equivalent of calling raw[coveoFieldName("field name")])
Those helpers are explained in more details in the documentation, on the Editing the Content of a Result Template page (for version 5.0+) and Coveo Fields Resources Component page (for versions <5.0 and 4.1+).
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
Question about DRF serializers. Especially ModelSerializer.
There are two versions with Foreign Key:
field = CharField(source='user.name')
field = SeriaizerMethodField()
get_field(self, obj):
return obj.user.name
What will work better / quickly ?
UPD
yes, I know about select/prefetch_related.
But is better just to pull required field from database and serialized it automaticaly or pull some 'raw' fields and nicely join them in serializer?
There are no difference between them. If you want to improve speed you should do it in a view by calling select_related method of a queryset.
YourModel.objects.select_related('user')
It'll join user table and calling user.name atribute will not hit a database next time
First one provides different validation options from the box. While the second one is something very customizable and doesn't provide any validation itself.